Re: [PATCH v3 3/5] drivers: regulator: Add ADI MAX77541/MAX77540 Regulator Support

From: Mark Brown
Date: Tue Jan 31 2023 - 08:32:23 EST


On Tue, Jan 31, 2023 at 01:23:33PM +0000, Sahin, Okan wrote:
> Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:

> >> static const struct of_device_id max77541_regulator_of_id[] = {
> >> { .compatible = "adi,max77540-regulator", },
> >> { .compatible = "adi,max77541-regulator", },
> >> { /* sentinel */ }
> >> };
> >> MODULE_DEVICE_TABLE(of, max77541_regulator_of_id);

> >> What do you think?

> >If you have got all necessary data from the upper layer, why do you need to have
> >an ID table here? I'm not sure I understand how this OF ID table works in this
> >case.

> I added it since there is regulator node in device tree. With the help
> of devm_regulator_register(..), driver takes parameters of regulator
> node. I also used id to select and to initialize regulator descriptors
> which are chip specific. So far there is no comment about OF ID table
> so I kept it. I thought I need to add both of id table and platform id
> table as name matching is required to initialize platform device from
> mfd.

You probably shouldn't have compatibles for subdevices of a MFD unless
it's some reusable IP that'll appear elsewhere, especially for something
like the regulators where grouping them all into a single device is very
Linux specific.

Attachment: signature.asc
Description: PGP signature