mtd: lpddr: fix Kconfig dependency, for I/O accessors
[linux/fpc-iii.git] / sound / soc / codecs / ad193x-i2c.c
blobdf3a1a415825bf6c0a599344611a769066e850bc
1 /*
2 * AD1936/AD1937 audio driver
4 * Copyright 2014 Analog Devices Inc.
6 * Licensed under the GPL-2.
7 */
9 #include <linux/module.h>
10 #include <linux/i2c.h>
11 #include <linux/regmap.h>
13 #include <sound/soc.h>
15 #include "ad193x.h"
17 static const struct i2c_device_id ad193x_id[] = {
18 { "ad1936", 0 },
19 { "ad1937", 0 },
20 { }
22 MODULE_DEVICE_TABLE(i2c, ad193x_id);
24 static int ad193x_i2c_probe(struct i2c_client *client,
25 const struct i2c_device_id *id)
27 struct regmap_config config;
29 config = ad193x_regmap_config;
30 config.val_bits = 8;
31 config.reg_bits = 8;
33 return ad193x_probe(&client->dev, devm_regmap_init_i2c(client, &config));
36 static int ad193x_i2c_remove(struct i2c_client *client)
38 snd_soc_unregister_codec(&client->dev);
39 return 0;
42 static struct i2c_driver ad193x_i2c_driver = {
43 .driver = {
44 .name = "ad193x",
46 .probe = ad193x_i2c_probe,
47 .remove = ad193x_i2c_remove,
48 .id_table = ad193x_id,
50 module_i2c_driver(ad193x_i2c_driver);
52 MODULE_DESCRIPTION("ASoC AD1936/AD1937 audio CODEC driver");
53 MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>");
54 MODULE_LICENSE("GPL");