1 // SPDX-License-Identifier: GPL-2.0-only
3 * Driver for ADAU1361/ADAU1461/ADAU1761/ADAU1961 codec
5 * Copyright 2014 Analog Devices Inc.
6 * Author: Lars-Peter Clausen <lars@metafoo.de>
10 #include <linux/mod_devicetable.h>
11 #include <linux/module.h>
12 #include <linux/regmap.h>
13 #include <sound/soc.h>
17 static int adau1761_i2c_probe(struct i2c_client
*client
,
18 const struct i2c_device_id
*id
)
20 struct regmap_config config
;
22 config
= adau1761_regmap_config
;
26 return adau1761_probe(&client
->dev
,
27 devm_regmap_init_i2c(client
, &config
),
28 id
->driver_data
, NULL
);
31 static int adau1761_i2c_remove(struct i2c_client
*client
)
33 adau17x1_remove(&client
->dev
);
37 static const struct i2c_device_id adau1761_i2c_ids
[] = {
38 { "adau1361", ADAU1361
},
39 { "adau1461", ADAU1761
},
40 { "adau1761", ADAU1761
},
41 { "adau1961", ADAU1361
},
44 MODULE_DEVICE_TABLE(i2c
, adau1761_i2c_ids
);
46 #if defined(CONFIG_OF)
47 static const struct of_device_id adau1761_i2c_dt_ids
[] = {
48 { .compatible
= "adi,adau1361", },
49 { .compatible
= "adi,adau1461", },
50 { .compatible
= "adi,adau1761", },
51 { .compatible
= "adi,adau1961", },
54 MODULE_DEVICE_TABLE(of
, adau1761_i2c_dt_ids
);
57 static struct i2c_driver adau1761_i2c_driver
= {
60 .of_match_table
= of_match_ptr(adau1761_i2c_dt_ids
),
62 .probe
= adau1761_i2c_probe
,
63 .remove
= adau1761_i2c_remove
,
64 .id_table
= adau1761_i2c_ids
,
66 module_i2c_driver(adau1761_i2c_driver
);
68 MODULE_DESCRIPTION("ASoC ADAU1361/ADAU1461/ADAU1761/ADAU1961 CODEC I2C driver");
69 MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
70 MODULE_LICENSE("GPL");