[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230403142822.GA8371@google.com>
Date: Mon, 3 Apr 2023 15:28:22 +0100
From: Lee Jones <lee@...nel.org>
To: Herve Codina <herve.codina@...tlin.com>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>, linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org, alsa-devel@...a-project.org,
Christophe Leroy <christophe.leroy@...roup.eu>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>
Subject: Re: [PATCH v5 2/5] mfd: Add support for the Lantiq PEF2256 framer
On Fri, 31 Mar 2023, Herve Codina wrote:
> On Fri, 31 Mar 2023 15:44:19 +0200
> Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org> wrote:
>
> > On 31/03/2023 14:11, Herve Codina wrote:
> > > Hi Krzysztof, Lee
> > >
> > > On Fri, 31 Mar 2023 11:13:30 +0200
> > > Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org> wrote:
> > >
> > >> On 31/03/2023 09:42, Herve Codina wrote:
> > >>> Hi Lee,
> > >>>
> > >>> On Thu, 30 Mar 2023 17:05:10 +0100
> > >>> Lee Jones <lee@...nel.org> wrote:
> > >>>
> > >>>> On Tue, 28 Mar 2023, Herve Codina wrote:
> > >>>>
> > >>>>> The Lantiq PEF2256 is a framer and line interface component designed to
> > >>>>> fulfill all required interfacing between an analog E1/T1/J1 line and the
> > >>>>> digital PCM system highway/H.100 bus.
> > >>>>
> > >>>> My goodness!
> > >>>>
> > >>>> It's been a long time since I've seen anything quite like this.
> > >>>
> > >>> Yes, old things but working on recent kernel.
> > >>>
> > >>>>
> > >>>> My suggestion to you:
> > >>>>
> > >>>> * Split this up into components that fit functional subsystems
> > >>>
> > >>> It is done. The audio part is present in ASoC subsystem (path 5 in this
> > >>> series). pinctrl function is implemented in this driver and, as I don't
> > >>> want to share registers, I would prefer to keep this function inside this
> > >>> driver.
> > >>
> > >> The amount of defines and huge functions like pef2256_setup_e1()
> > >> contradict it.
> > >>
> > >> Even the pef2256_setup_e1() really does not follow Linux coding style -
> > >> you know the size requirement, right?
> > >
> > > I know that pef2256_setup_e1() is quite big and I will look at a way
> > > to split it in a consistent way.
> > >
> > >>
> > >> pef2256_get_groups_count, struct pinmux_ops and others - this is
> > >> pinctrl, not MFD! They cannot be in MFD driver.
> > >
> > > Maybe the issue is that MFD was not a good choice.
> > > The "function" provided are not independent of each other.
> > > The "main" driver (pef2256.c) needs to do the setup and handle the interrupt.
> >
> > Just like all PMICs...
> >
> > > The "function" provided are some glues in order to be used in some sub-systems
> > > such as audio. Indeed, ASoC needs a codec DAI to be connected to a CPU DAI.
> >
> > Just like in all other cases...
> >
> > > These "functions" need to be started (ie probe()) after the pef2256 setup was
> > > done. So a start (probe()) order relationship is needed.
> >
> > Just like in all other cases, so I really do not see here anything special.
> >
> > >
> > > If a MFD driver needs independent children to handle independent functions,
> > > the pef2256 does not fit well as a MFD driver.
> >
> > Why? So far everything is exactly the same.
> >
> > >
> > > I switched from misc to MFD just to handle child DT nodes instead of having
> > > phandles. Using child DT nodes instead of phandles is really a good thing and
> > > need to be kept.
> >
> > Your DT bindings and nodes are not related to driver design. It does not
> > matter for Devicetree if you put it to misc or MFD.
> >
> > It does not matter for driver whether you call it in Devicetree foo or bar.
> >
> > > The switch to MFD was probably not the best thing to do.
> >
> > Maybe, but your existing arguments are not really related...
> >
> > >
> > > What do you think if I switched back the pef2256 "main" driver (pef2256.c) to
> > > misc ?
> >
> > Why? What would it solve? You want to stuff pinctrl driver to misc, to
> > avoid Lee's review? No. Pinctrl goes to pinctrl. Not to misc. Not to MFD.
>
> Just to be clear on that point, I do not want to avoid any reviews and Lee's
> reviews are fully welcome.
>
> I just misunderstood. I thought the issue was that the pef2256 MFD driver has an
> internal setup() and that the 'function' provided were not independent (they share
> the pef2256 API).
> My first feeling was that it was expected a kind of 'empty' driver for the pef2256
> MFD driver. The pef2256 driver cannot be empty. That's why I talk about misc.
It can be empty. That's what simple-mfd is for. :)
I suggest that none of this (besides the child registration, which is
achieved by a simple OF API call in this case) has anything to do with
MFD. We are not requesting and initialising shared resources and we are
not using the MFD API to register children. The pin control
functionality clearly needs moving to Pinctrl and the rest, if you
cannot find a suitable home for it *may be* suitable for Misc.
--
Lee Jones [李琼斯]
Powered by blists - more mailing lists