[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1ae385ba6000fc5e90adadc6dcdc2fa8b19d5783.camel@gmail.com>
Date: Thu, 30 Oct 2025 14:54:19 +0100
From: Alexander Sverdlin <alexander.sverdlin@...il.com>
To: Herve Codina <herve.codina@...tlin.com>, Mark Brown <broonie@...nel.org>
Cc: David Rhodes <david.rhodes@...rus.com>, Richard Fitzgerald	
 <rf@...nsource.cirrus.com>, Liam Girdwood <lgirdwood@...il.com>, Rob
 Herring	 <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor
 Dooley	 <conor+dt@...nel.org>, Jaroslav Kysela <perex@...ex.cz>, Takashi
 Iwai	 <tiwai@...e.com>, Nikita Shubin <nikita.shubin@...uefel.me>, Axel Lin
	 <axel.lin@...ics.com>, Brian Austin <brian.austin@...rus.com>, 
	linux-sound@...r.kernel.org, patches@...nsource.cirrus.com, 
	devicetree@...r.kernel.org, linux-kernel@...r.kernel.org, Thomas Petazzoni	
 <thomas.petazzoni@...tlin.com>, stable@...r.kernel.org
Subject: Re: [PATCH v2 1/4] ASoC: cs4271: Fix cs4271 I2C and SPI drivers
 automatic module loading
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.
Powered by blists - more mailing lists
 
