All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chen-Yu Tsai <wens@csie.org>
To: Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Maxime Ripard <maxime.ripard@free-electrons.com>,
	Lee Jones <lee.jones@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>
Cc: Chen-Yu Tsai <wens@csie.org>,
	alsa-devel@alsa-project.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	Mylene Josserand <mylene.josserand@free-electrons.com>
Subject: [PATCH 07/10] ARM: dts: sun8i-a23: q8-tablet: Enable internal audio codec
Date: Sat, 12 Nov 2016 14:46:45 +0800	[thread overview]
Message-ID: <20161112064648.26779-8-wens@csie.org> (raw)
In-Reply-To: <20161112064648.26779-1-wens@csie.org>

The A23 Q8 tablets have an internal mono speaker w/ external amp
which has a shutdown control tied to a GPIO pin. Both the speaker
amp and the headphone jack are tied to the HP output pins. While
the speaker is mono, the headset jack is stereo. Unfortunately
the driver does not support automatic switching of this.

In addition, the headset is DC coupled, or "direct drive" enabled.
The headset's microphone is tied to MIC2 with HBIAS providing power.
A separate internal microphone is tied to MIC1 with MBIAS providing
power.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm/boot/dts/sun8i-a23-q8-tablet.dts | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-a23-q8-tablet.dts b/arch/arm/boot/dts/sun8i-a23-q8-tablet.dts
index 956320a6cc78..3ab5c0c09d93 100644
--- a/arch/arm/boot/dts/sun8i-a23-q8-tablet.dts
+++ b/arch/arm/boot/dts/sun8i-a23-q8-tablet.dts
@@ -48,3 +48,26 @@
 	model = "Q8 A23 Tablet";
 	compatible = "allwinner,q8-a23", "allwinner,sun8i-a23";
 };
+
+&codec {
+	pinctrl-0 = <&codec_pa_pin>;
+	allwinner,pa-gpios = <&pio 7 9 GPIO_ACTIVE_HIGH>; /* PH9 */
+	allwinner,audio-routing =
+		"Headphone", "HP",
+		"Headphone", "HPCOM",
+		"Speaker", "HP",
+		"MIC1", "Mic",
+		"MIC2", "Headset Mic",
+		"Mic",  "MBIAS",
+		"Headset Mic", "HBIAS";
+	status = "okay";
+};
+
+&pio {
+	codec_pa_pin: codec_pa_pin@0 {
+		allwinner,pins = "PH9";
+		allwinner,function = "gpio_out";
+		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+	};
+};
-- 
2.10.2

WARNING: multiple messages have this Message-ID (diff)
From: wens@csie.org (Chen-Yu Tsai)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 07/10] ARM: dts: sun8i-a23: q8-tablet: Enable internal audio codec
Date: Sat, 12 Nov 2016 14:46:45 +0800	[thread overview]
Message-ID: <20161112064648.26779-8-wens@csie.org> (raw)
In-Reply-To: <20161112064648.26779-1-wens@csie.org>

The A23 Q8 tablets have an internal mono speaker w/ external amp
which has a shutdown control tied to a GPIO pin. Both the speaker
amp and the headphone jack are tied to the HP output pins. While
the speaker is mono, the headset jack is stereo. Unfortunately
the driver does not support automatic switching of this.

In addition, the headset is DC coupled, or "direct drive" enabled.
The headset's microphone is tied to MIC2 with HBIAS providing power.
A separate internal microphone is tied to MIC1 with MBIAS providing
power.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm/boot/dts/sun8i-a23-q8-tablet.dts | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-a23-q8-tablet.dts b/arch/arm/boot/dts/sun8i-a23-q8-tablet.dts
index 956320a6cc78..3ab5c0c09d93 100644
--- a/arch/arm/boot/dts/sun8i-a23-q8-tablet.dts
+++ b/arch/arm/boot/dts/sun8i-a23-q8-tablet.dts
@@ -48,3 +48,26 @@
 	model = "Q8 A23 Tablet";
 	compatible = "allwinner,q8-a23", "allwinner,sun8i-a23";
 };
