Linux kernel and device drivers for NXP i.MX platforms
 help / color / mirror / Atom feed
From: Frank Li <Frank.li@oss.nxp.com>
To: joy.zou@oss.nxp.com
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Frank Li <Frank.Li@nxp.com>,
	Ye Li <ye.li@nxp.com>, Jacky Bai <ping.bai@nxp.com>,
	Peng Fan <peng.fan@nxp.com>, Joy Zou <joy.zou@nxp.com>,
	imx@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] regulator: pca9450: Correct default t_off_deb for PCA9451A/PCA9452
Date: Wed, 17 Jun 2026 22:07:51 -0500	[thread overview]
Message-ID: <ajNhBw_fH2SHHU2U@SMW015318> (raw)
In-Reply-To: <20260618-b4-regulator-opt-v1-1-c43b1f62aaf6@oss.nxp.com>

On Thu, Jun 18, 2026 at 10:03:05AM +0800, joy.zou@oss.nxp.com wrote:
> From: Joy Zou <joy.zou@nxp.com>
>
> The PMIC PCA9451A and PCA9452 have a default power-off debounce time of
> 2ms according to their datasheet, while PCA9450A and PCA9450BC use 120us.
>
> Add default_t_off_deb field to struct pca9450 to support per-variant
> default configuration when the device tree property is not specified.
>
> Datasheet reference links:
> - PCA9451A Rev.2.1: https://www.nxp.com/docs/en/data-sheet/PCA9451A.pdf
> - PCA9452 Rev.1.0: https://www.nxp.com/docs/en/data-sheet/PCA9452.pdf
>
> Signed-off-by: Joy Zou <joy.zou@nxp.com>
> ---

If you have time, suggest change to use drvdata replace switch case.

Reviewed-by: Frank Li <Frank.Li@nxp.com>

> Changes in v2:
> 1. remove original switch case changes, and add default_t_off_deb field to
> struct pca9450 to support per-variant default configuration.
> 2. modify commit message.
> ---
>  drivers/regulator/pca9450-regulator.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/regulator/pca9450-regulator.c b/drivers/regulator/pca9450-regulator.c
> index 45d7dc44c2cd..c41db70fa052 100644
> --- a/drivers/regulator/pca9450-regulator.c
> +++ b/drivers/regulator/pca9450-regulator.c
> @@ -44,6 +44,7 @@ struct pca9450 {
>  	unsigned int rcnt;
>  	int irq;
>  	bool sd_vsel_fixed_low;
> +	int default_t_off_deb;
>  };
>
>  static const struct regmap_range pca9450_status_range = {
> @@ -1209,7 +1210,7 @@ static int pca9450_of_init(struct pca9450 *pca9450)
>
>  	ret = of_property_read_u32(i2c->dev.of_node, "nxp,pmic-on-req-off-debounce-us", &val);
>  	if (ret == -EINVAL)
> -		t_off_deb = T_OFF_DEB_120US;
> +		t_off_deb = pca9450->default_t_off_deb;
>  	else if (ret)
>  		return ret;
>  	else {
> @@ -1304,21 +1305,25 @@ static int pca9450_i2c_probe(struct i2c_client *i2c)
>  	case PCA9450_TYPE_PCA9450A:
>  		regulator_desc = pca9450a_regulators;
>  		pca9450->rcnt = ARRAY_SIZE(pca9450a_regulators);
> +		pca9450->default_t_off_deb = T_OFF_DEB_120US;
>  		type_name = "pca9450a";
>  		break;
>  	case PCA9450_TYPE_PCA9450BC:
>  		regulator_desc = pca9450bc_regulators;
>  		pca9450->rcnt = ARRAY_SIZE(pca9450bc_regulators);
> +		pca9450->default_t_off_deb = T_OFF_DEB_120US;
>  		type_name = "pca9450bc";
>  		break;
>  	case PCA9450_TYPE_PCA9451A:
>  		regulator_desc = pca9451a_regulators;
>  		pca9450->rcnt = ARRAY_SIZE(pca9451a_regulators);
> +		pca9450->default_t_off_deb = T_OFF_DEB_2MS;
>  		type_name = "pca9451a";
>  		break;
>  	case PCA9450_TYPE_PCA9452:
>  		regulator_desc = pca9451a_regulators;
>  		pca9450->rcnt = ARRAY_SIZE(pca9451a_regulators);
> +		pca9450->default_t_off_deb = T_OFF_DEB_2MS;
>  		type_name = "pca9452";
>  		break;
>  	default:
>
> --
> 2.34.1
>
>

  reply	other threads:[~2026-06-18  3:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-18  2:03 [PATCH 0/2] regulator code improvements joy.zou
2026-06-18  2:03 ` [PATCH 1/2] regulator: pca9450: Correct default t_off_deb for PCA9451A/PCA9452 joy.zou
2026-06-18  3:07   ` Frank Li [this message]
2026-06-18  2:03 ` [PATCH 2/2] regulator: pf0900: Modify volatile register range definition joy.zou
2026-06-18  2:06   ` sashiko-bot
2026-06-18  6:54   ` Francesco Dolcini

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=ajNhBw_fH2SHHU2U@SMW015318 \
    --to=frank.li@oss.nxp.com \
    --cc=Frank.Li@nxp.com \
    --cc=broonie@kernel.org \
    --cc=imx@lists.linux.dev \
    --cc=joy.zou@nxp.com \
    --cc=joy.zou@oss.nxp.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peng.fan@nxp.com \
    --cc=ping.bai@nxp.com \
    --cc=ye.li@nxp.com \
    /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