All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4]  Add device tree support of audio codec (ALC5632) on PAZ00 board
@ 2012-02-02 20:13 Leon Romanovsky
       [not found] ` <1328213618-15870-1-git-send-email-leon-2ukJVAZIZ/Y@public.gmane.org>
  0 siblings, 1 reply; 15+ messages in thread
From: Leon Romanovsky @ 2012-02-02 20:13 UTC (permalink / raw)
  To: broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E,
	lrg-l0cyMroinI0, swarren-DDmLM1+adcrQT0dZR+AlfA,
	olof-nZhT3qVonbNeoWH0uzbU5w, alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA
  Cc: Leon Romanovsky

The following patchset is going to:
 * add device tree support of audio codec (ALC5632) on PAZ00 board.
 * enable headset autodetection via device tree.
 * enable headset microphone via device tree.
					 
Leon Romanovsky (4):
  ARM: dt: tegra: Enable device tree audio codec on PAZ00 board.
  ARM: dt: tegra: Enable headset autodetection on PAZ00 board.
  ASoC: Tegra+ALC5632: Enable headset autodetection on PAZ00 board.
  ASoC: tegra: Remove unused DAPM route structure.

 arch/arm/boot/dts/tegra-paz00.dts |   30 ++++++++++++++++----
 sound/soc/tegra/tegra_alc5632.c   |   55 +++++++++++++++++++++++-------------
 2 files changed, 59 insertions(+), 26 deletions(-)

---
Chages since v1:
 * Headset autodetection commit was split tp be two independant commits.
 * Main commit(enable device tree audio codec)  was forgotten in previous patchset.

-- 
1.7.3.4

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

* [PATCH v2 1/4] ARM: dt: tegra: Enable device tree audio codec on PAZ00 board.
       [not found] ` <1328213618-15870-1-git-send-email-leon-2ukJVAZIZ/Y@public.gmane.org>
