diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-23 21:24:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-23 21:24:08 -0400 |
commit | 30d38542ec777468bb6a31829076a2dbc5690e35 (patch) | |
tree | 698b7a4fdd730befa34c4c9642cdbe72ce7d336a /sound/soc/pxa/tosa.c | |
parent | 20b7997e8abdf338dcc27fb4f1333c4973a7f113 (diff) | |
parent | 044e5f45e4ad890d03bd1e8bb44c634397cac24d (diff) |
Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm: (85 commits)
[ARM] pxa: add base support for PXA930 Handheld Platform (aka SAAR)
[ARM] pxa: add base support for PXA930 Evaluation Board (aka TavorEVB)
[ARM] pxa: add base support for PXA930 (aka Tavor-P)
[ARM] Update mach-types
[ARM] pxa: make littleton to use the new smc91x platform data
[ARM] pxa: make zylonite to use the new smc91x platform data
[ARM] pxa: make mainstone to use the new smc91x platform data
[ARM] pxa: make lubbock to use new smc91x platform data
[NET] smc91x: prepare SMC_USE_PXA_DMA to be specified in platform data
[NET] smc91x: prepare for SMC_IO_SHIFT to be a platform configurable variable
[NET] smc91x: add SMC91X_NOWAIT flag to platform data
[NET] smc91x: favor the use of SMC91X_USE_* instead of SMC_CAN_USE_*
[NET] smc91x: remove "irq_flags" from "struct smc91x_platdata"
[ARM] 5146/1: pxa2xx: convert all boards to call pxa2xx_transceiver_mode helper
Support for LCD on e740 e750 e400 and e800 e-series PDAs
E-series UDC support
PXA UDC - allow use of inverted GPIO for pullup
Add e350 support
Fix broken e-series build
E-series GPIO / IRQ definitions.
...
Diffstat (limited to 'sound/soc/pxa/tosa.c')
-rw-r--r-- | sound/soc/pxa/tosa.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/sound/soc/pxa/tosa.c b/sound/soc/pxa/tosa.c index b6edb61a3a3..fe6cca9c9e7 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, | |||
137 | static int tosa_hp_event(struct snd_soc_dapm_widget *w, | 138 | static 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 | |||
275 | err_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) | |||
271 | static void __exit tosa_exit(void) | 281 | static 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 | ||
276 | module_init(tosa_init); | 287 | module_init(tosa_init); |