linux-openmoko-2.6.32_git.bb: add a patch to make jack input events work
authorKlaus Kurzmann <mok@fluxnetz.de>
Wed, 30 Jun 2010 21:39:48 +0000 (23:39 +0200)
committerKlaus Kurzmann <mok@fluxnetz.de>
Wed, 30 Jun 2010 21:40:12 +0000 (23:40 +0200)
Signed-off-by: Klaus Kurzmann <mok@fluxnetz.de>
recipes/linux/linux-openmoko-2.6.32/hs-jack.patch [new file with mode: 0644]
recipes/linux/linux-openmoko-2.6.32_git.bb

diff --git a/recipes/linux/linux-openmoko-2.6.32/hs-jack.patch b/recipes/linux/linux-openmoko-2.6.32/hs-jack.patch
new file mode 100644 (file)
index 0000000..c92c3f6
--- /dev/null
@@ -0,0 +1,85 @@
+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())
index 56e8698..a44a715 100644 (file)
@@ -4,7 +4,7 @@ require linux-openmoko.inc
 KERNEL_RELEASE="2.6.32.13"
 
 SRCREV = "a9254be10ac2294ea20165a87c09ea6afcf66d94"
-OEV = "oe3.1"
+OEV = "oe3.2"
 PV = "${KERNEL_RELEASE}-${OEV}+gitr${SRCPV}"
 
 SRC_URI = "\
@@ -36,6 +36,8 @@ SRC_URI = "\
   file://touchscreen_ignoreunexpectedintr29.patch \
 # fix WS
   file://0001-glamo-core-initialize-engine-states-as-disabled.patch \
+# fix HS Jack
+  file://hs-jack.patch \
 "
 
 SRC_URI[stablepatch.md5sum] = "ba6abb1ffee513a1d4f831599ddae490"