@ 2012-02-02 20:13   ` Leon Romanovsky
  2012-02-02 20:40     ` Stephen Warren
       [not found]     ` <1328213618-15870-2-git-send-email-leon-2ukJVAZIZ/Y@public.gmane.org>
  2012-02-02 20:13   ` [PATCH v2 2/4] ARM: dt: tegra: Enable headset autodetection " Leon Romanovsky
                     ` (2 subsequent siblings)
  3 siblings, 2 replies; 15+ messages in thread
From: Leon Romanovsky @ 2012-02-02 20:13 UTC (permalink / raw)
  To: broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E,
	lrg-l0cyMroinI0, swarren-DDmLM1+adcrQT0dZR+AlfA,
	olof-nZhT3qVonbNeoWH0uzbU5w, alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA
  Cc: Leon Romanovsky, Marc Dietrich

This patch adds initial device tree support of ALC5632 sound codec and
machine driver for PAZ00 board. The implementation is based on the WM8903 codec.

Signed-off-by: Marc Dietrich <marvin24-Mmb7MZpHnFY@public.gmane.org>
Signed-off-by: Leon Romanovsky <leon-2ukJVAZIZ/Y@public.gmane.org>
---
 arch/arm/boot/dts/tegra-paz00.dts |   29 +++++++++++++++++++++++------
 1 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/tegra-paz00.dts b/arch/arm/boot/dts/tegra-paz00.dts
index 4d1bcdc..e6809b7 100644
--- a/arch/arm/boot/dts/tegra-paz00.dts
+++ b/arch/arm/boot/dts/tegra-paz00.dts
@@ -12,6 +12,13 @@
 
 	i2c@7000c000 {
 		clock-frequency = <400000>;
+
+		alc5632: alc5632@1e {
+			compatible = "realtek,alc5632";
+			reg = <0x1e>;
+			gpio-controller;
+			#gpio-cells = <2>;
+		};
 	};
 
 	i2c@7000c400 {
@@ -37,16 +44,26 @@
 		clock-frequency = <400000>;
 	};
 
-	i2s@70002800 {
-		status = "disable";
-	};
-
 	i2s@70002a00 {
 		status = "disable";
 	};
 
-	das@70000c00 {
-		status = "disable";
+	sound {
+		compatible = "nvidia,tegra-audio-alc5632-paz00",
+			"nvidia,tegra-audio-alc5632";
+
+		nvidia,model = "Compal PAZ00";
+
+		nvidia,audio-routing =
+			"Int Spk", "SPKOUT",
+			"Int Spk", "SPKOUTN",
+			"Headset Mic", "MICBIAS1",
+			"MIC1", "Headset Mic",
+			"Headset Stereophone", "HPR",
+			"Headset Stereophone", "HPL";
+
+		nvidia,audio-codec = <&alc5632>;
+		nvidia,i2s-controller = <&tegra_i2s1>;
 	};
 
 	serial@70006000 {
-- 
1.7.3.4

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

* [PATCH v2 2/4] ARM: dt: tegra: Enable headset autodetection on PAZ00 board.
       [not found] ` <1328213618-15870-1-git-send-email-leon-2ukJVAZIZ/Y@public.gmane.org>
  2012-02-02 20:13   ` [PATCH v2 1/4] ARM: dt: tegra: Enable device tree audio codec " Leon Romanovsky
@ 2012-02-02 20:13   ` Leon Romanovsky
       [not found]     ` <1328213618-15870-3-git-send-email-leon-2ukJVAZIZ/Y@public.gmane.org>
  2012-02-02 20:13   ` [PATCH v2 3/4] ASoC: Tegra+ALC5632: " Leon Romanovsky
  2012-02-02 20:13   ` [PATCH v2 4/4] ASoC: tegra: Remove unused DAPM route structure Leon Romanovsky
  3 siblings, 1 reply; 15+ messages in thread
From: Leon Romanovsky @ 2012-02-02 20:13 UTC (permalink / raw)
  To: broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E,
	lrg-l0cyMroinI0, swarren-DDmLM1+adcrQT0dZR+AlfA,
	olof-nZhT3qVonbNeoWH0uzbU5w, alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA
  Cc: Leon Romanovsky

This patch is adding device tree support of headset autodetection on PAZ00 board.

Signed-off-by: Leon Romanovsky <leon-2ukJVAZIZ/Y@public.gmane.org>
---
 arch/arm/boot/dts/tegra-paz00.dts |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/tegra-paz00.dts b/arch/arm/boot/dts/tegra-paz00.dts
index e6809b7..fa9dd9e 100644
--- a/arch/arm/boot/dts/tegra-paz00.dts
+++ b/arch/arm/boot/dts/tegra-paz00.dts
@@ -64,6 +64,7 @@
 
 		nvidia,audio-codec = <&alc5632>;
 		nvidia,i2s-controller = <&tegra_i2s1>;
+		nvidia,hp-det-gpios = <&gpio 178 0>; /* gpio PW2 */
 	};
 
 	serial@70006000 {
-- 
1.7.3.4

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

* [PATCH v2 3/4] ASoC: Tegra+ALC5632: Enable headset autodetection on PAZ00 board.
       [not found] ` <1328213618-15870-1-git-send-email-leon-2ukJVAZIZ/Y@public.gmane.org>
  2012-02-02 20:13   ` [PATCH v2 1/4] ARM: dt: tegra: Enable device tree audio codec " Leon Romanovsky
  2012-02-02 20:13   ` [PATCH v2 2/4] ARM: dt: tegra: Enable headset autodetection " Leon Romanovsky
@ 2012-02-02 20:13   ` Leon Romanovsky
  2012-02-02 22:44     ` Mark Brown
  2012-02-02 20:13   ` [PATCH v2 4/4] ASoC: tegra: Remove unused DAPM route structure Leon Romanovsky
  3 siblings, 1 reply; 15+ messages in thread
From: Leon Romanovsky @ 2012-02-02 20:13 UTC (permalink / raw)
  To: broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E,
	lrg-l0cyMroinI0, swarren-DDmLM1+adcrQT0dZR+AlfA,
	olof-nZhT3qVonbNeoWH0uzbU5w, alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA
  Cc: Leon Romanovsky

This patch is adding device tree support of headset autodetection on PAZ00 board.

Signed-off-by: Leon Romanovsky <leon-2ukJVAZIZ/Y@public.gmane.org>
---
 sound/soc/tegra/tegra_alc5632.c |   39 +++++++++++++++++++++++++++++++++++----
 1 files changed, 35 insertions(+), 4 deletions(-)

diff --git a/sound/soc/tegra/tegra_alc5632.c b/sound/soc/tegra/tegra_alc5632.c
index c0ba1e4..1794139 100644
--- a/sound/soc/tegra/tegra_alc5632.c
+++ b/sound/soc/tegra/tegra_alc5632.c
@@ -18,6 +18,7 @@
 #include <linux/platform_device.h>
 #include <linux/slab.h>
 #include <linux/gpio.h>
+#include <linux/of_gpio.h>
 
 #include <sound/core.h>
 #include <sound/jack.h>
@@ -34,9 +35,13 @@
 
 #define DRV_NAME "tegra-alc5632"
 
+#define GPIO_HP_DET     BIT(0)
+
 struct tegra_alc5632 {
 	struct tegra_asoc_utils_data util_data;
 	struct platform_device *pcm_dev;
+	int gpio_requested;
+	int gpio_hp_det;
 };
 
 static int tegra_alc5632_asoc_hw_params(struct snd_pcm_substream *substream,
@@ -86,6 +91,13 @@ static struct snd_soc_jack_pin tegra_alc5632_hs_jack_pins[] = {
 	},
 };
 
+static struct snd_soc_jack_gpio tegra_alc5632_hp_jack_gpio = {
+	.name = "Headset detection",
+	.report = SND_JACK_HEADSET,
+	.debounce_time = 150,
+	.invert = 1,
+};
+
 static const struct snd_soc_dapm_widget tegra_alc5632_dapm_widgets[] = {
 	SND_SOC_DAPM_SPK("Int Spk", NULL),
 	SND_SOC_DAPM_HP("Headset Stereophone", NULL),
@@ -114,6 +126,9 @@ static int tegra_alc5632_asoc_init(struct snd_soc_pcm_runtime *rtd)
 {
 	struct snd_soc_codec *codec = rtd->codec;
 	struct snd_soc_dapm_context *dapm = &codec->dapm;
+	struct device_node *np = codec->card->dev->of_node;
+	struct tegra_alc5632 *machine = snd_soc_card_get_drvdata(codec->card);
+	int ret;
 
 	snd_soc_jack_new(codec, "Headset Jack", SND_JACK_HEADSET,
 			 &tegra_alc5632_hs_jack);
@@ -121,6 +136,16 @@ static int tegra_alc5632_asoc_init(struct snd_soc_pcm_runtime *rtd)
 			ARRAY_SIZE(tegra_alc5632_hs_jack_pins),
 			tegra_alc5632_hs_jack_pins);
 
+	machine->gpio_hp_det = of_get_named_gpio(np, "nvidia,hp-det-gpios", 0);
+
+	if (gpio_is_valid(machine->gpio_hp_det)) {
+		tegra_alc5632_hp_jack_gpio.gpio = machine->gpio_hp_det;
+		snd_soc_jack_add_gpios(&tegra_alc5632_hs_jack,
+						1,
+						&tegra_alc5632_hp_jack_gpio);
+		machine->gpio_requested |= GPIO_HP_DET;
+	}
+
 	snd_soc_dapm_force_enable_pin(dapm, "MICBIAS1");
 
 	return 0;
@@ -239,13 +264,19 @@ err:
 static int __devexit tegra_alc5632_remove(struct platform_device *pdev)
 {
 	struct snd_soc_card *card = platform_get_drvdata(pdev);
-	struct tegra_alc5632 *alc5632 = snd_soc_card_get_drvdata(card);
+	struct tegra_alc5632 *machine = snd_soc_card_get_drvdata(card);
+
+	if (machine->gpio_requested & GPIO_HP_DET)
+		snd_soc_jack_free_gpios(&tegra_alc5632_hs_jack,
+					1,
+					&tegra_alc5632_hp_jack_gpio);
+	machine->gpio_requested = 0;
 
 	snd_soc_unregister_card(card);
 
-	tegra_asoc_utils_fini(&alc5632->util_data);
-	if (!IS_ERR(alc5632->pcm_dev))
-		platform_device_unregister(alc5632->pcm_dev);
+	tegra_asoc_utils_fini(&machine->util_data);
+	if (!IS_ERR(machine->pcm_dev))
+		platform_device_unregister(machine->pcm_dev);
 
 	return 0;
 }
-- 
1.7.3.4

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

* [PATCH v2 4/4] ASoC: tegra: Remove unused DAPM route structure.
       [not found] ` <1328213618-15870-1-git-send-email-leon-2ukJVAZIZ/Y@public.gmane.org>
                     ` (2 preceding siblings ...)
  2012-02-02 20:13   ` [PATCH v2 3/4] ASoC: Tegra+ALC5632: " Leon Romanovsky
