linux-stable/sound
Thomas Petazzoni e51df4f81b
ASoC: cs42l51: fix driver to properly autoload with automatic module loading
In commit 2cb1e0259f ("ASoC: cs42l51: re-hook of_match_table
pointer"), 9 years ago, some random guy fixed the cs42l51 after it was
split into a core part and an I2C part to properly match based on a
Device Tree compatible string.

However, the fix in this commit is wrong: the MODULE_DEVICE_TABLE(of,
....) is in the core part of the driver, not the I2C part. Therefore,
automatic module loading based on module.alias, based on matching with
the DT compatible string, loads the core part of the driver, but not
the I2C part. And threfore, the i2c_driver is not registered, and the
codec is not known to the system, nor matched with a DT node with the
corresponding compatible string.

In order to fix that, we move the MODULE_DEVICE_TABLE(of, ...) into
the I2C part of the driver. The cs42l51_of_match[] array is also moved
as well, as it is not possible to have this definition in one file,
and the MODULE_DEVICE_TABLE(of, ...) invocation in another file, due
to how MODULE_DEVICE_TABLE works.

Thanks to this commit, the I2C part of the driver now properly
autoloads, and thanks to its dependency on the core part, the core
part gets autoloaded as well, resulting in a functional sound card
without having to manually load kernel modules.

Fixes: 2cb1e0259f ("ASoC: cs42l51: re-hook of_match_table pointer")
Cc: stable@vger.kernel.org
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Link: https://lore.kernel.org/r/20230713112112.778576-1-thomas.petazzoni@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-17 06:15:09 +01:00
..
ac97
aoa ALSA: Switch i2c drivers back to use .probe() 2023-06-05 09:22:45 +02:00
arm ARM: pxa: fix missing-prototypes warnings 2023-05-26 13:33:05 +02:00
atmel
core ALSA: jack: Fix mutex call in snd_jack_report() 2023-07-06 18:01:59 +02:00
drivers ALSA: Implement the new Virtual PCM Test Driver 2023-06-07 13:08:53 +02:00
firewire ALSA: fireface: make read-only const array for model names static 2023-06-28 11:42:55 +02:00
hda ALSA: hda: fix a possible null-pointer dereference due to data race in snd_hdac_regmap_sync() 2023-07-03 10:08:12 +02:00
i2c ALSA: i2c/cs8427: fix iec958 mixer control deactivation 2023-04-06 08:09:36 +02:00
isa Merge branch 'for-next' into for-linus 2023-06-26 15:23:23 +02:00
mips ALSA: mips/sgio2audio: Convert to platform remove callback returning void 2023-03-20 13:07:05 +00:00
oss
parisc
pci ALSA: hda/realtek: Add quirk for ASUS ROG GZ301V 2023-07-07 08:07:49 +02:00
pcmcia ALSA: add HAS_IOPORT dependencies 2023-05-22 16:43:47 +02:00
ppc ALSA: Switch i2c drivers back to use .probe() 2023-06-05 09:22:45 +02:00
sh ALSA: sh_dac_audio: Convert to platform remove callback returning void 2023-03-20 13:07:08 +00:00
soc ASoC: cs42l51: fix driver to properly autoload with automatic module loading 2023-07-17 06:15:09 +01:00
sparc ALSA: sparc/dbri: Convert to platform remove callback returning void 2023-03-20 13:09:37 +00:00
spi
synth ALSA: emu10k1: fix synthesizer pitch for E-MU cards at 44.1 kHz 2023-06-13 07:42:08 +02:00
usb Merge branch 'for-next' into for-linus 2023-06-26 15:23:23 +02:00
virtio
x86
xen
ac97_bus.c
Kconfig
last.c
Makefile
sound_core.c sound: make all 'class' structures const 2023-06-21 07:29:10 +02:00