diff options
Diffstat (limited to 'recipes/kexecboot/linux-kexecboot-2.6.24/tosa/0051-fix-sound-soc-pxa-tosa.c-to-new-gpio-api.patch')
-rw-r--r-- | recipes/kexecboot/linux-kexecboot-2.6.24/tosa/0051-fix-sound-soc-pxa-tosa.c-to-new-gpio-api.patch | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.24/tosa/0051-fix-sound-soc-pxa-tosa.c-to-new-gpio-api.patch b/recipes/kexecboot/linux-kexecboot-2.6.24/tosa/0051-fix-sound-soc-pxa-tosa.c-to-new-gpio-api.patch new file mode 100644 index 0000000000..585f1af288 --- /dev/null +++ b/recipes/kexecboot/linux-kexecboot-2.6.24/tosa/0051-fix-sound-soc-pxa-tosa.c-to-new-gpio-api.patch @@ -0,0 +1,86 @@ +From 38ef1b452cc3138157b92d02b31cad439d12d0ca Mon Sep 17 00:00:00 2001 +From: Dmitry Baryshkov <dbaryshkov@gmail.com> +Date: Wed, 9 Jan 2008 02:03:34 +0300 +Subject: [PATCH 51/64] fix sound/soc/pxa/tosa.c to new gpio api + +Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com> +--- + sound/soc/pxa/tosa.c | 33 ++++++++++++++++++++++++++------- + 1 files changed, 26 insertions(+), 7 deletions(-) + +diff --git a/sound/soc/pxa/tosa.c b/sound/soc/pxa/tosa.c +index 21c51b5..b758de8 100644 +--- a/sound/soc/pxa/tosa.c ++++ b/sound/soc/pxa/tosa.c +@@ -36,6 +36,7 @@ + #include <asm/arch/hardware.h> + #include <asm/arch/audio.h> + #include <asm/arch/tosa.h> ++#include <asm/gpio.h> + + #include "../codecs/wm9712.h" + #include "pxa2xx-pcm.h" +@@ -137,11 +138,11 @@ static int tosa_set_spk(struct snd_kcontrol *kcontrol, + /* tosa dapm event handlers */ + static int tosa_hp_event(struct snd_soc_dapm_widget *w, int event) + { +-#if 0 ++#ifdef CONFIG_MFD_TC6393XB + if (SND_SOC_DAPM_EVENT_ON(event)) +- set_tc6393_gpio(&tc6393_device.dev,TOSA_TC6393_L_MUTE); ++ gpio_set_value(TOSA_TC6393XB_L_MUTE, 1); + else +- reset_tc6393_gpio(&tc6393_device.dev,TOSA_TC6393_L_MUTE); ++ gpio_set_value(TOSA_TC6393XB_L_MUTE, 0); + #endif + return 0; + } +@@ -262,16 +263,31 @@ static int __init tosa_init(void) + if (!machine_is_tosa()) + return -ENODEV; + ++#ifdef CONFIG_MFD_TC6393XB ++ ret = gpio_request(TOSA_TC6393XB_L_MUTE, "Headphone Jack"); ++ if (ret) ++ return ret; ++ gpio_direction_output(TOSA_TC6393XB_L_MUTE, 0); ++#endif + tosa_snd_device = platform_device_alloc("soc-audio", -1); +- if (!tosa_snd_device) +- return -ENOMEM; ++ if (!tosa_snd_device) { ++ ret = -ENOMEM; ++ goto err_alloc; ++ } + + platform_set_drvdata(tosa_snd_device, &tosa_snd_devdata); + tosa_snd_devdata.dev = &tosa_snd_device->dev; + ret = platform_device_add(tosa_snd_device); + +- if (ret) +- platform_device_put(tosa_snd_device); ++ if (!ret) ++ return 0; ++ ++ platform_device_put(tosa_snd_device); ++ ++err_alloc: ++#ifdef CONFIG_MFD_TC6393XB ++ gpio_free(TOSA_TC6393XB_L_MUTE); ++#endif + + return ret; + } +@@ -279,6 +295,9 @@ static int __init tosa_init(void) + static void __exit tosa_exit(void) + { + platform_device_unregister(tosa_snd_device); ++#ifdef CONFIG_MFD_TC6393XB ++ gpio_free(TOSA_TC6393XB_L_MUTE); ++#endif + } + + module_init(tosa_init); +-- +1.5.3.8 + |