@ 2012-02-02 20:13   ` Leon Romanovsky
       [not found]     ` <1328213618-15870-5-git-send-email-leon-2ukJVAZIZ/Y@public.gmane.org>
  3 siblings, 1 reply; 15+ messages in thread
From: Leon Romanovsky @ 2012-02-02 20:13 UTC (permalink / raw)
  To: broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E,
	lrg-l0cyMroinI0, swarren-DDmLM1+adcrQT0dZR+AlfA,
	olof-nZhT3qVonbNeoWH0uzbU5w, alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA
  Cc: Leon Romanovsky

All DAPM routes are configured via device tree, and there is no need in
DAPM route structures in board file.

Signed-off-by: Leon Romanovsky <leon-2ukJVAZIZ/Y@public.gmane.org>
---
 sound/soc/tegra/tegra_alc5632.c |   16 ----------------
 1 files changed, 0 insertions(+), 16 deletions(-)

diff --git a/sound/soc/tegra/tegra_alc5632.c b/sound/soc/tegra/tegra_alc5632.c
index 1794139..c000f51 100644
--- a/sound/soc/tegra/tegra_alc5632.c
+++ b/sound/soc/tegra/tegra_alc5632.c
@@ -104,20 +104,6 @@ static const struct snd_soc_dapm_widget tegra_alc5632_dapm_widgets[] = {
 	SND_SOC_DAPM_MIC("Headset Mic", NULL),
 };
 
-static const struct snd_soc_dapm_route tegra_alc5632_audio_map[] = {
-	/* Internal Speaker */
-	{"Int Spk", NULL, "SPKOUT"},
-	{"Int Spk", NULL, "SPKOUTN"},
-
-	/* Headset Mic */
-	{"MIC1", NULL, "MICBIAS1"},
-	{"MICBIAS1", NULL, "Headset Mic"},
-
-	/* Headset Stereophone */
-	{"Headset Stereophone", NULL, "HPR"},
-	{"Headset Stereophone", NULL, "HPL"},
-};
-
 static const struct snd_kcontrol_new tegra_alc5632_controls[] = {
 	SOC_DAPM_PIN_SWITCH("Int Spk"),
 };
@@ -172,8 +158,6 @@ static struct snd_soc_card snd_soc_tegra_alc5632 = {
 	.num_controls = ARRAY_SIZE(tegra_alc5632_controls),
 	.dapm_widgets = tegra_alc5632_dapm_widgets,
 	.num_dapm_widgets = ARRAY_SIZE(tegra_alc5632_dapm_widgets),
-	.dapm_routes = tegra_alc5632_audio_map,
-	.num_dapm_routes = ARRAY_SIZE(tegra_alc5632_audio_map),
 	.fully_routed = true,
 };
 
-- 
1.7.3.4

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

* Re: [PATCH v2 1/4] ARM: dt: tegra: Enable device tree audio codec on PAZ00 board.
  2012-02-02 20:13   ` [PATCH v2 1/4] ARM: dt: tegra: Enable device tree audio codec " Leon Romanovsky
@ 2012-02-02 20:40     ` Stephen Warren
       [not found]     ` <1328213618-15870-2-git-send-email-leon-2ukJVAZIZ/Y@public.gmane.org>
  1 sibling, 0 replies; 15+ messages in thread
From: Stephen Warren @ 2012-02-02 20:40 UTC (permalink / raw)
  To: Leon Romanovsky, broonie, lrg, olof, alsa-devel, linux-tegra
  Cc: Marc Dietrich

Leon Romanovsky wrote at Thursday, February 02, 2012 1:14 PM:
> This patch adds initial device tree support of ALC5632 sound codec and
> machine driver for PAZ00 board. The implementation is based on the WM8903 codec.

This patch description seems a little unclear, since this is just adding
the .dts changes to instantiate the drivers that already support DT, and
mentioning WM8903 is a little confusing, since that's more relevant to
the commit where you wrote the binding docs and implemented the driver
changes.

Aside from that, the series,

Acked-by: Stephen Warren <swarren@nvidia.com>

-- 
nvpublic

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

* Re: [PATCH v2 1/4] ARM: dt: tegra: Enable device tree audio codec on PAZ00 board.
       [not found]     ` <1328213618-15870-2-git-send-email-leon-2ukJVAZIZ/Y@public.gmane.org>
