Re: [PATCH v8 2/6] mfd: pf1550: add core driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Samuel,

On Mon, Jul 07, 2025 at 05:37:21PM +0100, Samuel Kayode via B4 Relay wrote:
> From: Samuel Kayode <samuel.kayode@xxxxxxxxxxxxxxxxxxxx>
> 
> 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@xxxxxxx>
> Signed-off-by: Samuel Kayode <samuel.kayode@xxxxxxxxxxxxxxxxxxxx>
> ---

[...]

> +
> +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, &reg_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






[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux