From: Jeff LaBundy <jeff@labundy.com>
To: Fred Treven <Fred.Treven@cirrus.com>
Cc: Ben Bright <Ben.Bright@cirrus.com>,
James Ogletree <James.Ogletree@cirrus.com>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Simon Trimmer <simont@opensource.cirrus.com>,
Charles Keepax <ckeepax@opensource.cirrus.com>,
Richard Fitzgerald <rf@opensource.cirrus.com>,
"patches@opensource.cirrus.com" <patches@opensource.cirrus.com>,
"linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"lee@kernel.org" <lee@kernel.org>
Subject: Re: [PATCH RFC 5/5] mfd: cs40l26: Add CODEC driver component
Date: Fri, 26 May 2023 16:55:18 -0500 [thread overview]
Message-ID: <ZHEqxraGB2hZgh1b@nixie71> (raw)
In-Reply-To: <F6FA6CFA-BFC5-47DA-83D1-6330E66195F5@cirrus.com>
Hi Fred,
On Fri, May 26, 2023 at 09:23:53PM +0000, Fred Treven wrote:
>
> Hi Jeff,
>
> > On May 26, 2023, at 2:43 PM, Jeff LaBundy <jeff@labundy.com> wrote:
> >
> > Hi Fred,
> >
> > On Thu, May 25, 2023 at 07:04:31PM -0500, Fred Treven wrote:
> >> Use MFD interface to load the CODEC driver along
> >> with the Input FF driver.
> >>
> >> Signed-off-by: Fred Treven <fred.treven@cirrus.com>
> >> ---
> >
> > Did you mean to include a thin codec driver as part of this series to
> > support the audio-to-haptics use-case? I don't see one.
>
> That is the end-goal, but I wanted to submit a request for comment with just this patch to see if it was at all acceptable to add another device this way. I see now that it is not.
>
> >
> > As Lee correctly points out, this isn't an MFD despite the title of the
> > commit message, and is sort of an abuse of the API.
>
> Understood. Do you think it’s best to migrate the appropriate code to the MFD subsystem before submitting this initial patchset (which will include the codec driver) or would it be acceptable to make that change after this has gone in? My hope was to avoid having code being reviewed more than once if a significant portion is moved to MFD.
>
> > What you seem to actually want is a true MFD driver responsible for
> > initializing common resources such as regmap, an IRQ chip, etc. That
> > driver then adds input and codec drivers as children.
> >
> > At the moment, you're more or less treating the input driver as the
> > MFD with one child, but that is not the correct pattern.
>
> Yeah that makes sense. Please advise on what the best way to continue would be: a. Drop this patch and migrate to MFD after the Input driver has been accepted or b. Move necessary code to MFD and add both Input and codec drivers from there along with the codec driver.
If your goal is to support audio-to-haptics in mainline and to do so using an
ASoC driver, then I recommend option B. You should start with a scalable and
maintainable solution that reflects your long-term goals.
Option A is sunk cost. I also expect that you will identify additional changes
required to the input driver, particularly with respect to interrupt handling,
beyond moving initialization-related code to the MFD. It's a major re-write in
my opinion.
It would be interesting to see if an existing Cirrus ASoC driver can be gently
reworked to act as the child codec, vs. having to write an entirely new one for
L26. I'm sure the devil is in the details though.
>
> Thank you,
> Fred
>
>
Kind regards,
Jeff LaBundy
next prev parent reply other threads:[~2023-05-26 21:58 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-26 0:04 [PATCH v2 1/5] dt-bindings: input: cirrus,cs40l26: Support for CS40L26 Fred Treven
2023-05-26 0:04 ` [PATCH v2 2/5] Input: cs40l26 - Support for CS40L26 Haptic Device Fred Treven
2023-05-26 0:04 ` [PATCH 3/5] firmware: cs_dsp: Add ability to loa multiple coefficient files Fred Treven
2023-05-26 0:04 ` [PATCH 4/5] Input: cs40l26 - Load " Fred Treven
2023-05-26 19:37 ` Jeff LaBundy
2023-05-26 0:04 ` [PATCH RFC 5/5] mfd: cs40l26: Add CODEC driver component Fred Treven
2023-05-26 7:54 ` Lee Jones
2023-05-26 19:43 ` Jeff LaBundy
2023-05-26 21:23 ` Fred Treven
2023-05-26 21:55 ` Jeff LaBundy [this message]
2023-05-26 19:27 ` [PATCH v2 1/5] dt-bindings: input: cirrus,cs40l26: Support for CS40L26 Conor Dooley
2023-05-26 21:32 ` Fred Treven
2023-05-26 22:03 ` Conor Dooley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZHEqxraGB2hZgh1b@nixie71 \
--to=jeff@labundy.com \
--cc=Ben.Bright@cirrus.com \
--cc=Fred.Treven@cirrus.com \
--cc=James.Ogletree@cirrus.com \
--cc=ckeepax@opensource.cirrus.com \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=lee@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
--cc=rf@opensource.cirrus.com \
--cc=robh+dt@kernel.org \
--cc=simont@opensource.cirrus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).