mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: jeff_chang@richtek.com
Cc: lgirdwood@gmail.com, robh@kernel.org, krzk+dt@kernel.org,
	conor+dt@kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH v3 1/2] regulator: rt5133: Add RT5133 PMIC regulator Support
Date: Mon, 21 Jul 2025 13:18:58 +0100	[thread overview]
Message-ID: <b4b3dde0-18a5-40d3-8cd2-53e4cdbd3e69@sirena.org.uk> (raw)
In-Reply-To: <20250721060215.2718217-1-jeff_chang@richtek.com>

[-- Attachment #1: Type: text/plain, Size: 1530 bytes --]

On Mon, Jul 21, 2025 at 02:01:34PM +0800, jeff_chang@richtek.com wrote:

> RT5133 is an intefrated chip. It includes 8 LDOs and 3 GPOs that
> can be used to drive output high/low purpose. The dependency of the
> GPO block is internally LDO1 Voltage. If LDO1 voltage output disabled,
> GPO cannot be used to drive output high. It need to pay more attention
> on the usage.

This looks mostly fine, a couple of very small nits below:

> +static irqreturn_t rt5133_intr_handler(int irq_number, void *data)
> +{
> +	struct rt5133_priv *priv = data;
> +	u32 intr_evts = 0, handle_evts;
> +	int i, ret;
> +
> +	ret = regmap_bulk_read(priv->regmap, RT5133_REG_BASE_EVT, &intr_evts,
> +			       RT5133_INTR_BYTE_NR);
> +	if (ret) {
> +		dev_err(priv->dev, "%s, read event failed\n", __func__);
> +		return IRQ_HANDLED;
> +	}
> +
> +	handle_evts = intr_evts & RT5133_BASE_EVT_MASK;

> +
> +	ret = regmap_bulk_write(priv->regmap, RT5133_REG_BASE_EVT, &intr_evts,
> +				RT5133_INTR_BYTE_NR);
> +	if (ret)
> +		dev_err(priv->dev, "%s, clear event failed\n", __func__);
> +
> +	return IRQ_HANDLED;

If there weren't any events flagged that we handled we should return
IRQ_NONE here, this supports shared interrupts and lets the error
handling in the interrupt core handle errors where the interrupt line
gets stuck.

> +// Due to crc, cache is not necessary
> +static const struct regmap_config rt5133_regmap_config = {
> +	.reg_bits = 8,
> +	.val_bits = 8,
> +	.max_register = RT5133_REG_LDO8_CTRL4,
> +};

Might be worth enabling a cache?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      parent reply	other threads:[~2025-07-21 12:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-21  6:01 jeff_chang
2025-07-21  6:01 ` [PATCH v3 2/2] dt-bindings: regulator: Add Richtek RTR5133 DT Binding Documentation jeff_chang
2025-07-21  8:04   ` Krzysztof Kozlowski
2025-07-21 19:46   ` Rob Herring
2025-07-21 12:18 ` Mark Brown [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b4b3dde0-18a5-40d3-8cd2-53e4cdbd3e69@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jeff_chang@richtek.com \
    --cc=krzk+dt@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®