aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
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 12f6ac99b04c..9212c37a33b8 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 b6edb61a3a30..fe6cca9c9e76 100644
--- a/sound/soc/pxa/tosa.c
+++ b/sound/soc/pxa/tosa.c
@@ -21,6 +21,7 @@
21#include <linux/module.h> 21#include <linux/module.h>
22#include <linux/moduleparam.h> 22#include <linux/moduleparam.h>
23#include <linux/device.h> 23#include <linux/device.h>
24#include <linux/gpio.h>
24 25
25#include <sound/core.h> 26#include <sound/core.h>
26#include <sound/pcm.h> 27#include <sound/pcm.h>
@@ -28,7 +29,7 @@
28#include <sound/soc-dapm.h> 29#include <sound/soc-dapm.h>
29 30
30#include <asm/mach-types.h> 31#include <asm/mach-types.h>
31#include <asm/hardware/tmio.h> 32#include <asm/arch/tosa.h>
32#include <asm/arch/pxa-regs.h> 33#include <asm/arch/pxa-regs.h>
33#include <asm/arch/hardware.h> 34#include <asm/arch/hardware.h>
34#include <asm/arch/audio.h> 35#include <asm/arch/audio.h>
@@ -137,10 +138,7 @@ static int tosa_set_spk(struct snd_kcontrol *kcontrol,
137static int tosa_hp_event(struct snd_soc_dapm_widget *w, 138static int tosa_hp_event(struct snd_soc_dapm_widget *w,
138 struct snd_kcontrol *k, int event) 139 struct snd_kcontrol *k, int event)
139{ 140{
140 if (SND_SOC_DAPM_EVENT_ON(event)) 141 gpio_set_value(TOSA_GPIO_L_MUTE, SND_SOC_DAPM_EVENT_ON(event) ? 1 :0);
141 set_tc6393_gpio(&tc6393_device.dev,TOSA_TC6393_L_MUTE);
142 else
143 reset_tc6393_gpio(&tc6393_device.dev,TOSA_TC6393_L_MUTE);
144 return 0; 142 return 0;
145} 143}
146 144
@@ -254,16 +252,28 @@ static int __init tosa_init(void)
254 if (!machine_is_tosa()) 252 if (!machine_is_tosa())
255 return -ENODEV; 253 return -ENODEV;
256 254
255 ret = gpio_request(TOSA_GPIO_L_MUTE, "Headphone Jack");
256 if (ret)
257 return ret;
258 gpio_direction_output(TOSA_GPIO_L_MUTE, 0);
259
257 tosa_snd_device = platform_device_alloc("soc-audio", -1); 260 tosa_snd_device = platform_device_alloc("soc-audio", -1);
258 if (!tosa_snd_device) 261 if (!tosa_snd_device) {
259 return -ENOMEM; 262 ret = -ENOMEM;
263 goto err_alloc;
264 }
260 265
261 platform_set_drvdata(tosa_snd_device, &tosa_snd_devdata); 266 platform_set_drvdata(tosa_snd_device, &tosa_snd_devdata);
262 tosa_snd_devdata.dev = &tosa_snd_device->dev; 267 tosa_snd_devdata.dev = &tosa_snd_device->dev;
263 ret = platform_device_add(tosa_snd_device); 268 ret = platform_device_add(tosa_snd_device);
264 269
265 if (ret) 270 if (!ret)
266 platform_device_put(tosa_snd_device); 271 return 0;
272
273 platform_device_put(tosa_snd_device);
274
275err_alloc:
276 gpio_free(TOSA_GPIO_L_MUTE);
267 277
268 return ret; 278 return ret;
269} 279}
@@ -271,6 +281,7 @@ static int __init tosa_init(void)
271static void __exit tosa_exit(void) 281static void __exit tosa_exit(void)
272{ 282{
273 platform_device_unregister(tosa_snd_device); 283 platform_device_unregister(tosa_snd_device);
284 gpio_free(TOSA_GPIO_L_MUTE);
274} 285}
275 286
276module_init(tosa_init); 287module_init(tosa_init);