devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Sverdlin <alexander.sverdlin@gmail.com>
To: Herve Codina <herve.codina@bootlin.com>, Mark Brown <broonie@kernel.org>
Cc: David Rhodes <david.rhodes@cirrus.com>,
	Richard Fitzgerald	 <rf@opensource.cirrus.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Rob Herring	 <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley	 <conor+dt@kernel.org>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai	 <tiwai@suse.com>,
	Nikita Shubin <nikita.shubin@maquefel.me>,
	Axel Lin <axel.lin@ingics.com>,
	Brian Austin <brian.austin@cirrus.com>,
	 linux-sound@vger.kernel.org, patches@opensource.cirrus.com,
	 devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	Thomas Petazzoni	 <thomas.petazzoni@bootlin.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH v2 1/4] ASoC: cs4271: Fix cs4271 I2C and SPI drivers automatic module loading
Date: Thu, 30 Oct 2025 14:54:19 +0100	[thread overview]
Message-ID: <1ae385ba6000fc5e90adadc6dcdc2fa8b19d5783.camel@gmail.com> (raw)
In-Reply-To: <20251030144319.671368a2@bootlin.com>

Hi Herve,

On Thu, 2025-10-30 at 14:43 +0100, Herve Codina wrote:
> > > --- a/sound/soc/codecs/cs4271-spi.c
> > > +++ b/sound/soc/codecs/cs4271-spi.c
> > > @@ -23,11 +23,24 @@ static int cs4271_spi_probe(struct spi_device *spi)
> > >  	return cs4271_probe(&spi->dev, devm_regmap_init_spi(spi, &config));
> > >  }
> > >  
> > > +static const struct spi_device_id cs4271_id_spi[] = {
> > > +	{ "cs4271", 0 },
> > > +	{}
> > > +};
> > > +MODULE_DEVICE_TABLE(spi, cs4271_id_spi);
> > > +
> > > +static const struct of_device_id cs4271_dt_ids[] = {
> > > +	{ .compatible = "cirrus,cs4271", },
> > > +	{ }
> > > +};
> > > +MODULE_DEVICE_TABLE(of, cs4271_dt_ids);  
> > 
> > So currently SPI core doesn't generate "of:" prefixed uevents, therefore this
> > currently doesn't help? However, imagine, you'd have both backends enabled
> > as modules, -spi and -i2c. udev/modprobe currently load just one module it
> > finds first. What is the guarantee that the loaded module for the "of:"
> > prefixed I2C uevent would be the -i2c module?
> > 
> 
> I hesitate to fully remove cs4271_dt_ids in the SPI part.
> 
> I understood having it could lead to issues if both SPI and I2C parts
> are compiled as modules but this is the pattern used in quite a lot of
> drivers.
> 
> Maybe this could be handle globally out of this series instead of introducing
> a specific pattern in this series.
> 
> But well, if you and Mark are ok to fully remove the cs4271_dt_ids from the
> SPI part and so unset the of_match_table from the cs4271_spi_driver, I can
> do the modification.
> 
> Let me know if I should send a new iteration with cs4271_dt_ids fully removed
> from the SPI part.
> 
> Also, last point, I don't have any cs4271 connected to a SPI bus.
> I use only the I2C version and will not be able to check for correct
> modifications on the SPI part.

I'd propose to drop SPI modifications in this case, because by doing this
you actually introduce yet another problem for the I2C case you are interested
in (namely if you'd enable both modules).

-- 
Alexander Sverdlin.

  parent reply	other threads:[~2025-10-30 13:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-29  9:39 [PATCH v2 0/4] Add support for an external Master Clock in the Cirrus CS4271 codec Herve Codina
2025-10-29  9:39 ` [PATCH v2 1/4] ASoC: cs4271: Fix cs4271 I2C and SPI drivers automatic module loading Herve Codina
2025-10-29 11:20   ` Alexander Sverdlin
2025-10-30 13:43     ` Herve Codina
2025-10-30 13:52       ` Mark Brown
2025-10-30 13:54       ` Alexander Sverdlin [this message]
2025-10-30 14:01         ` Alexander Sverdlin
2025-10-29  9:39 ` [PATCH v2 2/4] ASoC: cs4271: Disable regulators in component_probe() error path Herve Codina
2025-10-29 11:14   ` Alexander Sverdlin
2025-10-29  9:39 ` [PATCH v2 3/4] ASoC: dt-bindings: cirrus,cs4271: Document mclk clock Herve Codina
2025-10-29  9:39 ` [PATCH v2 4/4] ASoC: cs4271: Add support for the external mclk Herve Codina
2025-10-29 11:24   ` Alexander Sverdlin
2025-10-30 16:50 ` (subset) [PATCH v2 0/4] Add support for an external Master Clock in the Cirrus CS4271 codec Mark Brown

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=1ae385ba6000fc5e90adadc6dcdc2fa8b19d5783.camel@gmail.com \
    --to=alexander.sverdlin@gmail.com \
    --cc=axel.lin@ingics.com \
    --cc=brian.austin@cirrus.com \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=david.rhodes@cirrus.com \
    --cc=devicetree@vger.kernel.org \
    --cc=herve.codina@bootlin.com \
    --cc=krzk+dt@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=nikita.shubin@maquefel.me \
    --cc=patches@opensource.cirrus.com \
    --cc=perex@perex.cz \
    --cc=rf@opensource.cirrus.com \
    --cc=robh@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=tiwai@suse.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).