+
+&codec {
+	pinctrl-0 = <&codec_pa_pin>;
+	allwinner,pa-gpios = <&pio 7 9 GPIO_ACTIVE_HIGH>; /* PH9 */
+	allwinner,audio-routing =
+		"Headphone", "HP",
+		"Headphone", "HPCOM",
+		"Speaker", "HP",
+		"MIC1", "Mic",
+		"MIC2", "Headset Mic",
+		"Mic",  "MBIAS",
+		"Headset Mic", "HBIAS";
+	status = "okay";
+};
+
+&pio {
+	codec_pa_pin: codec_pa_pin at 0 {
+		allwinner,pins = "PH9";
+		allwinner,function = "gpio_out";
+		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+	};
+};
-- 
2.10.2

  parent reply	other threads:[~2016-11-12  6:48 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-12  6:46 [PATCH 00/10] ASoC: sunxi: Add support for audio codec in A23/H3 SoCs Chen-Yu Tsai
2016-11-12  6:46 ` Chen-Yu Tsai
2016-11-12  6:46 ` [PATCH 01/10] ASoC: sunxi: Add bindings for A23/A33/H3 codec's analog path controls Chen-Yu Tsai
2016-11-12  6:46   ` Chen-Yu Tsai
2016-11-15 22:22   ` Rob Herring
2016-11-15 22:22     ` Rob Herring
2016-11-22 19:13   ` Applied "ASoC: sunxi: Add bindings for A23/A33/H3 codec's analog path controls" to the asoc tree Mark Brown
2016-11-22 19:13     ` Mark Brown
2016-11-22 19:13     ` Mark Brown
2016-11-12  6:46 ` [PATCH 02/10] ASoC: sunxi: Add support for A23/A33/H3 codec's analog path controls Chen-Yu Tsai
2016-11-12  6:46   ` Chen-Yu Tsai
2016-11-12  6:46   ` Chen-Yu Tsai
2016-11-22 19:13   ` Applied "ASoC: sunxi: Add support for A23/A33/H3 codec's analog path controls" to the asoc tree Mark Brown
2016-11-22 19:13     ` Mark Brown
2016-11-22 19:13     ` Mark Brown
2016-11-25  5:43   ` [PATCH 02/10] ASoC: sunxi: Add support for A23/A33/H3 codec's analog path controls Icenowy Zheng
2016-11-25  5:43     ` Icenowy Zheng
2016-11-25  5:45     ` Chen-Yu Tsai
2016-11-25  5:45       ` Chen-Yu Tsai
2016-11-25  5:45       ` Chen-Yu Tsai
2016-11-25  5:51       ` Icenowy Zheng
2016-11-25  5:51         ` Icenowy Zheng
2016-11-12  6:46 ` [PATCH 03/10] mfd: sun6i-prcm: Add codec analog controls sub-device for Allwinner A23 Chen-Yu Tsai
2016-11-12  6:46   ` Chen-Yu Tsai
2016-11-21 13:23   ` Lee Jones
2016-11-21 13:23     ` Lee Jones
2016-11-12  6:46 ` [PATCH 04/10] ASoC: sun4i-codec: Add support for A23 codec Chen-Yu Tsai
2016-11-12  6:46   ` Chen-Yu Tsai
2016-11-12  6:46   ` Chen-Yu Tsai
2016-11-15 22:23   ` Rob Herring
2016-11-15 22:23     ` Rob Herring
2016-11-30 18:07   ` Applied "ASoC: sun4i-codec: Add support for A23 codec" to the asoc tree Mark Brown
2016-11-30 18:07     ` Mark Brown
2016-11-30 18:07     ` Mark Brown
2016-11-12  6:46 ` [PATCH 05/10] ARM: dts: sun8i: Add codec analog path controls node in PRCM for A23/A33 Chen-Yu Tsai
2016-11-12  6:46   ` Chen-Yu Tsai
2016-11-12  6:46 ` [PATCH 06/10] ARM: dts: sun8i-a23: Add device node for internal audio codec Chen-Yu Tsai
2016-11-12  6:46   ` Chen-Yu Tsai
2016-11-12  6:46 ` Chen-Yu Tsai [this message]
2016-11-12  6:46   ` [PATCH 07/10] ARM: dts: sun8i-a23: q8-tablet: Enable " Chen-Yu Tsai
2016-11-12  6:46 ` [PATCH 08/10] ASoC: sun4i-codec: Add support for H3 codec Chen-Yu Tsai
2016-11-12  6:46   ` Chen-Yu Tsai
2016-11-12  6:46   ` Chen-Yu Tsai
2016-11-15 22:23   ` Rob Herring
2016-11-15 22:23     ` Rob Herring
2016-11-30 18:07   ` Applied "ASoC: sun4i-codec: Add support for H3 codec" to the asoc tree Mark Brown
2016-11-30 18:07     ` Mark Brown
2016-11-30 18:07     ` Mark Brown
2016-11-12  6:46 ` [PATCH 09/10] ARM: dts: sun8i-h3: Add device nodes for audio codec and its analog controls Chen-Yu Tsai
2016-11-12  6:46   ` Chen-Yu Tsai
2016-11-12  6:46 ` [PATCH 10/10] ARM: dts: sun8i-h3: orange-pi-pc: Enable audio codec Chen-Yu Tsai
2016-11-12  6:46   ` Chen-Yu Tsai
2016-11-12  6:46   ` Chen-Yu Tsai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161112064648.26779-8-wens@csie.org \
    --to=wens@csie.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=maxime.ripard@free-electrons.com \
    --cc=mylene.josserand@free-electrons.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.