aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/input/misc/Kconfig2
-rw-r--r--drivers/input/misc/twl4030-vibra.c10
-rw-r--r--drivers/mfd/Kconfig2
-rw-r--r--drivers/mfd/Makefile2
-rw-r--r--drivers/mfd/twl4030-audio.c (renamed from drivers/mfd/twl4030-codec.c)33
-rw-r--r--include/linux/mfd/twl4030-audio.h (renamed from include/linux/mfd/twl4030-codec.h)16
-rw-r--r--sound/soc/codecs/Kconfig2
-rw-r--r--sound/soc/codecs/twl4030.c16
-rw-r--r--sound/soc/omap/sdp3430.c2
-rw-r--r--sound/soc/omap/zoom2.c2
10 files changed, 43 insertions, 44 deletions
diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
index 45dc6aa62ba4..077309a29a2e 100644
--- a/drivers/input/misc/Kconfig
+++ b/drivers/input/misc/Kconfig
@@ -267,7 +267,7 @@ config INPUT_TWL4030_PWRBUTTON
267config INPUT_TWL4030_VIBRA 267config INPUT_TWL4030_VIBRA
268 tristate "Support for TWL4030 Vibrator" 268 tristate "Support for TWL4030 Vibrator"
269 depends on TWL4030_CORE 269 depends on TWL4030_CORE
270 select TWL4030_CODEC 270 select MFD_TWL4030_AUDIO
271 select INPUT_FF_MEMLESS 271 select INPUT_FF_MEMLESS
272 help 272 help
273 This option enables support for TWL4030 Vibrator Driver. 273 This option enables support for TWL4030 Vibrator Driver.
diff --git a/drivers/input/misc/twl4030-vibra.c b/drivers/input/misc/twl4030-vibra.c
index 014dd4ad0d4f..7abca85b5a74 100644
--- a/drivers/input/misc/twl4030-vibra.c
+++ b/drivers/input/misc/twl4030-vibra.c
@@ -28,7 +28,7 @@
28#include <linux/platform_device.h> 28#include <linux/platform_device.h>
29#include <linux/workqueue.h> 29#include <linux/workqueue.h>
30#include <linux/i2c/twl.h> 30#include <linux/i2c/twl.h>
31#include <linux/mfd/twl4030-codec.h> 31#include <linux/mfd/twl4030-audio.h>
32#include <linux/input.h> 32#include <linux/input.h>
33#include <linux/slab.h> 33#include <linux/slab.h>
34 34
@@ -67,7 +67,7 @@ static void vibra_enable(struct vibra_info *info)
67{ 67{
68 u8 reg; 68 u8 reg;
69 69
70 twl4030_codec_enable_resource(TWL4030_CODEC_RES_POWER); 70 twl4030_audio_enable_resource(TWL4030_AUDIO_RES_POWER);
71 71
72 /* turn H-Bridge on */ 72 /* turn H-Bridge on */
73 twl_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE, 73 twl_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE,
@@ -75,7 +75,7 @@ static void vibra_enable(struct vibra_info *info)
75 twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE, 75 twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE,
76 (reg | TWL4030_VIBRA_EN), TWL4030_REG_VIBRA_CTL); 76 (reg | TWL4030_VIBRA_EN), TWL4030_REG_VIBRA_CTL);
77 77
78 twl4030_codec_enable_resource(TWL4030_CODEC_RES_APLL); 78 twl4030_audio_enable_resource(TWL4030_AUDIO_RES_APLL);
79 79
80 info->enabled = true; 80 info->enabled = true;
81} 81}
@@ -90,8 +90,8 @@ static void vibra_disable(struct vibra_info *info)
90 twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE, 90 twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE,
91 (reg & ~TWL4030_VIBRA_EN), TWL4030_REG_VIBRA_CTL); 91 (reg & ~TWL4030_VIBRA_EN), TWL4030_REG_VIBRA_CTL);
92 92
93 twl4030_codec_disable_resource(TWL4030_CODEC_RES_APLL); 93 twl4030_audio_disable_resource(TWL4030_AUDIO_RES_APLL);
94 twl4030_codec_disable_resource(TWL4030_CODEC_RES_POWER); 94 twl4030_audio_disable_resource(TWL4030_AUDIO_RES_POWER);
95 95
96 info->enabled = false; 96 info->enabled = false;
97} 97}
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 0f09c057e796..3a6f76aac008 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -218,7 +218,7 @@ config TWL4030_POWER
218 and load scripts controlling which resources are switched off/on 218 and load scripts controlling which resources are switched off/on
219 or reset when a sleep, wakeup or warm reset event occurs. 219 or reset when a sleep, wakeup or warm reset event occurs.
220 220
221config TWL4030_CODEC 221config MFD_TWL4030_AUDIO
222 bool 222 bool
223 depends on TWL4030_CORE 223 depends on TWL4030_CORE
224 select MFD_CORE 224 select MFD_CORE
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index efe3cc33ed92..4cf946537e39 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -40,7 +40,7 @@ obj-$(CONFIG_MENELAUS) += menelaus.o
40obj-$(CONFIG_TWL4030_CORE) += twl-core.o twl4030-irq.o twl6030-irq.o 40obj-$(CONFIG_TWL4030_CORE) += twl-core.o twl4030-irq.o twl6030-irq.o
41obj-$(CONFIG_TWL4030_MADC) += twl4030-madc.o 41obj-$(CONFIG_TWL4030_MADC) += twl4030-madc.o
42obj-$(CONFIG_TWL4030_POWER) += twl4030-power.o 42obj-$(CONFIG_TWL4030_POWER) += twl4030-power.o
43obj-$(CONFIG_TWL4030_CODEC) += twl4030-codec.o 43obj-$(CONFIG_MFD_TWL4030_AUDIO) += twl4030-audio.o
44obj-$(CONFIG_TWL6030_PWM) += twl6030-pwm.o 44obj-$(CONFIG_TWL6030_PWM) += twl6030-pwm.o
45 45
46obj-$(CONFIG_MFD_MC13XXX) += mc13xxx-core.o 46obj-$(CONFIG_MFD_MC13XXX) += mc13xxx-core.o
diff --git a/drivers/mfd/twl4030-codec.c b/drivers/mfd/twl4030-audio.c
index e1782b3f66a5..5cdf84146799 100644
--- a/drivers/mfd/twl4030-codec.c
+++ b/drivers/mfd/twl4030-audio.c
@@ -30,7 +30,7 @@
30#include <linux/platform_device.h> 30#include <linux/platform_device.h>
31#include <linux/i2c/twl.h> 31#include <linux/i2c/twl.h>
32#include <linux/mfd/core.h> 32#include <linux/mfd/core.h>
33#include <linux/mfd/twl4030-codec.h> 33#include <linux/mfd/twl4030-audio.h>
34 34
35#define TWL4030_AUDIO_CELLS 2 35#define TWL4030_AUDIO_CELLS 2
36 36
@@ -45,7 +45,7 @@ struct twl4030_audio_resource {
45struct twl4030_audio { 45struct twl4030_audio {
46 unsigned int audio_mclk; 46 unsigned int audio_mclk;
47 struct mutex mutex; 47 struct mutex mutex;
48 struct twl4030_audio_resource resource[TWL4030_CODEC_RES_MAX]; 48 struct twl4030_audio_resource resource[TWL4030_AUDIO_RES_MAX];
49 struct mfd_cell cells[TWL4030_AUDIO_CELLS]; 49 struct mfd_cell cells[TWL4030_AUDIO_CELLS];
50}; 50};
51 51
@@ -53,7 +53,7 @@ struct twl4030_audio {
53 * Modify the resource, the function returns the content of the register 53 * Modify the resource, the function returns the content of the register
54 * after the modification. 54 * after the modification.
55 */ 55 */
56static int twl4030_audio_set_resource(enum twl4030_codec_res id, int enable) 56static int twl4030_audio_set_resource(enum twl4030_audio_res id, int enable)
57{ 57{
58 struct twl4030_audio *audio = platform_get_drvdata(twl4030_audio_dev); 58 struct twl4030_audio *audio = platform_get_drvdata(twl4030_audio_dev);
59 u8 val; 59 u8 val;
@@ -72,7 +72,7 @@ static int twl4030_audio_set_resource(enum twl4030_codec_res id, int enable)
72 return val; 72 return val;
73} 73}
74 74
75static inline int twl4030_audio_get_resource(enum twl4030_codec_res id) 75static inline int twl4030_audio_get_resource(enum twl4030_audio_res id)
76{ 76{
77 struct twl4030_audio *audio = platform_get_drvdata(twl4030_audio_dev); 77 struct twl4030_audio *audio = platform_get_drvdata(twl4030_audio_dev);
78 u8 val; 78 u8 val;
@@ -87,12 +87,12 @@ static inline int twl4030_audio_get_resource(enum twl4030_codec_res id)
87 * Enable the resource. 87 * Enable the resource.
88 * The function returns with error or the content of the register 88 * The function returns with error or the content of the register
89 */ 89 */
90int twl4030_codec_enable_resource(enum twl4030_codec_res id) 90int twl4030_audio_enable_resource(enum twl4030_audio_res id)
91{ 91{
92 struct twl4030_audio *audio = platform_get_drvdata(twl4030_audio_dev); 92 struct twl4030_audio *audio = platform_get_drvdata(twl4030_audio_dev);
93 int val; 93 int val;
94 94
95 if (id >= TWL4030_CODEC_RES_MAX) { 95 if (id >= TWL4030_AUDIO_RES_MAX) {
96 dev_err(&twl4030_audio_dev->dev, 96 dev_err(&twl4030_audio_dev->dev,
97 "Invalid resource ID (%u)\n", id); 97 "Invalid resource ID (%u)\n", id);
98 return -EINVAL; 98 return -EINVAL;
@@ -110,18 +110,18 @@ int twl4030_codec_enable_resource(enum twl4030_codec_res id)
110 110
111 return val; 111 return val;
112} 112}
113EXPORT_SYMBOL_GPL(twl4030_codec_enable_resource); 113EXPORT_SYMBOL_GPL(twl4030_audio_enable_resource);
114 114
115/* 115/*
116 * Disable the resource. 116 * Disable the resource.
117 * The function returns with error or the content of the register 117 * The function returns with error or the content of the register
118 */ 118 */
119int twl4030_codec_disable_resource(unsigned id) 119int twl4030_audio_disable_resource(unsigned id)
120{ 120{
121 struct twl4030_audio *audio = platform_get_drvdata(twl4030_audio_dev); 121 struct twl4030_audio *audio = platform_get_drvdata(twl4030_audio_dev);
122 int val; 122 int val;
123 123
124 if (id >= TWL4030_CODEC_RES_MAX) { 124 if (id >= TWL4030_AUDIO_RES_MAX) {
125 dev_err(&twl4030_audio_dev->dev, 125 dev_err(&twl4030_audio_dev->dev,
126 "Invalid resource ID (%u)\n", id); 126 "Invalid resource ID (%u)\n", id);
127 return -EINVAL; 127 return -EINVAL;
@@ -146,15 +146,15 @@ int twl4030_codec_disable_resource(unsigned id)
146 146
147 return val; 147 return val;
148} 148}
149EXPORT_SYMBOL_GPL(twl4030_codec_disable_resource); 149EXPORT_SYMBOL_GPL(twl4030_audio_disable_resource);
150 150
151unsigned int twl4030_codec_get_mclk(void) 151unsigned int twl4030_audio_get_mclk(void)
152{ 152{
153 struct twl4030_audio *audio = platform_get_drvdata(twl4030_audio_dev); 153 struct twl4030_audio *audio = platform_get_drvdata(twl4030_audio_dev);
154 154
155 return audio->audio_mclk; 155 return audio->audio_mclk;
156} 156}
157EXPORT_SYMBOL_GPL(twl4030_codec_get_mclk); 157EXPORT_SYMBOL_GPL(twl4030_audio_get_mclk);
158 158
159static int __devinit twl4030_audio_probe(struct platform_device *pdev) 159static int __devinit twl4030_audio_probe(struct platform_device *pdev)
160{ 160{
@@ -199,12 +199,12 @@ static int __devinit twl4030_audio_probe(struct platform_device *pdev)
199 audio->audio_mclk = pdata->audio_mclk; 199 audio->audio_mclk = pdata->audio_mclk;
200 200
201 /* Codec power */ 201 /* Codec power */
202 audio->resource[TWL4030_CODEC_RES_POWER].reg = TWL4030_REG_CODEC_MODE; 202 audio->resource[TWL4030_AUDIO_RES_POWER].reg = TWL4030_REG_CODEC_MODE;
203 audio->resource[TWL4030_CODEC_RES_POWER].mask = TWL4030_CODECPDZ; 203 audio->resource[TWL4030_AUDIO_RES_POWER].mask = TWL4030_CODECPDZ;
204 204
205 /* PLL */ 205 /* PLL */
206 audio->resource[TWL4030_CODEC_RES_APLL].reg = TWL4030_REG_APLL_CTL; 206 audio->resource[TWL4030_AUDIO_RES_APLL].reg = TWL4030_REG_APLL_CTL;
207 audio->resource[TWL4030_CODEC_RES_APLL].mask = TWL4030_APLL_EN; 207 audio->resource[TWL4030_AUDIO_RES_APLL].mask = TWL4030_APLL_EN;
208 208
209 if (pdata->audio) { 209 if (pdata->audio) {
210 cell = &audio->cells[childs]; 210 cell = &audio->cells[childs];
@@ -275,4 +275,3 @@ module_exit(twl4030_audio_exit);
275 275
276MODULE_AUTHOR("Peter Ujfalusi <peter.ujfalusi@ti.com>"); 276MODULE_AUTHOR("Peter Ujfalusi <peter.ujfalusi@ti.com>");
277MODULE_LICENSE("GPL"); 277MODULE_LICENSE("GPL");
278
diff --git a/include/linux/mfd/twl4030-codec.h b/include/linux/mfd/twl4030-audio.h
index 5cc16bbd1da1..3d22b72df076 100644
--- a/include/linux/mfd/twl4030-codec.h
+++ b/include/linux/mfd/twl4030-audio.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * MFD driver for twl4030 codec submodule 2 * MFD driver for twl4030 audio submodule
3 * 3 *
4 * Author: Peter Ujfalusi <peter.ujfalusi@ti.com> 4 * Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
5 * 5 *
@@ -259,14 +259,14 @@
259#define TWL4030_VIBRA_DIR_SEL 0x20 259#define TWL4030_VIBRA_DIR_SEL 0x20
260 260
261/* TWL4030 codec resource IDs */ 261/* TWL4030 codec resource IDs */
262enum twl4030_codec_res { 262enum twl4030_audio_res {
263 TWL4030_CODEC_RES_POWER = 0, 263 TWL4030_AUDIO_RES_POWER = 0,
264 TWL4030_CODEC_RES_APLL, 264 TWL4030_AUDIO_RES_APLL,
265 TWL4030_CODEC_RES_MAX, 265 TWL4030_AUDIO_RES_MAX,
266}; 266};
267 267
268int twl4030_codec_disable_resource(enum twl4030_codec_res id); 268int twl4030_audio_disable_resource(enum twl4030_audio_res id);
269int twl4030_codec_enable_resource(enum twl4030_codec_res id); 269int twl4030_audio_enable_resource(enum twl4030_audio_res id);
270unsigned int twl4030_codec_get_mclk(void); 270unsigned int twl4030_audio_get_mclk(void);
271 271
272#endif /* End of __TWL4030_CODEC_H__ */ 272#endif /* End of __TWL4030_CODEC_H__ */
diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index 98175a096df2..0002220bbc3b 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -236,7 +236,7 @@ config SND_SOC_TLV320DAC33
236 tristate 236 tristate
237 237
238config SND_SOC_TWL4030 238config SND_SOC_TWL4030
239 select TWL4030_CODEC 239 select MFD_TWL4030_AUDIO
240 tristate 240 tristate
241 241
242config SND_SOC_TWL6040 242config SND_SOC_TWL6040
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
index bec788b12613..5e648d33d559 100644
--- a/sound/soc/codecs/twl4030.c
+++ b/sound/soc/codecs/twl4030.c
@@ -36,7 +36,7 @@
36#include <sound/tlv.h> 36#include <sound/tlv.h>
37 37
38/* Register descriptions are here */ 38/* Register descriptions are here */
39#include <linux/mfd/twl4030-codec.h> 39#include <linux/mfd/twl4030-audio.h>
40 40
41/* Shadow register used by the audio driver */ 41/* Shadow register used by the audio driver */
42#define TWL4030_REG_SW_SHADOW 0x4A 42#define TWL4030_REG_SW_SHADOW 0x4A
@@ -251,9 +251,9 @@ static void twl4030_codec_enable(struct snd_soc_codec *codec, int enable)
251 return; 251 return;
252 252
253 if (enable) 253 if (enable)
254 mode = twl4030_codec_enable_resource(TWL4030_CODEC_RES_POWER); 254 mode = twl4030_audio_enable_resource(TWL4030_AUDIO_RES_POWER);
255 else 255 else
256 mode = twl4030_codec_disable_resource(TWL4030_CODEC_RES_POWER); 256 mode = twl4030_audio_disable_resource(TWL4030_AUDIO_RES_POWER);
257 257
258 if (mode >= 0) { 258 if (mode >= 0) {
259 twl4030_write_reg_cache(codec, TWL4030_REG_CODEC_MODE, mode); 259 twl4030_write_reg_cache(codec, TWL4030_REG_CODEC_MODE, mode);
@@ -375,13 +375,13 @@ static void twl4030_apll_enable(struct snd_soc_codec *codec, int enable)
375 if (enable) { 375 if (enable) {
376 twl4030->apll_enabled++; 376 twl4030->apll_enabled++;
377 if (twl4030->apll_enabled == 1) 377 if (twl4030->apll_enabled == 1)
378 status = twl4030_codec_enable_resource( 378 status = twl4030_audio_enable_resource(
379 TWL4030_CODEC_RES_APLL); 379 TWL4030_AUDIO_RES_APLL);
380 } else { 380 } else {
381 twl4030->apll_enabled--; 381 twl4030->apll_enabled--;
382 if (!twl4030->apll_enabled) 382 if (!twl4030->apll_enabled)
383 status = twl4030_codec_disable_resource( 383 status = twl4030_audio_disable_resource(
384 TWL4030_CODEC_RES_APLL); 384 TWL4030_AUDIO_RES_APLL);
385 } 385 }
386 386
387 if (status >= 0) 387 if (status >= 0)
@@ -2260,7 +2260,7 @@ static int twl4030_soc_probe(struct snd_soc_codec *codec)
2260 } 2260 }
2261 snd_soc_codec_set_drvdata(codec, twl4030); 2261 snd_soc_codec_set_drvdata(codec, twl4030);
2262 /* Set the defaults, and power up the codec */ 2262 /* Set the defaults, and power up the codec */
2263 twl4030->sysclk = twl4030_codec_get_mclk() / 1000; 2263 twl4030->sysclk = twl4030_audio_get_mclk() / 1000;
2264 codec->dapm.idle_bias_off = 1; 2264 codec->dapm.idle_bias_off = 1;
2265 2265
2266 twl4030_init_chip(codec); 2266 twl4030_init_chip(codec);
diff --git a/sound/soc/omap/sdp3430.c b/sound/soc/omap/sdp3430.c
index 3f72d17d1ef0..9f6a758029d1 100644
--- a/sound/soc/omap/sdp3430.c
+++ b/sound/soc/omap/sdp3430.c
@@ -36,7 +36,7 @@
36#include <plat/mcbsp.h> 36#include <plat/mcbsp.h>
37 37
38/* Register descriptions for twl4030 codec part */ 38/* Register descriptions for twl4030 codec part */
39#include <linux/mfd/twl4030-codec.h> 39#include <linux/mfd/twl4030-audio.h>
40 40
41#include "omap-mcbsp.h" 41#include "omap-mcbsp.h"
42#include "omap-pcm.h" 42#include "omap-pcm.h"
diff --git a/sound/soc/omap/zoom2.c b/sound/soc/omap/zoom2.c
index 01709940a43c..9a2666ffc16c 100644
--- a/sound/soc/omap/zoom2.c
+++ b/sound/soc/omap/zoom2.c
@@ -32,7 +32,7 @@
32#include <plat/mcbsp.h> 32#include <plat/mcbsp.h>
33 33
34/* Register descriptions for twl4030 codec part */ 34/* Register descriptions for twl4030 codec part */
35#include <linux/mfd/twl4030-codec.h> 35#include <linux/mfd/twl4030-audio.h>
36 36
37#include "omap-mcbsp.h" 37#include "omap-mcbsp.h"
38#include "omap-pcm.h" 38#include "omap-pcm.h"