xref: /openbmc/linux/sound/soc/codecs/src4xxx-i2c.c (revision b02a9a0c)
1 // SPDX-License-Identifier: GPL-2.0
2 //
3 // Driver for SRC4XXX codecs
4 //
5 // Copyright 2021-2022 Deqx Pty Ltd
6 // Author: Matt Flax <flatmax@flatmax.com>
7 
8 #include <linux/i2c.h>
9 #include <linux/mod_devicetable.h>
10 #include <linux/module.h>
11 #include <linux/regmap.h>
12 
13 #include "src4xxx.h"
14 
15 static int src4xxx_i2c_probe(struct i2c_client *i2c)
16 {
17 	return src4xxx_probe(&i2c->dev,
18 		devm_regmap_init_i2c(i2c, &src4xxx_regmap_config), NULL);
19 }
20 
21 static const struct i2c_device_id src4xxx_i2c_ids[] = {
22 	{ "src4392", 0 },
23 	{ }
24 };
25 MODULE_DEVICE_TABLE(i2c, src4xxx_i2c_ids);
26 
27 static const struct of_device_id src4xxx_of_match[] __maybe_unused = {
28 	{ .compatible = "ti,src4392", },
29 	{ }
30 };
31 MODULE_DEVICE_TABLE(of, src4xxx_of_match);
32 
33 
34 static struct i2c_driver src4xxx_i2c_driver = {
35 	.driver = {
36 		.name = "src4xxx",
37 		.of_match_table = of_match_ptr(src4xxx_of_match),
38 	},
39 	.probe_new = src4xxx_i2c_probe,
40 	.id_table = src4xxx_i2c_ids,
41 };
42 module_i2c_driver(src4xxx_i2c_driver);
43 
44 MODULE_DESCRIPTION("ASoC SRC4392 CODEC I2C driver");
45 MODULE_AUTHOR("Matt Flax <flatmax@flatmax.com>");
46 MODULE_LICENSE("GPL");
47