Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: codecs: adau1372: add match table

Add an of_device_id table for both the I2C and SPI drivers.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20241021-adau1372-of-table-v1-1-6efbc7946957@analog.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Nuno Sa and committed by
Mark Brown
cca88248 5337ff41

+11
+1
sound/soc/codecs/adau1372-i2c.c
··· 29 29 static struct i2c_driver adau1372_i2c_driver = { 30 30 .driver = { 31 31 .name = "adau1372", 32 + .of_match_table = adau1372_of_match, 32 33 }, 33 34 .probe = adau1372_i2c_probe, 34 35 .id_table = adau1372_i2c_ids,
+1
sound/soc/codecs/adau1372-spi.c
··· 47 47 static struct spi_driver adau1372_spi_driver = { 48 48 .driver = { 49 49 .name = "adau1372", 50 + .of_match_table = adau1372_of_match, 50 51 }, 51 52 .probe = adau1372_spi_probe, 52 53 .id_table = adau1372_spi_id,
+8
sound/soc/codecs/adau1372.c
··· 11 11 #include <linux/gpio/consumer.h> 12 12 #include <linux/init.h> 13 13 #include <linux/module.h> 14 + #include <linux/mod_devicetable.h> 14 15 #include <linux/pm.h> 15 16 #include <linux/slab.h> 16 17 ··· 1060 1059 .cache_type = REGCACHE_MAPLE, 1061 1060 }; 1062 1061 EXPORT_SYMBOL_GPL(adau1372_regmap_config); 1062 + 1063 + const struct of_device_id adau1372_of_match[] = { 1064 + { .compatible = "adi,adau1372" }, 1065 + { } 1066 + }; 1067 + EXPORT_SYMBOL_GPL(adau1372_of_match); 1068 + MODULE_DEVICE_TABLE(of, adau1372_of_match); 1063 1069 1064 1070 MODULE_DESCRIPTION("ASoC ADAU1372 CODEC driver"); 1065 1071 MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
+1
sound/soc/codecs/adau1372.h
··· 13 13 14 14 struct device; 15 15 16 + extern const struct of_device_id adau1372_of_match[]; 16 17 int adau1372_probe(struct device *dev, struct regmap *regmap, 17 18 void (*switch_mode)(struct device *dev)); 18 19