Re: [RFC PATCH v3 2/5] mfd: add driver for Marvell 88PM886 PMIC

Karel Balej
2024-03-05T18:53:18Z

Lee Jones, 2024-03-05T11:44:18+00:00:
> > +static struct mfd_cell pm886_devs[] = {
> > + {
> > + .name = "88pm886-onkey",
> > + .num_resources = ARRAY_SIZE(pm886_onkey_resources),
> > + .resources = pm886_onkey_resources,
> > + },
> > + {
> > + .name = "88pm886-regulator",
> > + .id = PM886_REGULATOR_ID_LDO2,
>
> Why doesn't PLATFORM_DEVID_AUTO work for this device?

Because I am using the IDs in the regulator driver to determine which
regulator data to use/which regulator to register.

> > +static int pm886_initialize_subregmaps(struct pm886_chip *chip)
> > +{
> > + struct device *dev = &chip->client->dev;
> > + struct i2c_client *page;
> > + struct regmap *regmap;
> > + int err;
> > +
> > + /* regulators page */
> > + page = devm_i2c_new_dummy_device(dev, chip->client->adapter,
> > + chip->client->addr + PM886_PAGE_OFFSET_REGULATORS);
> > + if (IS_ERR(page)) {
> > + err = PTR_ERR(page);
> > + dev_err(dev, "Failed to initialize regulators client: %d\n", err);
> > + return err;
> > + }
> > + regmap = devm_regmap_init_i2c(page, &pm886_i2c_regmap);
> > + if (IS_ERR(regmap)) {
> > + err = PTR_ERR(regmap);
> > + dev_err(dev, "Failed to initialize regulators regmap: %d\n", err);
> > + return err;
> > + }
> > + chip->regmaps[PM886_REGMAP_REGULATORS] = regmap;
>
> Except for the regulator driver, where else is the regulators regmap used?

Nowhere, at least as of now. So you are saying that I should initialize
the regmap in the regulator driver?

Thank you,
K. B.