@ 2012-02-02 22:29       ` Mark Brown
  0 siblings, 0 replies; 15+ messages in thread
From: Mark Brown @ 2012-02-02 22:29 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: lrg-l0cyMroinI0, swarren-DDmLM1+adcrQT0dZR+AlfA,
	olof-nZhT3qVonbNeoWH0uzbU5w, alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA, Marc Dietrich

[-- Attachment #1: Type: text/plain, Size: 475 bytes --]

On Thu, Feb 02, 2012 at 10:13:35PM +0200, Leon Romanovsky wrote:
> This patch adds initial device tree support of ALC5632 sound codec and
> machine driver for PAZ00 board. The implementation is based on the WM8903 codec.

Reviewed-by: Mark Brown <broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>

No direct dependencies on any ASoC stuff so I guess it's easier if this
goes via the Tegra tree.  I'm happy to apply it to ASoC if people would
prefer that.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH v2 2/4] ARM: dt: tegra: Enable headset autodetection on PAZ00 board.
       [not found]     ` <1328213618-15870-3-git-send-email-leon-2ukJVAZIZ/Y@public.gmane.org>
@ 2012-02-02 22:42       ` Mark Brown
       [not found]         ` <20120202224224.GC3112-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
  0 siblings, 1 reply; 15+ messages in thread
From: Mark Brown @ 2012-02-02 22:42 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: lrg-l0cyMroinI0, swarren-DDmLM1+adcrQT0dZR+AlfA,
	olof-nZhT3qVonbNeoWH0uzbU5w, alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 398 bytes --]

On Thu, Feb 02, 2012 at 10:13:36PM +0200, Leon Romanovsky wrote:
> This patch is adding device tree support of headset autodetection on PAZ00 board.
> 
> Signed-off-by: Leon Romanovsky <leon-2ukJVAZIZ/Y@public.gmane.org>

Reviewed-by: Mark Brown <broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>

Same as the last patch - happy to merge via ASoC if people prefer that.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH v2 3/4] ASoC: Tegra+ALC5632: Enable headset autodetection on PAZ00 board.
  2012-02-02 20:13   ` [PATCH v2 3/4] ASoC: Tegra+ALC5632: " Leon Romanovsky
@ 2012-02-02 22:44     ` Mark Brown
       [not found]       ` <20120202224355.GD3112-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
  0 siblings, 1 reply; 15+ messages in thread
From: Mark Brown @ 2012-02-02 22:44 UTC (permalink / raw)
  To: Leon Romanovsky; +Cc: olof, linux-tegra, alsa-devel, swarren, lrg


[-- Attachment #1.1: Type: text/plain, Size: 328 bytes --]

On Thu, Feb 02, 2012 at 10:13:37PM +0200, Leon Romanovsky wrote:
> This patch is adding device tree support of headset autodetection on PAZ00 board.

Applied, thanks.  I wonder if we ought to have a standard binding for
GPIO based headset detect...  can be tricky, though, when it gets
integrated with more advanced mechanisms.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

* Re: [PATCH v2 4/4] ASoC: tegra: Remove unused DAPM route structure.
       [not found]     ` <1328213618-15870-5-git-send-email-leon-2ukJVAZIZ/Y@public.gmane.org>
@ 2012-02-02 22:44       ` Mark Brown
  0 siblings, 0 replies; 15+ messages in thread
From: Mark Brown @ 2012-02-02 22:44 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: lrg-l0cyMroinI0, swarren-DDmLM1+adcrQT0dZR+AlfA,
	olof-nZhT3qVonbNeoWH0uzbU5w, alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 196 bytes --]

On Thu, Feb 02, 2012 at 10:13:38PM +0200, Leon Romanovsky wrote:
> All DAPM routes are configured via device tree, and there is no need in
> DAPM route structures in board file.

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [alsa-devel] [PATCH v2 3/4] ASoC: Tegra+ALC5632: Enable headsetautodetection on PAZ00 board.
       [not found]       ` <20120202224355.GD3112-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
