[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <idqtxdptxq6s57r452staq3xv6zzs3i5bbapzxdlu3o7cdahaq@j257j4okrw52>
Date: Thu, 10 Jul 2025 14:54:38 +0000
From: Sean Nyekjaer <sean@...nix.com>
To: samuel.kayode@...oirfairelinux.com
Cc: Lee Jones <lee@...nel.org>, Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>, Liam Girdwood <lgirdwood@...il.com>, Mark Brown <broonie@...nel.org>, Dmitry Torokhov <dmitry.torokhov@...il.com>, Sebastian Reichel <sre@...nel.org>, Frank Li <Frank.li@....com>, imx@...ts.linux.dev, devicetree@...r.kernel.org, linux-kernel@...r.kernel.org, linux-input@...r.kernel.org, linux-pm@...r.kernel.org, Abel Vesa <abelvesa@...nel.org>, Abel Vesa <abelvesa@...ux.com>, Robin Gong <b38343@...escale.com>, Robin Gong <yibin.gong@....com>, Enric Balletbo i Serra <eballetbo@...il.com>
Subject: Re: [PATCH v8 2/6] mfd: pf1550: add core driver
Hi Samuel,
On Mon, Jul 07, 2025 at 05:37:21PM +0100, Samuel Kayode via B4 Relay wrote:
> From: Samuel Kayode <samuel.kayode@...oirfairelinux.com>
>
> Add the core driver for pf1550 PMIC. There are 3 subdevices for which the
> drivers will be added in subsequent patches.
>
> Reviewed-by: Frank Li <Frank.Li@....com>
> Signed-off-by: Samuel Kayode <samuel.kayode@...oirfairelinux.com>
> ---
[...]
> +
> +static int pf1550_i2c_probe(struct i2c_client *i2c)
> +{
> + const struct mfd_cell *regulator = &pf1550_regulator_cell;
> + const struct mfd_cell *charger = &pf1550_charger_cell;
> + const struct mfd_cell *onkey = &pf1550_onkey_cell;
> + unsigned int reg_data = 0, otp_data = 0;
> + struct pf1550_ddata *pf1550;
> + struct irq_domain *domain;
> + int irq, ret = 0;
> +
> + pf1550 = devm_kzalloc(&i2c->dev, sizeof(*pf1550), GFP_KERNEL);
> + if (!pf1550)
> + return -ENOMEM;
> +
> + i2c_set_clientdata(i2c, pf1550);
> + pf1550->dev = &i2c->dev;
> + pf1550->irq = i2c->irq;
> +
> + pf1550->regmap = devm_regmap_init_i2c(i2c, &pf1550_regmap_config);
> + if (IS_ERR(pf1550->regmap))
> + return dev_err_probe(pf1550->dev, PTR_ERR(pf1550->regmap),
> + "failed to allocate register map\n");
> +
> + ret = regmap_read(pf1550->regmap, PF1550_PMIC_REG_DEVICE_ID, ®_data);
> + if (ret < 0)
> + return dev_err_probe(pf1550->dev, ret, "cannot read chip ID\n");
> + if (reg_data != PF1550_DEVICE_ID)
> + return dev_err_probe(pf1550->dev, -ENODEV,
> + "invalid device ID: 0x%02x\n", reg_data);
> +
> + /* Regulator DVS */
> + ret = pf1550_read_otp(pf1550, PF1550_OTP_SW2_SW3, &otp_data);
> + if (ret)
> + return ret;
> +
> + /* When clear, DVS should be enabled */
> + if (!(otp_data & OTP_DVS_ENB))
> + pf1550->dvs_enb = true;
> +
Thanks for upstreaming this :)
We need to handle DVS for SW1 here.
I'm using the A6 variant that have DVS enabled for SW1 and disabled for
SW2.
The A1 variant have DVS for SW1 disabled...
/Sean
Powered by blists - more mailing lists