alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/6] ASoC: Tegra: Harmony: Add headphone jack detection
@ 2011-02-03 20:56 Stephen Warren
  2011-02-03 20:56 ` [PATCH 2/6] ASoC: Tegra: Harmony: Add switch control for speaker Stephen Warren
                   ` (5 more replies)
  0 siblings, 6 replies; 26+ messages in thread
From: Stephen Warren @ 2011-02-03 20:56 UTC (permalink / raw)
  To: broonie, lrg; +Cc: linux-tegra, alsa-devel, Stephen Warren

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 sound/soc/tegra/harmony.c |   30 +++++++++++++++++++++++++++++-
 1 files changed, 29 insertions(+), 1 deletions(-)

diff --git a/sound/soc/tegra/harmony.c b/sound/soc/tegra/harmony.c
index 1b80c4f..26ab4fd 100644
--- a/sound/soc/tegra/harmony.c
+++ b/sound/soc/tegra/harmony.c
@@ -38,6 +38,7 @@
 #include <mach/harmony_audio.h>
 
 #include <sound/core.h>
+#include <sound/jack.h>
 #include <sound/pcm.h>
 #include <sound/pcm_params.h>
 #include <sound/soc.h>
@@ -123,6 +124,24 @@ static struct snd_soc_ops harmony_asoc_ops = {
 	.hw_params = harmony_asoc_hw_params,
 };
 
+static struct snd_soc_jack harmony_hp_jack;
+
+static struct snd_soc_jack_pin harmony_hp_jack_pins[] = {
+	{
+		.pin = "Headphone Jack",
+		.mask = SND_JACK_HEADPHONE,
+	},
+};
+
+static struct snd_soc_jack_gpio harmony_hp_jack_gpios[] = {
+	{
+		.name = "headphone detect",
+		.report = SND_JACK_HEADPHONE,
+		.debounce_time = 150,
+		.invert = 1,
+	}
+};
+
 static int harmony_event_int_spk(struct snd_soc_dapm_widget *w,
 					struct snd_kcontrol *k, int event)
 {
@@ -178,11 +197,20 @@ static int harmony_asoc_init(struct snd_soc_pcm_runtime *rtd)
 	snd_soc_dapm_add_routes(dapm, harmony_audio_map,
 				ARRAY_SIZE(harmony_audio_map));
 
-	snd_soc_dapm_enable_pin(dapm, "Headphone Jack");
 	snd_soc_dapm_enable_pin(dapm, "Int Spk");
 	snd_soc_dapm_enable_pin(dapm, "Mic Jack");
 	snd_soc_dapm_sync(dapm);
 
+	harmony_hp_jack_gpios[0].gpio = pdata->gpio_hp_det;
+	snd_soc_jack_new(codec, "Headphone Jack", SND_JACK_HEADPHONE,
+			 &harmony_hp_jack);
+	snd_soc_jack_add_pins(&harmony_hp_jack,
+			      ARRAY_SIZE(harmony_hp_jack_pins),
+			      harmony_hp_jack_pins);
+	snd_soc_jack_add_gpios(&harmony_hp_jack,
+			       ARRAY_SIZE(harmony_hp_jack_gpios),
+			       harmony_hp_jack_gpios);
+
 	return 0;
 }
 
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2011-02-09 12:15 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-03 20:56 [PATCH 1/6] ASoC: Tegra: Harmony: Add headphone jack detection Stephen Warren
2011-02-03 20:56 ` [PATCH 2/6] ASoC: Tegra: Harmony: Add switch control for speaker Stephen Warren
     [not found]   ` <1296766578-13988-2-git-send-email-swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-02-04 14:46     ` Mark Brown
2011-02-09 12:11     ` [alsa-devel] " Mark Brown
2011-02-03 20:56 ` [PATCH 3/6] ASoC: WM8903: Fix mic detection issues Stephen Warren
     [not found]   ` <1296766578-13988-3-git-send-email-swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-02-03 22:38     ` Mark Brown
2011-02-03 20:56 ` [PATCH 4/6] ASoC: Tegra: Harmony: Implement mic detection Stephen Warren
     [not found]   ` <1296766578-13988-4-git-send-email-swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-02-03 22:40     ` Mark Brown
2011-02-03 20:56 ` [PATCH 5/6] ASoC: Harmony: Call snd_soc_dapm_nc_pin Stephen Warren
     [not found]   ` <1296766578-13988-5-git-send-email-swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-02-04 14:46     ` Mark Brown
2011-02-03 20:56 ` [PATCH 6/6] ASoC: Tegra: Harmony: Support both int and ext mics Stephen Warren
2011-02-03 22:52   ` Mark Brown
     [not found]     ` <20110203225235.GD4586-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2011-02-04 17:20       ` Stephen Warren
     [not found]         ` <74CDBE0F657A3D45AFBB94109FB122FF0310C8EB68-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2011-02-07 11:13           ` [alsa-devel] " Mark Brown
     [not found]             ` <20110207111310.GA31475-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2011-02-08 20:34               ` Stephen Warren
     [not found]                 ` <74CDBE0F657A3D45AFBB94109FB122FF0310F5FFAC-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2011-02-08 20:58                   ` Mark Brown
     [not found]                     ` <20110208205848.GA23844-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2011-02-08 23:32                       ` Stephen Warren
     [not found]                         ` <74CDBE0F657A3D45AFBB94109FB122FF0310F60084-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2011-02-09 12:15                           ` Mark Brown
     [not found] ` <1296766578-13988-1-git-send-email-swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-02-03 22:35   ` [PATCH 1/6] ASoC: Tegra: Harmony: Add headphone jack detection Mark Brown
     [not found]     ` <20110203223530.GA4586-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2011-02-03 23:25       ` Stephen Warren
2011-02-04 14:47         ` Mark Brown
     [not found]         ` <74CDBE0F657A3D45AFBB94109FB122FF0310C8EA93-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2011-02-04 20:32           ` Stephen Warren
     [not found]             ` <74CDBE0F657A3D45AFBB94109FB122FF0310F5FB00-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2011-02-08 20:28               ` [alsa-devel] " Stephen Warren
     [not found]                 ` <74CDBE0F657A3D45AFBB94109FB122FF0310F5FFA5-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2011-02-08 20:59                   ` Mark Brown
     [not found]                     ` <20110208205917.GB23844-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2011-02-08 21:56                       ` Liam Girdwood
2011-02-09 12:11   ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).