media: v4l: rcar_fdp1: Change platform dependency to ARCH_RENESAS
[linux/fpc-iii.git] / sound / soc / codecs / tlv320aic23-i2c.c
blob1d7c117316fb4e75cf061cd9a2b2eee271495b57
1 /*
2 * ALSA SoC TLV320AIC23 codec driver I2C interface
4 * Author: Arun KS, <arunks@mistralsolutions.com>
5 * Copyright: (C) 2008 Mistral Solutions Pvt Ltd.,
7 * Based on sound/soc/codecs/wm8731.c by Richard Purdie
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
14 #include <linux/i2c.h>
15 #include <linux/module.h>
16 #include <linux/of.h>
17 #include <linux/regmap.h>
18 #include <sound/soc.h>
20 #include "tlv320aic23.h"
22 static int tlv320aic23_i2c_probe(struct i2c_client *i2c,
23 const struct i2c_device_id *i2c_id)
25 struct regmap *regmap;
27 if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
28 return -EINVAL;
30 regmap = devm_regmap_init_i2c(i2c, &tlv320aic23_regmap);
31 return tlv320aic23_probe(&i2c->dev, regmap);
34 static const struct i2c_device_id tlv320aic23_id[] = {
35 {"tlv320aic23", 0},
39 MODULE_DEVICE_TABLE(i2c, tlv320aic23_id);
41 static const struct of_device_id tlv320aic23_of_match[] = {
42 { .compatible = "ti,tlv320aic23", },
43 { }
45 MODULE_DEVICE_TABLE(of, tlv320aic23_of_match);
47 static struct i2c_driver tlv320aic23_i2c_driver = {
48 .driver = {
49 .name = "tlv320aic23-codec",
50 .of_match_table = of_match_ptr(tlv320aic23_of_match),
52 .probe = tlv320aic23_i2c_probe,
53 .id_table = tlv320aic23_id,
56 module_i2c_driver(tlv320aic23_i2c_driver);
58 MODULE_DESCRIPTION("ASoC TLV320AIC23 codec driver I2C");
59 MODULE_AUTHOR("Arun KS <arunks@mistralsolutions.com>");
60 MODULE_LICENSE("GPL");