1 From 38ef1b452cc3138157b92d02b31cad439d12d0ca Mon Sep 17 00:00:00 2001
2 From: Dmitry Baryshkov <dbaryshkov@gmail.com>
3 Date: Wed, 9 Jan 2008 02:03:34 +0300
4 Subject: [PATCH 51/64] fix sound/soc/pxa/tosa.c to new gpio api
6 Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
8 sound/soc/pxa/tosa.c | 33 ++++++++++++++++++++++++++-------
9 1 files changed, 26 insertions(+), 7 deletions(-)
11 diff --git a/sound/soc/pxa/tosa.c b/sound/soc/pxa/tosa.c
12 index 21c51b5..b758de8 100644
13 --- a/sound/soc/pxa/tosa.c
14 +++ b/sound/soc/pxa/tosa.c
16 #include <asm/arch/hardware.h>
17 #include <asm/arch/audio.h>
18 #include <asm/arch/tosa.h>
19 +#include <asm/gpio.h>
21 #include "../codecs/wm9712.h"
22 #include "pxa2xx-pcm.h"
23 @@ -137,11 +138,11 @@ static int tosa_set_spk(struct snd_kcontrol *kcontrol,
24 /* tosa dapm event handlers */
25 static int tosa_hp_event(struct snd_soc_dapm_widget *w, int event)
28 +#ifdef CONFIG_MFD_TC6393XB
29 if (SND_SOC_DAPM_EVENT_ON(event))
30 - set_tc6393_gpio(&tc6393_device.dev,TOSA_TC6393_L_MUTE);
31 + gpio_set_value(TOSA_TC6393XB_L_MUTE, 1);
33 - reset_tc6393_gpio(&tc6393_device.dev,TOSA_TC6393_L_MUTE);
34 + gpio_set_value(TOSA_TC6393XB_L_MUTE, 0);
38 @@ -262,16 +263,31 @@ static int __init tosa_init(void)
39 if (!machine_is_tosa())
42 +#ifdef CONFIG_MFD_TC6393XB
43 + ret = gpio_request(TOSA_TC6393XB_L_MUTE, "Headphone Jack");
46 + gpio_direction_output(TOSA_TC6393XB_L_MUTE, 0);
48 tosa_snd_device = platform_device_alloc("soc-audio", -1);
49 - if (!tosa_snd_device)
51 + if (!tosa_snd_device) {
56 platform_set_drvdata(tosa_snd_device, &tosa_snd_devdata);
57 tosa_snd_devdata.dev = &tosa_snd_device->dev;
58 ret = platform_device_add(tosa_snd_device);
61 - platform_device_put(tosa_snd_device);
65 + platform_device_put(tosa_snd_device);
68 +#ifdef CONFIG_MFD_TC6393XB
69 + gpio_free(TOSA_TC6393XB_L_MUTE);
74 @@ -279,6 +295,9 @@ static int __init tosa_init(void)
75 static void __exit tosa_exit(void)
77 platform_device_unregister(tosa_snd_device);
78 +#ifdef CONFIG_MFD_TC6393XB
79 + gpio_free(TOSA_TC6393XB_L_MUTE);
83 module_init(tosa_init);