aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorDmitry Baryshkov <dbaryshkov@gmail.com>2008-06-14 06:42:57 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-07-07 08:22:04 -0400
commit4440cbd69fc71bab8ed932e237b2a453b365ab9b (patch)
treeac489d140c358b98977f0632e87ee2e2f23255e8 /sound
parentbf0116e54e185fd63025f2b975f0f1616ffe41f1 (diff)
[ARM] 5098/1: fix sound/soc/pxa/tosa.c to new gpio api
The sound/soc/pxa/tosa.c contains dependencies on parts that never ever hit mainline. Replace them with current support for tc6393xb. Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/pxa/Kconfig1
-rw-r--r--sound/soc/pxa/tosa.c29
2 files changed, 21 insertions, 9 deletions
diff --git a/sound/soc/pxa/Kconfig b/sound/soc/pxa/Kconfig
index 484f883459e0..329b33f37ef3 100644
--- a/sound/soc/pxa/Kconfig
+++ b/sound/soc/pxa/Kconfig
@@ -48,6 +48,7 @@ config SND_PXA2XX_SOC_POODLE
48config SND_PXA2XX_SOC_TOSA 48config SND_PXA2XX_SOC_TOSA
49 tristate "SoC AC97 Audio support for Tosa" 49 tristate "SoC AC97 Audio support for Tosa"
50 depends on SND_PXA2XX_SOC && MACH_TOSA 50 depends on SND_PXA2XX_SOC && MACH_TOSA
51 depends on MFD_TC6393XB
51 select SND_PXA2XX_SOC_AC97 52 select SND_PXA2XX_SOC_AC97
52 select SND_SOC_WM9712 53 select SND_SOC_WM9712
53 help 54 help
diff --git a/sound/soc/pxa/tosa.c b/sound/soc/pxa/tosa.c
index 7346d7e5d066..c1462c4d139b 100644
--- a/sound/soc/pxa/tosa.c
+++ b/sound/soc/pxa/tosa.c
@@ -24,6 +24,7 @@
24#include <linux/module.h> 24#include <linux/module.h>
25#include <linux/moduleparam.h> 25#include <linux/moduleparam.h>
26#include <linux/device.h> 26#include <linux/device.h>
27#include <linux/gpio.h>
27 28
28#include <sound/core.h> 29#include <sound/core.h>
29#include <sound/pcm.h> 30#include <sound/pcm.h>
@@ -31,7 +32,7 @@
31#include <sound/soc-dapm.h> 32#include <sound/soc-dapm.h>
32 33
33#include <asm/mach-types.h> 34#include <asm/mach-types.h>
34#include <asm/hardware/tmio.h> 35#include <asm/arch/tosa.h>
35#include <asm/arch/pxa-regs.h> 36#include <asm/arch/pxa-regs.h>
36#include <asm/arch/hardware.h> 37#include <asm/arch/hardware.h>
37#include <asm/arch/audio.h> 38#include <asm/arch/audio.h>
@@ -138,10 +139,7 @@ static int tosa_set_spk(struct snd_kcontrol *kcontrol,
138static int tosa_hp_event(struct snd_soc_dapm_widget *w, 139static int tosa_hp_event(struct snd_soc_dapm_widget *w,
139 struct snd_kcontrol *k, int event) 140 struct snd_kcontrol *k, int event)
140{ 141{
141 if (SND_SOC_DAPM_EVENT_ON(event)) 142 gpio_set_value(TOSA_GPIO_L_MUTE, SND_SOC_DAPM_EVENT_ON(event) ? 1 :0);
142 set_tc6393_gpio(&tc6393_device.dev,TOSA_TC6393_L_MUTE);
143 else
144 reset_tc6393_gpio(&tc6393_device.dev,TOSA_TC6393_L_MUTE);
145 return 0; 143 return 0;
146} 144}
147 145
@@ -261,16 +259,28 @@ static int __init tosa_init(void)
261 if (!machine_is_tosa()) 259 if (!machine_is_tosa())
262 return -ENODEV; 260 return -ENODEV;
263 261
262 ret = gpio_request(TOSA_GPIO_L_MUTE, "Headphone Jack");
263 if (ret)
264 return ret;
265 gpio_direction_output(TOSA_GPIO_L_MUTE, 0);
266
264 tosa_snd_device = platform_device_alloc("soc-audio", -1); 267 tosa_snd_device = platform_device_alloc("soc-audio", -1);
265 if (!tosa_snd_device) 268 if (!tosa_snd_device) {
266 return -ENOMEM; 269 ret = -ENOMEM;
270 goto err_alloc;
271 }
267 272
268 platform_set_drvdata(tosa_snd_device, &tosa_snd_devdata); 273 platform_set_drvdata(tosa_snd_device, &tosa_snd_devdata);
269 tosa_snd_devdata.dev = &tosa_snd_device->dev; 274 tosa_snd_devdata.dev = &tosa_snd_device->dev;
270 ret = platform_device_add(tosa_snd_device); 275 ret = platform_device_add(tosa_snd_device);
271 276
272 if (ret) 277 if (!ret)
273 platform_device_put(tosa_snd_device); 278 return 0;
279
280 platform_device_put(tosa_snd_device);
281
282err_alloc:
283 gpio_free(TOSA_GPIO_L_MUTE);
274 284
275 return ret; 285 return ret;
276} 286}
@@ -278,6 +288,7 @@ static int __init tosa_init(void)
278static void __exit tosa_exit(void) 288static void __exit tosa_exit(void)
279{ 289{
280 platform_device_unregister(tosa_snd_device); 290 platform_device_unregister(tosa_snd_device);
291 gpio_free(TOSA_GPIO_L_MUTE);
281} 292}
282 293
283module_init(tosa_init); 294module_init(tosa_init);