@ 2012-02-03 10:24         ` Marc Dietrich
  0 siblings, 0 replies; 15+ messages in thread
From: Marc Dietrich @ 2012-02-03 10:24 UTC (permalink / raw)
  To: alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw
  Cc: Mark Brown, Leon Romanovsky, olof-nZhT3qVonbNeoWH0uzbU5w,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	swarren-DDmLM1+adcrQT0dZR+AlfA, lrg-l0cyMroinI0

On Thursday 02 February 2012 22:44:02 Mark Brown wrote:
> On Thu, Feb 02, 2012 at 10:13:37PM +0200, Leon Romanovsky wrote:
> > This patch is adding device tree support of headset autodetection on
> > PAZ00 board.
> Applied, thanks.  I wonder if we ought to have a standard binding for
> GPIO based headset detect...  can be tricky, though, when it gets
> integrated with more advanced mechanisms.

arrr, I was too slow. Small nit below.

> diff --git a/sound/soc/tegra/tegra_alc5632.c
> b/sound/soc/tegra/tegra_alc5632.c index c0ba1e4..1794139 100644
> --- a/sound/soc/tegra/tegra_alc5632.c
> +++ b/sound/soc/tegra/tegra_alc5632.c
> @@ -18,6 +18,7 @@
> 
>  #include <linux/platform_device.h>
>  #include <linux/slab.h>
>  #include <linux/gpio.h>
> 
> +#include <linux/of_gpio.h>
> 
>  #include <sound/core.h>
>  #include <sound/jack.h>
> 
> @@ -34,9 +35,13 @@
> 
>  #define DRV_NAME "tegra-alc5632"
> 
> +#define GPIO_HP_DET     BIT(0)
> +
> 
>  struct tegra_alc5632 {
>  
>         struct tegra_asoc_utils_data util_data;
>         struct platform_device *pcm_dev;
> 
> +       int gpio_requested;
> +       int gpio_hp_det;
> 
>  };
>  
>  static int tegra_alc5632_asoc_hw_params(struct snd_pcm_substream
>  *substream,> 
> @@ -86,6 +91,13 @@ static struct snd_soc_jack_pin
> tegra_alc5632_hs_jack_pins[] = {> 
>         },
>  
>  };
> 
> +static struct snd_soc_jack_gpio tegra_alc5632_hp_jack_gpio = {
> +       .name = "Headset detection",
> +       .report = SND_JACK_HEADSET,
> +       .debounce_time = 150,
> +       .invert = 1,
> +};
> +
> 
>  static const struct snd_soc_dapm_widget tegra_alc5632_dapm_widgets[] = {
>  
>         SND_SOC_DAPM_SPK("Int Spk", NULL),
>         SND_SOC_DAPM_HP("Headset Stereophone", NULL),
> 
> @@ -114,6 +126,9 @@ static int tegra_alc5632_asoc_init(struct
> snd_soc_pcm_runtime *rtd)> 
>  {
>  
>         struct snd_soc_codec *codec = rtd->codec;
>         struct snd_soc_dapm_context *dapm = &codec->dapm;
> 
> +       struct device_node *np = codec->card->dev->of_node;
> +       struct tegra_alc5632 *machine =
> snd_soc_card_get_drvdata(codec->card); 
> +       int ret;

This one isn't used, but non critical (just creates a warning).

Marc

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

* Re: [PATCH v2 2/4] ARM: dt: tegra: Enable headset autodetection on PAZ00 board.
       [not found]         ` <20120202224224.GC3112-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
@ 2012-02-03 21:44           ` Leon Romanovsky
       [not found]             ` <CALq1K=+XgD71uAXqXMFhD35u+v_v6yv1mXsxkd4o2MA_rbkVqg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 15+ messages in thread
From: Leon Romanovsky @ 2012-02-03 21:44 UTC (permalink / raw)
  To: Mark Brown
  Cc: lrg-l0cyMroinI0, swarren-DDmLM1+adcrQT0dZR+AlfA,
	olof-nZhT3qVonbNeoWH0uzbU5w, alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA

On Fri, Feb 3, 2012 at 00:42, Mark Brown
<broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org> wrote:
>
> On Thu, Feb 02, 2012 at 10:13:36PM +0200, Leon Romanovsky wrote:
> > This patch is adding device tree support of headset autodetection on PAZ00 board.
> >
> > Signed-off-by: Leon Romanovsky <leon-2ukJVAZIZ/Y@public.gmane.org>
>
> Reviewed-by: Mark Brown <broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
>
> Same as the last patch - happy to merge via ASoC if people prefer that.

Mark,
I think for dts changes the tegra tree is a better place.


--
Leon Romanovsky | Independent Linux Consultant
        www.leon.nu | leon-2ukJVAZIZ/Y@public.gmane.org

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

* Re: [PATCH v2 2/4] ARM: dt: tegra: Enable headset autodetection on PAZ00 board.
       [not found]             ` <CALq1K=+XgD71uAXqXMFhD35u+v_v6yv1mXsxkd4o2MA_rbkVqg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2012-02-07  2:06               ` Olof Johansson
       [not found]                 ` <20120207020622.GA12233-O5ziIzlqnXUVNXGz7ipsyg@public.gmane.org>
  0 siblings, 1 reply; 15+ messages in thread
From: Olof Johansson @ 2012-02-07  2:06 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Mark Brown, lrg-l0cyMroinI0, swarren-DDmLM1+adcrQT0dZR+AlfA,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA

On Fri, Feb 03, 2012 at 11:44:00PM +0200, Leon Romanovsky wrote:
> On Fri, Feb 3, 2012 at 00:42, Mark Brown
> <broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org> wrote:
> >
> > On Thu, Feb 02, 2012 at 10:13:36PM +0200, Leon Romanovsky wrote:
> > > This patch is adding device tree support of headset autodetection on PAZ00 board.
> > >
> > > Signed-off-by: Leon Romanovsky <leon-2ukJVAZIZ/Y@public.gmane.org>
> >
> > Reviewed-by: Mark Brown <broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
> >
> > Same as the last patch - happy to merge via ASoC if people prefer that.
> 
> Mark,
> I think for dts changes the tegra tree is a better place.

Ok, applying the series to the tegra tree. Thanks!

-Olof

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

* Re: [PATCH v2 2/4] ARM: dt: tegra: Enable headset autodetection on PAZ00 board.
       [not found]                 ` <20120207020622.GA12233-O5ziIzlqnXUVNXGz7ipsyg@public.gmane.org>
@ 2012-02-07  2:09                   ` Olof Johansson
       [not found]                     ` <CAOesGMg2TWELqca3tsOAPLwq0hw4_UgE_U6C6MQq6yR7=bpgjw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 15+ messages in thread
From: Olof Johansson @ 2012-02-07  2:09 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Mark Brown, lrg-l0cyMroinI0, swarren-DDmLM1+adcrQT0dZR+AlfA,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA

On Mon, Feb 6, 2012 at 6:06 PM, Olof Johansson <olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org> wrote:
> On Fri, Feb 03, 2012 at 11:44:00PM +0200, Leon Romanovsky wrote:
>> On Fri, Feb 3, 2012 at 00:42, Mark Brown
>> <broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org> wrote:
>> >
>> > On Thu, Feb 02, 2012 at 10:13:36PM +0200, Leon Romanovsky wrote:
>> > > This patch is adding device tree support of headset autodetection on PAZ00 board.
>> > >
>> > > Signed-off-by: Leon Romanovsky <leon-2ukJVAZIZ/Y@public.gmane.org>
>> >
>> > Reviewed-by: Mark Brown <broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
>> >
>> > Same as the last patch - happy to merge via ASoC if people prefer that.
>>
>> Mark,
>> I think for dts changes the tegra tree is a better place.
>
> Ok, applying the series to the tegra tree. Thanks!

Uh, and with "series", I of course mean only the first two patches. :)


-Olof

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

