xref: /openbmc/linux/sound/soc/codecs/adau1372-i2c.c (revision 6cd4c645)
1*6cd4c645SLars-Peter Clausen // SPDX-License-Identifier: GPL-2.0-only
2*6cd4c645SLars-Peter Clausen /*
3*6cd4c645SLars-Peter Clausen  * Driver for ADAU1372 codec
4*6cd4c645SLars-Peter Clausen  *
5*6cd4c645SLars-Peter Clausen  * Copyright 2016 Analog Devices Inc.
6*6cd4c645SLars-Peter Clausen  *  Author: Lars-Peter Clausen <lars@metafoo.de>
7*6cd4c645SLars-Peter Clausen  */
8*6cd4c645SLars-Peter Clausen 
9*6cd4c645SLars-Peter Clausen #include <linux/i2c.h>
10*6cd4c645SLars-Peter Clausen #include <linux/mod_devicetable.h>
11*6cd4c645SLars-Peter Clausen #include <linux/module.h>
12*6cd4c645SLars-Peter Clausen #include <linux/regmap.h>
13*6cd4c645SLars-Peter Clausen #include <sound/soc.h>
14*6cd4c645SLars-Peter Clausen 
15*6cd4c645SLars-Peter Clausen #include "adau1372.h"
16*6cd4c645SLars-Peter Clausen 
17*6cd4c645SLars-Peter Clausen static int adau1372_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id)
18*6cd4c645SLars-Peter Clausen {
19*6cd4c645SLars-Peter Clausen 	return adau1372_probe(&client->dev,
20*6cd4c645SLars-Peter Clausen 		devm_regmap_init_i2c(client, &adau1372_regmap_config), NULL);
21*6cd4c645SLars-Peter Clausen }
22*6cd4c645SLars-Peter Clausen 
23*6cd4c645SLars-Peter Clausen static const struct i2c_device_id adau1372_i2c_ids[] = {
24*6cd4c645SLars-Peter Clausen 	{ "adau1372", 0 },
25*6cd4c645SLars-Peter Clausen 	{ }
26*6cd4c645SLars-Peter Clausen };
27*6cd4c645SLars-Peter Clausen MODULE_DEVICE_TABLE(i2c, adau1372_i2c_ids);
28*6cd4c645SLars-Peter Clausen 
29*6cd4c645SLars-Peter Clausen static struct i2c_driver adau1372_i2c_driver = {
30*6cd4c645SLars-Peter Clausen 	.driver = {
31*6cd4c645SLars-Peter Clausen 		.name = "adau1372",
32*6cd4c645SLars-Peter Clausen 	},
33*6cd4c645SLars-Peter Clausen 	.probe = adau1372_i2c_probe,
34*6cd4c645SLars-Peter Clausen 	.id_table = adau1372_i2c_ids,
35*6cd4c645SLars-Peter Clausen };
36*6cd4c645SLars-Peter Clausen module_i2c_driver(adau1372_i2c_driver);
37*6cd4c645SLars-Peter Clausen 
38*6cd4c645SLars-Peter Clausen MODULE_DESCRIPTION("ASoC ADAU1372 CODEC I2C driver");
39*6cd4c645SLars-Peter Clausen MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
40*6cd4c645SLars-Peter Clausen MODULE_LICENSE("GPL v2");
41