From: Oder Chiou <oder_chiou@realtek.com>
To: "'Cezary Rojewski'" <cezary.rojewski@intel.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
"Flove(HsinFu)" <flove@realtek.com>,
"Shuming [范書銘]" <shumingf@realtek.com>,
"Jack Yu" <jack.yu@realtek.com>,
"Derek [方德義]" <derek.fang@realtek.com>,
"broonie@kernel.org" <broonie@kernel.org>,
"lgirdwood@gmail.com" <lgirdwood@gmail.com>
Subject: RE: [PATCH v6 1/2] ASoC: rt5575: Add the codec driver for the ALC5575
Date: Fri, 7 Nov 2025 08:50:46 +0000 [thread overview]
Message-ID: <d8f14cabf8c744e3be9a01706a585fa3@realtek.com> (raw)
In-Reply-To: <550e7259-c371-431d-b515-c1e49b0ddd42@intel.com>
> -----Original Message-----
> From: Cezary Rojewski <cezary.rojewski@intel.com>
> Sent: Thursday, November 6, 2025 5:58 PM
> To: Oder Chiou <oder_chiou@realtek.com>
> Cc: alsa-devel@alsa-project.org; Flove(HsinFu) <flove@realtek.com>; Shuming
> [范書銘] <shumingf@realtek.com>; Jack Yu <jack.yu@realtek.com>; Derek [方
> 德義] <derek.fang@realtek.com>; broonie@kernel.org; lgirdwood@gmail.com
> Subject: Re: [PATCH v6 1/2] ASoC: rt5575: Add the codec driver for the
> ALC5575
>
> The patch looks much nicer. Thank you for the update, Oder. Let's move
> to round 2.
Thanks very much for the suggestions.
> > +};
> > +
> > +struct rt5575_spi_burst_write {
>
> Naming is weird - it's not a 'BURST_WRITE' command until the 'cmd' field
> says so. I'd rather have this named 'struct rt5575_spi_cmd' as its
> description and usage suggests.
The structure is only for the 'BURST_WRITE' command, and other commands are
different structure.
> > +
> > + offset += RT5575_SPI_BUF_LEN;
> > + }
> > +
> > + return 0;
> > +}
> > +EXPORT_SYMBOL_GPL(rt5575_spi_burst_write);
> > +
> > +static int rt5575_spi_probe(struct spi_device *spi)
> > +{
> > + rt5575_spi = spi;
> > +
> > + rt5575_spi_ready = true;
>
> This looks weird. If rt5575_spi_ready is 'true' unconditionally on
> probe(), why not just replace it with '!rt5575_spi' checks or
> IS_ERR_OR_NULL(rt5575_spi)?
If the kernel failed to allocate memory for the structure or couldn't
successfully match the device, the probe function would not be called.
> > +#if IS_ENABLED(CONFIG_SND_SOC_RT5575_SPI)
> > +static void rt5575_spi_fw_loaded(const struct firmware *fw, void *context)
>
> This has still not been addressed since my previous review. I do not
> understand the logic here. We have a 'common' file yet filled plagued by
> SPI specifics. On one hand we have rt5575_spi_burst_write() exported and
> part of SPI-specific entity, on the other we have rt5575_spi_fw_loaded()
> hidden here.
>
> Design if off, choose one or the other. In general, prefer the common
> code to be actually _common_. Makes it easier to Realtek and non-Realtek
> to maintain the code going forward. Leave specifics within the
> specifics-files.
The function name will be changed as rt5575_fw_load_by_spi.
prev parent reply other threads:[~2025-11-07 8:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-31 7:32 [PATCH v6 1/2] ASoC: rt5575: Add the codec driver for the ALC5575 Oder Chiou
2025-10-31 7:32 ` [PATCH v6 2/2] ASoC: dt-bindings: realtek,rt5575: add bindings for ALC5575 Oder Chiou
2025-10-31 7:53 ` Krzysztof Kozlowski
2025-10-31 7:54 ` Krzysztof Kozlowski
2025-11-06 9:57 ` [PATCH v6 1/2] ASoC: rt5575: Add the codec driver for the ALC5575 Cezary Rojewski
2025-11-07 8:50 ` Oder Chiou [this message]
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=d8f14cabf8c744e3be9a01706a585fa3@realtek.com \
--to=oder_chiou@realtek.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=cezary.rojewski@intel.com \
--cc=derek.fang@realtek.com \
--cc=flove@realtek.com \
--cc=jack.yu@realtek.com \
--cc=lgirdwood@gmail.com \
--cc=shumingf@realtek.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).