Re: [PATCH v4 02/11] mfd: Add support for Kontron sl28cpld management controller

From: Lee Jones
Date: Tue Jun 09 2020 - 14:41:54 EST


On Tue, 09 Jun 2020, Rob Herring wrote:

> On Tue, Jun 09, 2020 at 05:01:17PM +0200, Michael Walle wrote:
> > Am 2020-06-09 16:42, schrieb Mark Brown:
> > > On Tue, Jun 09, 2020 at 04:38:31PM +0200, Michael Walle wrote:
> > >
> > > > mfd-device@10 {
> > > > compatible = "simple-regmap", "simple-mfd";
> > > > reg = <10>;
> > > > regmap,reg-bits = <8>;
> > > > regmap,val-bits = <8>;
> > > > sub-device@0 {
> > > > compatible = "vendor,sub-device0";
> > > > reg = <0>;
> > > > };
> > >
> > > A DT binding like this is not a good idea, encoding the details of the
> > > register map into the DT binding makes it an ABI which is begging for
> > > trouble. I'd also suggest that any device using a generic driver like
> > > this should have a specific compatible string for the device so we can
> > > go back and add quirks later if we need them.
> >
> > Like in the spidev case, yes. But OTOH if I _just_ encode the parameters
> > for the regmap a MFD, Lee don't agree because its just a shim. So either
> > way I seem to be stuck here.
> >
> > Where should I put the code to create an i2c driver, init a regmap and
> > populate its childen?
>
> Find another driver doing this already and rename it 'simple-mfd' (no
> relation to the DT binding) and add your compatible string to it.
> 'Generic' or 'simple' drivers don't require generic/simple DT bindings.

Creating a generic driver is one of the options spinning around in my
head. If nothing better comes of these discussions, I'll turn my hand
to it soon.

> Or extend the existing syscon driver to look up the bus_type and create
> the regmap based on the bus type?

--
Lee Jones [æçæ]
Senior Technical Lead - Developer Services
Linaro.org â Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog