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

From: Lee Jones
Date: Thu Mar 07 2024 - 03:16:57 EST


> > > +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?

I am.

--
Lee Jones [李琼斯]