Skip to content

Commit cca8824

Browse files
nunojsabroonie
authored andcommitted
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>
1 parent 5337ff4 commit cca8824

4 files changed

Lines changed: 11 additions & 0 deletions

File tree

sound/soc/codecs/adau1372-i2c.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ MODULE_DEVICE_TABLE(i2c, adau1372_i2c_ids);
2929
static struct i2c_driver adau1372_i2c_driver = {
3030
.driver = {
3131
.name = "adau1372",
32+
.of_match_table = adau1372_of_match,
3233
},
3334
.probe = adau1372_i2c_probe,
3435
.id_table = adau1372_i2c_ids,

sound/soc/codecs/adau1372-spi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ MODULE_DEVICE_TABLE(spi, adau1372_spi_id);
4747
static struct spi_driver adau1372_spi_driver = {
4848
.driver = {
4949
.name = "adau1372",
50+
.of_match_table = adau1372_of_match,
5051
},
5152
.probe = adau1372_spi_probe,
5253
.id_table = adau1372_spi_id,

sound/soc/codecs/adau1372.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <linux/gpio/consumer.h>
1212
#include <linux/init.h>
1313
#include <linux/module.h>
14+
#include <linux/mod_devicetable.h>
1415
#include <linux/pm.h>
1516
#include <linux/slab.h>
1617

@@ -1060,6 +1061,13 @@ const struct regmap_config adau1372_regmap_config = {
10601061
};
10611062
EXPORT_SYMBOL_GPL(adau1372_regmap_config);
10621063

1064+
const struct of_device_id adau1372_of_match[] = {
1065+
{ .compatible = "adi,adau1372" },
1066+
{ }
1067+
};
1068+
EXPORT_SYMBOL_GPL(adau1372_of_match);
1069+
MODULE_DEVICE_TABLE(of, adau1372_of_match);
1070+
10631071
MODULE_DESCRIPTION("ASoC ADAU1372 CODEC driver");
10641072
MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
10651073
MODULE_LICENSE("GPL v2");

sound/soc/codecs/adau1372.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
struct device;
1515

16+
extern const struct of_device_id adau1372_of_match[];
1617
int adau1372_probe(struct device *dev, struct regmap *regmap,
1718
void (*switch_mode)(struct device *dev));
1819

0 commit comments

Comments
 (0)