diff options
author | Nicolin Chen <Guangyu.Chen@freescale.com> | 2014-03-20 06:18:37 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-03-20 07:49:34 -0400 |
commit | 0c516b4ff85c0be4cee5b30ae59c9565c7f91a00 (patch) | |
tree | 1975847ffd2aedd30f7f21216c886695f21172d8 /sound/soc/codecs/cs42xx8-i2c.c | |
parent | 38dbfb59d1175ef458d006556061adeaa8751b72 (diff) |
ASoC: cs42xx8: Add codec driver support for CS42448/CS42888
This patch adds support for the Cirrus Logic CS42448/CS42888 Audio CODEC that
has six/four 24-bit AD and eight 24-bit DA converters.
[ CS42448/CS42888 supports both I2C and SPI control ports. As initial patch,
this patch only adds the support for I2C. ]
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Acked-by: Brian Austin <brian.austin@cirrus.com>
Acked-by: Paul Handrigan <Paul.Handrigan@cirrus.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/codecs/cs42xx8-i2c.c')
-rw-r--r-- | sound/soc/codecs/cs42xx8-i2c.c | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/sound/soc/codecs/cs42xx8-i2c.c b/sound/soc/codecs/cs42xx8-i2c.c new file mode 100644 index 000000000000..657dce27eade --- /dev/null +++ b/sound/soc/codecs/cs42xx8-i2c.c | |||
@@ -0,0 +1,64 @@ | |||
1 | /* | ||
2 | * Cirrus Logic CS42448/CS42888 Audio CODEC DAI I2C driver | ||
3 | * | ||
4 | * Copyright (C) 2014 Freescale Semiconductor, Inc. | ||
5 | * | ||
6 | * Author: Nicolin Chen <Guangyu.Chen@freescale.com> | ||
7 | * | ||
8 | * This file is licensed under the terms of the GNU General Public License | ||
9 | * version 2. This program is licensed "as is" without any warranty of any | ||
10 | * kind, whether express or implied. | ||
11 | */ | ||
12 | |||
13 | #include <linux/i2c.h> | ||
14 | #include <linux/module.h> | ||
15 | #include <linux/pm_runtime.h> | ||
16 | #include <sound/soc.h> | ||
17 | |||
18 | #include "cs42xx8.h" | ||
19 | |||
20 | static int cs42xx8_i2c_probe(struct i2c_client *i2c, | ||
21 | const struct i2c_device_id *id) | ||
22 | { | ||
23 | u32 ret = cs42xx8_probe(&i2c->dev, | ||
24 | devm_regmap_init_i2c(i2c, &cs42xx8_regmap_config)); | ||
25 | if (ret) | ||
26 | return ret; | ||
27 | |||
28 | pm_runtime_enable(&i2c->dev); | ||
29 | pm_request_idle(&i2c->dev); | ||
30 | |||
31 | return 0; | ||
32 | } | ||
33 | |||
34 | static int cs42xx8_i2c_remove(struct i2c_client *i2c) | ||
35 | { | ||
36 | snd_soc_unregister_codec(&i2c->dev); | ||
37 | pm_runtime_disable(&i2c->dev); | ||
38 | |||
39 | return 0; | ||
40 | } | ||
41 | |||
42 | static struct i2c_device_id cs42xx8_i2c_id[] = { | ||
43 | {"cs42448", (kernel_ulong_t)&cs42448_data}, | ||
44 | {"cs42888", (kernel_ulong_t)&cs42888_data}, | ||
45 | {} | ||
46 | }; | ||
47 | MODULE_DEVICE_TABLE(i2c, cs42xx8_i2c_id); | ||
48 | |||
49 | static struct i2c_driver cs42xx8_i2c_driver = { | ||
50 | .driver = { | ||
51 | .name = "cs42xx8", | ||
52 | .owner = THIS_MODULE, | ||
53 | .pm = &cs42xx8_pm, | ||
54 | }, | ||
55 | .probe = cs42xx8_i2c_probe, | ||
56 | .remove = cs42xx8_i2c_remove, | ||
57 | .id_table = cs42xx8_i2c_id, | ||
58 | }; | ||
59 | |||
60 | module_i2c_driver(cs42xx8_i2c_driver); | ||
61 | |||
62 | MODULE_DESCRIPTION("Cirrus Logic CS42448/CS42888 ALSA SoC Codec I2C Driver"); | ||
63 | MODULE_AUTHOR("Freescale Semiconductor, Inc."); | ||
64 | MODULE_LICENSE("GPL"); | ||