summaryrefslogtreecommitdiff
path: root/recipes/linux/linux-openmoko-2.6.32/0019-wm8753-use-snd_soc_jack-on-neo1973.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/linux/linux-openmoko-2.6.32/0019-wm8753-use-snd_soc_jack-on-neo1973.patch')
-rw-r--r--recipes/linux/linux-openmoko-2.6.32/0019-wm8753-use-snd_soc_jack-on-neo1973.patch97
1 files changed, 97 insertions, 0 deletions
diff --git a/recipes/linux/linux-openmoko-2.6.32/0019-wm8753-use-snd_soc_jack-on-neo1973.patch b/recipes/linux/linux-openmoko-2.6.32/0019-wm8753-use-snd_soc_jack-on-neo1973.patch
new file mode 100644
index 0000000000..c3e3d02231
--- /dev/null
+++ b/recipes/linux/linux-openmoko-2.6.32/0019-wm8753-use-snd_soc_jack-on-neo1973.patch
@@ -0,0 +1,97 @@
+From 261e2f00048ea8bfd5c261242c263e5a55401d64 Mon Sep 17 00:00:00 2001
+From: Lars-Peter Clausen <lars@metafoo.de>
+Date: Wed, 7 Jul 2010 15:29:33 +0200
+Subject: [PATCH 19/22] wm8753: use snd_soc_jack on neo1973
+
+---
+ sound/soc/s3c24xx/neo1973_wm8753.c | 46 ++++++++++++++++++++++++++++++++++++
+ 1 files changed, 46 insertions(+), 0 deletions(-)
+
+diff --git a/sound/soc/s3c24xx/neo1973_wm8753.c b/sound/soc/s3c24xx/neo1973_wm8753.c
+index 5cc1ef2..643dae3 100644
+--- a/sound/soc/s3c24xx/neo1973_wm8753.c
++++ b/sound/soc/s3c24xx/neo1973_wm8753.c
+@@ -23,6 +23,7 @@
+ #include <sound/pcm.h>
+ #include <sound/soc.h>
+ #include <sound/soc-dapm.h>
++#include <sound/jack.h>
+ #include <sound/tlv.h>
+
+ #include <asm/mach-types.h>
+@@ -38,6 +39,9 @@
+ #include "lm4857.h"
+ #include <linux/i2c.h>
+
++static struct snd_soc_card neo1973;
++static struct snd_soc_jack hs_jack;
++
+ #ifdef CONFIG_MACH_NEO1973_GTA01
+
+ static struct lm4857 {
+@@ -495,6 +499,29 @@ static const struct snd_kcontrol_new wm8753_neo1973_gta02_controls[] = {};
+ static const struct snd_soc_dapm_widget wm8753_dapm_widgets_gta02[] = {};
+ #endif
+
++static struct snd_soc_jack_pin hs_jack_pins[] = {
++ {
++ .pin = "Headset Mic",
++ .mask = SND_JACK_MICROPHONE,
++ },
++ {
++ .pin = "Stereo Out",
++ .mask = SND_JACK_HEADPHONE,
++ .invert = 1,
++ },
++};
++
++static struct snd_soc_jack_gpio hs_jack_gpios[] = {
++ {
++ .gpio = GTA02_GPIO_JACK_INSERT,
++ .name = "headset-gpio",
++ .report = SND_JACK_HEADSET,
++ .debounce_time = 100,
++ },
++};
++
++
++
+ static int neo1973_wm8753_init(struct snd_soc_codec *codec)
+ {
+ int err;
+@@ -566,6 +593,24 @@ static int neo1973_wm8753_init(struct snd_soc_codec *codec)
+
+ snd_soc_dapm_sync(codec);
+
++ err = snd_soc_jack_new(&neo1973, "Headset Jack", SND_JACK_HEADSET, &hs_jack);
++ if (err) {
++ dev_err(codec->card->dev, "failed to alloc headset jack\n");
++ return err;
++ }
++
++ err = snd_soc_jack_add_pins(&hs_jack, ARRAY_SIZE(hs_jack_pins), hs_jack_pins);
++ if (err) {
++ dev_err(codec->card->dev, "failed to add headset jack pins\n");
++ return err;
++ }
++
++ err = snd_soc_jack_add_gpios(&hs_jack, ARRAY_SIZE(hs_jack_gpios), hs_jack_gpios);
++ if (err) {
++ dev_err(codec->card->dev, "failed to add headset jack gpios\n");
++ return err;
++ }
++
+ return 0;
+ }
+
+@@ -740,6 +785,7 @@ static inline void neo1973_gta02_exit(void) {}
+ static void __exit neo1973_exit(void)
+ {
+ snd_soc_unregister_dai(&bt_dai);
++ snd_soc_jack_free_gpios(&hs_jack, ARRAY_SIZE(hs_jack_gpios), hs_jack_gpios);
+ platform_device_unregister(neo1973_snd_device);
+
+ if (machine_is_neo1973_gta01())
+--
+1.7.1.1
+