From: Lee Jones <lee@kernel.org>
To: James Ogletree <James.Ogletree@cirrus.com>
Cc: James Ogletree <jogletre@opensource.cirrus.com>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>,
Mark Brown <broonie@kernel.org>, Jeff LaBundy <jeff@labundy.com>,
"open list:CIRRUS LOGIC HAPTIC DRIVERS"
<patches@opensource.cirrus.com>,
"linux-sound@vger.kernel.org" <linux-sound@vger.kernel.org>,
"linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: Re: [PATCH v8 3/5] mfd: cs40l50: Add support for CS40L50 core driver
Date: Tue, 5 Mar 2024 09:58:18 +0000 [thread overview]
Message-ID: <20240305095818.GF5206@google.com> (raw)
In-Reply-To: <6DD14CBC-FAE2-4768-AD77-347229FE9AC7@cirrus.com>
On Fri, 01 Mar 2024, James Ogletree wrote:
> Hi Lee,
>
> Thanks for the review.
>
> > On Mar 1, 2024, at 3:17 AM, Lee Jones <lee@kernel.org> wrote:
> >
> > On Wed, 21 Feb 2024, James Ogletree wrote:
> >
> >> Introduce support for Cirrus Logic Device CS40L50: a
> >> haptic driver with waveform memory, integrated DSP,
> >> and closed-loop algorithms.
> >>
> >> The MFD component registers and initializes the device.
> >>
> >> Signed-off-by: James Ogletree <jogletre@opensource.cirrus.com>
> >> ---
> >> MAINTAINERS | 2 +
> >> drivers/mfd/Kconfig | 30 ++
> >> drivers/mfd/Makefile | 4 +
> >> drivers/mfd/cs40l50-core.c | 531 ++++++++++++++++++++++++++++++++++++
> >> drivers/mfd/cs40l50-i2c.c | 69 +++++
> >> drivers/mfd/cs40l50-spi.c | 69 +++++
> >> include/linux/mfd/cs40l50.h | 142 ++++++++++
> >> 7 files changed, 847 insertions(+)
> >> create mode 100644 drivers/mfd/cs40l50-core.c
> >> create mode 100644 drivers/mfd/cs40l50-i2c.c
> >> create mode 100644 drivers/mfd/cs40l50-spi.c
> >> create mode 100644 include/linux/mfd/cs40l50.h
> >
> > Mostly fine, just a few nits.
> >
> > Assumingly this needs to go in via one tree (usually MFD).
> >
> > I can't do so until the other maintainers have provided Acks.
> >
>
> Yes, understood.
>
> >> +static const struct cs_dsp_region cs40l50_dsp_regions[] = {
> >> + { .type = WMFW_HALO_PM_PACKED, .base = CS40L50_PMEM_0 },
> >> + { .type = WMFW_HALO_XM_PACKED, .base = CS40L50_XMEM_PACKED_0 },
> >> + { .type = WMFW_HALO_YM_PACKED, .base = CS40L50_YMEM_PACKED_0 },
> >> + { .type = WMFW_ADSP2_XM, .base = CS40L50_XMEM_UNPACKED24_0 },
> >> + { .type = WMFW_ADSP2_YM, .base = CS40L50_YMEM_UNPACKED24_0 },
> >> +};
> >> +
> >> +static void cs40l50_dsp_remove(void *data)
> >> +{
> >> + cs_dsp_remove((struct cs_dsp *)data);
> >
> > Is the cast required?
> >
> > Where is this function?
>
> Seems that the cast is redundant, so I will remove.
>
> The function cs_dsp_remove() is exported from linux/firmware/cirrus/cs_dsp.h.
>
> >
> >> +}
> >> +
> >> +static const struct cs_dsp_client_ops cs40l50_client_ops;
> >
> > What's this for? Where is it used?
> >
> > In general, I'm not a fan of empty struct definitions like this.
>
> From the same cs_dsp module as mentioned above, it is a structure containing
> callbacks that gives the client driver an opportunity to respond to certain events
> during the DSP's lifecycle. It just so happens that this driver does not need to do
> anything. However, no struct definition will result in a null pointer dereference by
> cs_dsp when it checks for the callbacks.
Then check for NULL before dereferencing it?
--
Lee Jones [李琼斯]
next prev parent reply other threads:[~2024-03-05 9:58 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-21 0:36 [PATCH v8 0/5] Add support for CS40L50 James Ogletree
2024-02-21 0:36 ` [PATCH v8 1/5] firmware: cs_dsp: Add write sequencer interface James Ogletree
2024-02-21 9:22 ` Charles Keepax
2024-02-21 0:36 ` [PATCH v8 2/5] dt-bindings: input: cirrus,cs40l50: Add initial DT binding James Ogletree
2024-02-21 0:36 ` [PATCH v8 3/5] mfd: cs40l50: Add support for CS40L50 core driver James Ogletree
2024-03-01 9:17 ` Lee Jones
2024-03-01 16:36 ` James Ogletree
2024-03-05 9:58 ` Lee Jones [this message]
2024-03-05 10:20 ` Charles Keepax
2024-03-05 20:55 ` James Ogletree
2024-02-21 0:36 ` [PATCH v8 4/5] Input: cs40l50 - Add support for the CS40L50 haptic driver James Ogletree
2024-02-21 0:36 ` [PATCH v8 5/5] ASoC: cs40l50: Support I2S streaming to CS40L50 James Ogletree
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=20240305095818.GF5206@google.com \
--to=lee@kernel.org \
--cc=James.Ogletree@cirrus.com \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=jeff@labundy.com \
--cc=jogletre@opensource.cirrus.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
--cc=robh+dt@kernel.org \
/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).