* Re: [PATCH v2 2/4] ARM: dt: tegra: Enable headset autodetection on PAZ00 board.
       [not found]                     ` <CAOesGMg2TWELqca3tsOAPLwq0hw4_UgE_U6C6MQq6yR7=bpgjw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2012-02-07  6:37                       ` Leon Romanovsky
  0 siblings, 0 replies; 15+ messages in thread
From: Leon Romanovsky @ 2012-02-07  6:37 UTC (permalink / raw)
  To: Olof Johansson
  Cc: Mark Brown, lrg-l0cyMroinI0, swarren-DDmLM1+adcrQT0dZR+AlfA,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA

On Tue, Feb 7, 2012 at 04:09, Olof Johansson <olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org> wrote:
>
> On Mon, Feb 6, 2012 at 6:06 PM, Olof Johansson <olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org> wrote:
> > On Fri, Feb 03, 2012 at 11:44:00PM +0200, Leon Romanovsky wrote:
> >> On Fri, Feb 3, 2012 at 00:42, Mark Brown
> >> <broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org> wrote:
> >> >
> >> > On Thu, Feb 02, 2012 at 10:13:36PM +0200, Leon Romanovsky wrote:
> >> > > This patch is adding device tree support of headset autodetection on PAZ00 board.
> >> > >
> >> > > Signed-off-by: Leon Romanovsky <leon-2ukJVAZIZ/Y@public.gmane.org>
> >> >
> >> > Reviewed-by: Mark Brown <broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
> >> >
> >> > Same as the last patch - happy to merge via ASoC if people prefer that.
> >>
> >> Mark,
> >> I think for dts changes the tegra tree is a better place.
> >
> > Ok, applying the series to the tegra tree. Thanks!
>
> Uh, and with "series", I of course mean only the first two patches. :)
>
>
> -Olof

Thanks.


--
Leon Romanovsky | Independent Linux Consultant
        www.leon.nu | leon-2ukJVAZIZ/Y@public.gmane.org

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

end of thread, other threads:[~2012-02-07  6:37 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-02 20:13 [PATCH v2 0/4] Add device tree support of audio codec (ALC5632) on PAZ00 board Leon Romanovsky
     [not found] ` <1328213618-15870-1-git-send-email-leon-2ukJVAZIZ/Y@public.gmane.org>
2012-02-02 20:13   ` [PATCH v2 1/4] ARM: dt: tegra: Enable device tree audio codec " Leon Romanovsky
2012-02-02 20:40     ` Stephen Warren
     [not found]     ` <1328213618-15870-2-git-send-email-leon-2ukJVAZIZ/Y@public.gmane.org>
2012-02-02 22:29       ` Mark Brown
2012-02-02 20:13   ` [PATCH v2 2/4] ARM: dt: tegra: Enable headset autodetection " Leon Romanovsky
     [not found]     ` <1328213618-15870-3-git-send-email-leon-2ukJVAZIZ/Y@public.gmane.org>
2012-02-02 22:42       ` Mark Brown
     [not found]         ` <20120202224224.GC3112-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2012-02-03 21:44           ` Leon Romanovsky
     [not found]             ` <CALq1K=+XgD71uAXqXMFhD35u+v_v6yv1mXsxkd4o2MA_rbkVqg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-07  2:06               ` Olof Johansson
     [not found]                 ` <20120207020622.GA12233-O5ziIzlqnXUVNXGz7ipsyg@public.gmane.org>
2012-02-07  2:09                   ` Olof Johansson
     [not found]                     ` <CAOesGMg2TWELqca3tsOAPLwq0hw4_UgE_U6C6MQq6yR7=bpgjw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-07  6:37                       ` Leon Romanovsky
2012-02-02 20:13   ` [PATCH v2 3/4] ASoC: Tegra+ALC5632: " Leon Romanovsky
2012-02-02 22:44     ` Mark Brown
     [not found]       ` <20120202224355.GD3112-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2012-02-03 10:24         ` [alsa-devel] [PATCH v2 3/4] ASoC: Tegra+ALC5632: Enable headsetautodetection " Marc Dietrich
2012-02-02 20:13   ` [PATCH v2 4/4] ASoC: tegra: Remove unused DAPM route structure Leon Romanovsky
     [not found]     ` <1328213618-15870-5-git-send-email-leon-2ukJVAZIZ/Y@public.gmane.org>
2012-02-02 22:44       ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.