Skip to content

Commit

Permalink
ASoC: codecs: adau1372: add match table
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nuno Sa authored and Mark Brown committed Oct 22, 2024
1 parent 5337ff4 commit cca8824
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions sound/soc/codecs/adau1372-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ MODULE_DEVICE_TABLE(i2c, adau1372_i2c_ids);
static struct i2c_driver adau1372_i2c_driver = {
.driver = {
.name = "adau1372",
.of_match_table = adau1372_of_match,
},
.probe = adau1372_i2c_probe,
.id_table = adau1372_i2c_ids,
Expand Down
1 change: 1 addition & 0 deletions sound/soc/codecs/adau1372-spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ MODULE_DEVICE_TABLE(spi, adau1372_spi_id);
static struct spi_driver adau1372_spi_driver = {
.driver = {
.name = "adau1372",
.of_match_table = adau1372_of_match,
},
.probe = adau1372_spi_probe,
.id_table = adau1372_spi_id,
Expand Down
8 changes: 8 additions & 0 deletions sound/soc/codecs/adau1372.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <linux/gpio/consumer.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/pm.h>
#include <linux/slab.h>

Expand Down Expand Up @@ -1060,6 +1061,13 @@ const struct regmap_config adau1372_regmap_config = {
};
EXPORT_SYMBOL_GPL(adau1372_regmap_config);

const struct of_device_id adau1372_of_match[] = {
{ .compatible = "adi,adau1372" },
{ }
};
EXPORT_SYMBOL_GPL(adau1372_of_match);
MODULE_DEVICE_TABLE(of, adau1372_of_match);

MODULE_DESCRIPTION("ASoC ADAU1372 CODEC driver");
MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
MODULE_LICENSE("GPL v2");
1 change: 1 addition & 0 deletions sound/soc/codecs/adau1372.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

struct device;

extern const struct of_device_id adau1372_of_match[];
int adau1372_probe(struct device *dev, struct regmap *regmap,
void (*switch_mode)(struct device *dev));

Expand Down

0 comments on commit cca8824

Please sign in to comment.