Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1402434 > unrolled thread

[PATCH 0/6] ARM: dts: sun5i: q8-common: Enable various peripherals

Started byChen-Yu Tsai <wens@csie.org>
First post2016-05-17 18:00 +0200
Last post2016-05-25 14:50 +0200
Articles 12 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/6] ARM: dts: sun5i: q8-common: Enable various peripherals Chen-Yu Tsai <wens@csie.org> - 2016-05-17 18:00 +0200
    [PATCH 6/6] ARM: dts: sun5i: q8-common: Enable display pipeline and LCD display Chen-Yu Tsai <wens@csie.org> - 2016-05-17 18:00 +0200
      Re: [PATCH 6/6] ARM: dts: sun5i: q8-common: Enable display pipeline  and LCD display Maxime Ripard <maxime.ripard@free-electrons.com> - 2016-05-25 14:50 +0200
    [PATCH 5/6] ARM: dts: sun5i: q8-common: Enable audio codec Chen-Yu Tsai <wens@csie.org> - 2016-05-17 18:00 +0200
      Re: [PATCH 5/6] ARM: dts: sun5i: q8-common: Enable audio codec Maxime Ripard <maxime.ripard@free-electrons.com> - 2016-05-25 14:50 +0200
    [PATCH 1/6] drm: sun4i: do cleanup if RGB output init fails Chen-Yu Tsai <wens@csie.org> - 2016-05-17 18:00 +0200
      Re: [PATCH 1/6] drm: sun4i: do cleanup if RGB output init fails Maxime Ripard <maxime.ripard@free-electrons.com> - 2016-05-25 14:40 +0200
    [PATCH 3/6] ARM: dts: sun5i: q8-common: Enable USB-based WiFi Chen-Yu Tsai <wens@csie.org> - 2016-05-17 18:00 +0200
    [PATCH 2/6] ARM: dts: axp209: Disable ldo5 by default Chen-Yu Tsai <wens@csie.org> - 2016-05-17 18:00 +0200
      Re: [PATCH 2/6] ARM: dts: axp209: Disable ldo5 by default Maxime Ripard <maxime.ripard@free-electrons.com> - 2016-05-25 14:40 +0200
    Re: [PATCH 0/6] ARM: dts: sun5i: q8-common: Enable various  peripherals Hans de Goede <hdegoede@redhat.com> - 2016-05-18 10:20 +0200
      Re: [PATCH 0/6] ARM: dts: sun5i: q8-common: Enable various  peripherals Maxime Ripard <maxime.ripard@free-electrons.com> - 2016-05-25 14:50 +0200

#1402434 — [PATCH 0/6] ARM: dts: sun5i: q8-common: Enable various peripherals

FromChen-Yu Tsai <wens@csie.org>
Date2016-05-17 18:00 +0200
Subject[PATCH 0/6] ARM: dts: sun5i: q8-common: Enable various peripherals
Message-ID<rzPzz-6rL-15@gated-at.bofh.it>
Hi everyone,

This series enables more peripherals for Allwinner A13-based Q8 devices.
The peripherals include the WiFi, the PMIC's micro-usb power supply
(driver), audio codec (headphone and speaker), and full display support
with the new DRM KMS driver. The series is based on parts of Maxime's
"drm: Add Support for Passive RGB to VGA bridges" series, specifically
the clk and drm fixes, and common DTS bits.

Hans, since you have a collection of q8 tablets, I'm hoping you could
test these bits and provide some feedback.


Patch 1 is a small fix for part of the init failure path.

Patch 2 disables ldo5 on the axp209 by default. This regulator output is
muxed with a gpio, and the regulator on/off settings override the gpio.

Patch 3 enables the USB WiFi module found.

Patch 4 enables the USB/VBUS power supply of the PMIC.

Patch 5 enables the audio codec, with support for the speaker amp.

Patch 6 enables the LCD panel with the display pipeline.


Regards
ChenYu


Chen-Yu Tsai (6):
  drm: sun4i: do cleanup if RGB output init fails
  ARM: dts: axp209: Disable ldo5 by default
  ARM: dts: sun5i: q8-common: Enable USB-based WiFi
  ARM: dts: sun5i: q8-common: Enable USB power supply
  ARM: dts: sun5i: q8-common: Enable audio codec
  ARM: dts: sun5i: q8-common: Enable display pipeline and LCD display

 arch/arm/boot/dts/axp209.dtsi          |  1 +
 arch/arm/boot/dts/sun5i-q8-common.dtsi | 62 ++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/sun4i/sun4i_tcon.c     |  6 +++-
 3 files changed, 68 insertions(+), 1 deletion(-)

-- 
2.8.1

[toc] | [next] | [standalone]


#1402435 — [PATCH 6/6] ARM: dts: sun5i: q8-common: Enable display pipeline and LCD display

FromChen-Yu Tsai <wens@csie.org>
Date2016-05-17 18:00 +0200
Subject[PATCH 6/6] ARM: dts: sun5i: q8-common: Enable display pipeline and LCD display
Message-ID<rzPzA-6rL-19@gated-at.bofh.it>
In reply to#1402434
Q8 form factor A13 tablets have a 7" LCD panel. Unfortunately we
don't know the exact model of the panel. Just pick a panel with
display timings close to what we know.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm/boot/dts/sun5i-q8-common.dtsi | 36 ++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/arch/arm/boot/dts/sun5i-q8-common.dtsi b/arch/arm/boot/dts/sun5i-q8-common.dtsi
index 5b065fd542f0..a5de28d12b16 100644
--- a/arch/arm/boot/dts/sun5i-q8-common.dtsi
+++ b/arch/arm/boot/dts/sun5i-q8-common.dtsi
@@ -59,6 +59,29 @@
 	chosen {
 		stdout-path = "serial0:115200n8";
 	};
+
+	panel: panel {
+		compatible = "urt,umsh-8596md-t", "simple-panel";
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		port@0 {
+			reg = <0>;
+			/* TODO: lcd panel uses axp gpio0 as enable pin */
+			backlight = <&backlight>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			panel_input: endpoint@0 {
+				reg = <0>;
+				remote-endpoint = <&tcon0_out_lcd>;
+			};
+		};
+	};
+};
+
+&be0 {
+	status = "okay";
 };
 
 &codec {
@@ -179,6 +202,19 @@
 	status = "okay";
 };
 
+&tcon0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&lcd_rgb666_pins>;
+	status = "okay";
+};
+
+&tcon0_out {
+	tcon0_out_lcd: endpoint@0 {
+		reg = <0>;
+		remote-endpoint = <&panel_input>;
+	};
+};
+
 &uart1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart1_pins_b>;
-- 
2.8.1

[toc] | [prev] | [next] | [standalone]


#1406877 — Re: [PATCH 6/6] ARM: dts: sun5i: q8-common: Enable display pipeline and LCD display

FromMaxime Ripard <maxime.ripard@free-electrons.com>
Date2016-05-25 14:50 +0200
SubjectRe: [PATCH 6/6] ARM: dts: sun5i: q8-common: Enable display pipeline and LCD display
Message-ID<rCGq6-11q-15@gated-at.bofh.it>
In reply to#1402435

[Multipart message — attachments visible in raw view] — view raw

On Tue, May 17, 2016 at 11:56:11PM +0800, Chen-Yu Tsai wrote:
> Q8 form factor A13 tablets have a 7" LCD panel. Unfortunately we
> don't know the exact model of the panel. Just pick a panel with
> display timings close to what we know.
> 
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>

Applied, thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

[toc] | [prev] | [next] | [standalone]


#1402436 — [PATCH 5/6] ARM: dts: sun5i: q8-common: Enable audio codec

FromChen-Yu Tsai <wens@csie.org>
Date2016-05-17 18:00 +0200
Subject[PATCH 5/6] ARM: dts: sun5i: q8-common: Enable audio codec
Message-ID<rzPzA-6rL-23@gated-at.bofh.it>
In reply to#1402434
The Q8 tablets use the audio codec to provide audio output via a
headphone jack or a small mono speaker. A GPIO output is used to
control speaker amp.

The tablets may or may not have an internal microphone.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm/boot/dts/sun5i-q8-common.dtsi | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/arch/arm/boot/dts/sun5i-q8-common.dtsi b/arch/arm/boot/dts/sun5i-q8-common.dtsi
index 8fc1b6110fb8..5b065fd542f0 100644
--- a/arch/arm/boot/dts/sun5i-q8-common.dtsi
+++ b/arch/arm/boot/dts/sun5i-q8-common.dtsi
@@ -61,6 +61,13 @@
 	};
 };
 
+&codec {
+	pinctrl-names = "default";
+	pinctrl-0 = <&codec_pa_pin>;
+	allwinner,pa-gpios = <&pio 6 10 GPIO_ACTIVE_HIGH>; /* PG10 */
+	status = "okay";
+};
+
 &cpu0 {
 	cpu-supply = <&reg_dcdc2>;
 };
@@ -100,6 +107,13 @@
 };
 
 &pio {
+	codec_pa_pin: codec_pa_pin@0 {
+		allwinner,pins = "PG10";
+		allwinner,function = "gpio_out";
+		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+	};
+
 	mmc0_cd_pin_q8: mmc0_cd_pin@0 {
 		allwinner,pins = "PG0";
 		allwinner,function = "gpio_in";
-- 
2.8.1

[toc] | [prev] | [next] | [standalone]


#1406874 — Re: [PATCH 5/6] ARM: dts: sun5i: q8-common: Enable audio codec

FromMaxime Ripard <maxime.ripard@free-electrons.com>
Date2016-05-25 14:50 +0200
SubjectRe: [PATCH 5/6] ARM: dts: sun5i: q8-common: Enable audio codec
Message-ID<rCGq6-11q-7@gated-at.bofh.it>
In reply to#1402436

[Multipart message — attachments visible in raw view] — view raw

On Tue, May 17, 2016 at 11:56:10PM +0800, Chen-Yu Tsai wrote:
> The Q8 tablets use the audio codec to provide audio output via a
> headphone jack or a small mono speaker. A GPIO output is used to
> control speaker amp.
> 
> The tablets may or may not have an internal microphone.
> 
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>

Applied, thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

[toc] | [prev] | [next] | [standalone]


#1402437 — [PATCH 1/6] drm: sun4i: do cleanup if RGB output init fails

FromChen-Yu Tsai <wens@csie.org>
Date2016-05-17 18:00 +0200
Subject[PATCH 1/6] drm: sun4i: do cleanup if RGB output init fails
Message-ID<rzPzA-6rL-21@gated-at.bofh.it>
In reply to#1402434
sun4i_rgb_init() can fail, which results in TCON failing to bind.
In this case we need to do cleanup, specificly unregistering the
dotclock, which is regmap based, and the regmap is registered as
part of the sun4i_tcon_bind().

Failing to do so results in a NULL pointer reference when the CCF
tries to turn off unused clocks.

Fixes: 29e57fab97fc ("drm: sun4i: Add RGB output")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 drivers/gpu/drm/sun4i/sun4i_tcon.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c
index 9f19b0e08560..dea673275356 100644
--- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
+++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
@@ -490,7 +490,11 @@ static int sun4i_tcon_bind(struct device *dev, struct device *master,
 		return 0;
 	}
 
-	return sun4i_rgb_init(drm);
+	ret = sun4i_rgb_init(drm);
+	if (ret < 0)
+		goto err_free_clocks;
+
+	return 0;
 
 err_free_clocks:
 	sun4i_tcon_free_clocks(tcon);
-- 
2.8.1

[toc] | [prev] | [next] | [standalone]


#1406869 — Re: [PATCH 1/6] drm: sun4i: do cleanup if RGB output init fails

FromMaxime Ripard <maxime.ripard@free-electrons.com>
Date2016-05-25 14:40 +0200
SubjectRe: [PATCH 1/6] drm: sun4i: do cleanup if RGB output init fails
Message-ID<rCGgp-Yf-15@gated-at.bofh.it>
In reply to#1402437

[Multipart message — attachments visible in raw view] — view raw

On Tue, May 17, 2016 at 11:56:06PM +0800, Chen-Yu Tsai wrote:
> sun4i_rgb_init() can fail, which results in TCON failing to bind.
> In this case we need to do cleanup, specificly unregistering the
> dotclock, which is regmap based, and the regmap is registered as
> part of the sun4i_tcon_bind().
> 
> Failing to do so results in a NULL pointer reference when the CCF
> tries to turn off unused clocks.
> 
> Fixes: 29e57fab97fc ("drm: sun4i: Add RGB output")
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>

Applied, thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

[toc] | [prev] | [next] | [standalone]


#1402438 — [PATCH 3/6] ARM: dts: sun5i: q8-common: Enable USB-based WiFi

FromChen-Yu Tsai <wens@csie.org>
Date2016-05-17 18:00 +0200
Subject[PATCH 3/6] ARM: dts: sun5i: q8-common: Enable USB-based WiFi
Message-ID<rzPzA-6rL-33@gated-at.bofh.it>
In reply to#1402434
The early A13 Q8 tablets all use a Realtek WiFi module connected to
USB1. The module is powered by AXP209's LDO3 at 3.3V.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm/boot/dts/sun5i-q8-common.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/boot/dts/sun5i-q8-common.dtsi b/arch/arm/boot/dts/sun5i-q8-common.dtsi
index a78e189f6653..dcaaa085ac77 100644
--- a/arch/arm/boot/dts/sun5i-q8-common.dtsi
+++ b/arch/arm/boot/dts/sun5i-q8-common.dtsi
@@ -154,6 +154,12 @@
 	regulator-name = "avcc";
 };
 
+&reg_ldo3 {
+	regulator-min-microvolt = <3300000>;
+	regulator-max-microvolt = <3300000>;
+	regulator-name = "vcc-wifi";
+};
+
 &reg_usb0_vbus {
 	gpio = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
 	status = "okay";
@@ -176,5 +182,6 @@
 	usb0_id_det-gpio = <&pio 6 2 GPIO_ACTIVE_HIGH>; /* PG2 */
 	usb0_vbus_det-gpio = <&pio 6 1 GPIO_ACTIVE_HIGH>; /* PG1 */
 	usb0_vbus-supply = <&reg_usb0_vbus>;
+	usb1_vbus-supply = <&reg_ldo3>;
 	status = "okay";
 };
-- 
2.8.1

[toc] | [prev] | [next] | [standalone]


#1402440 — [PATCH 2/6] ARM: dts: axp209: Disable ldo5 by default

FromChen-Yu Tsai <wens@csie.org>
Date2016-05-17 18:00 +0200
Subject[PATCH 2/6] ARM: dts: axp209: Disable ldo5 by default
Message-ID<rzPzA-6rL-27@gated-at.bofh.it>
In reply to#1402434
The output pin of LDO is also a GPIO pin, and the on/off settings of the
regulator are actually pinmux settings.

Disable it by default so it doesn't conflict with GPIO usage.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm/boot/dts/axp209.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/axp209.dtsi b/arch/arm/boot/dts/axp209.dtsi
index 051ab3ba9a65..afbe89c01df5 100644
--- a/arch/arm/boot/dts/axp209.dtsi
+++ b/arch/arm/boot/dts/axp209.dtsi
@@ -87,6 +87,7 @@
 
 		reg_ldo5: ldo5 {
 			regulator-name = "ldo5";
+			status = "disabled";
 		};
 	};
 
-- 
2.8.1

[toc] | [prev] | [next] | [standalone]


#1406870 — Re: [PATCH 2/6] ARM: dts: axp209: Disable ldo5 by default

FromMaxime Ripard <maxime.ripard@free-electrons.com>
Date2016-05-25 14:40 +0200
SubjectRe: [PATCH 2/6] ARM: dts: axp209: Disable ldo5 by default
Message-ID<rCGgp-Yf-13@gated-at.bofh.it>
In reply to#1402440

[Multipart message — attachments visible in raw view] — view raw

On Tue, May 17, 2016 at 11:56:07PM +0800, Chen-Yu Tsai wrote:
> The output pin of LDO is also a GPIO pin, and the on/off settings of the
> regulator are actually pinmux settings.
> 
> Disable it by default so it doesn't conflict with GPIO usage.
> 
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>

Applied, thanks!

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

[toc] | [prev] | [next] | [standalone]


#1402782 — Re: [PATCH 0/6] ARM: dts: sun5i: q8-common: Enable various peripherals

FromHans de Goede <hdegoede@redhat.com>
Date2016-05-18 10:20 +0200
SubjectRe: [PATCH 0/6] ARM: dts: sun5i: q8-common: Enable various peripherals
Message-ID<rA4RX-7UR-3@gated-at.bofh.it>
In reply to#1402434
Hi Chen-Yu,

On 17-05-16 17:56, Chen-Yu Tsai wrote:
> Hi everyone,
>
> This series enables more peripherals for Allwinner A13-based Q8 devices.
> The peripherals include the WiFi, the PMIC's micro-usb power supply
> (driver), audio codec (headphone and speaker), and full display support
> with the new DRM KMS driver. The series is based on parts of Maxime's
> "drm: Add Support for Passive RGB to VGA bridges" series, specifically
> the clk and drm fixes, and common DTS bits.
>
> Hans, since you have a collection of q8 tablets, I'm hoping you could
> test these bits and provide some feedback.

I've not run any tests, just looked at the patches, the stuff in
patch 3 is already present in arch/arm/boot/dts/sun5i-a13-q8-tablet.dts
I put it there because I saw some .fex files which don't use ldo3 for wifi
I'm fine with moving it to -common though, I believe that you're right
that it makes more sense there, having it in 2 places is not really
useful though.

The other patches look good.

Thanks & Regards,

Hans


>
>
> Patch 1 is a small fix for part of the init failure path.
>
> Patch 2 disables ldo5 on the axp209 by default. This regulator output is
> muxed with a gpio, and the regulator on/off settings override the gpio.
>
> Patch 3 enables the USB WiFi module found.
>
> Patch 4 enables the USB/VBUS power supply of the PMIC.
>
> Patch 5 enables the audio codec, with support for the speaker amp.
>
> Patch 6 enables the LCD panel with the display pipeline.
>
>
> Regards
> ChenYu
>
>
> Chen-Yu Tsai (6):
>   drm: sun4i: do cleanup if RGB output init fails
>   ARM: dts: axp209: Disable ldo5 by default
>   ARM: dts: sun5i: q8-common: Enable USB-based WiFi
>   ARM: dts: sun5i: q8-common: Enable USB power supply
>   ARM: dts: sun5i: q8-common: Enable audio codec
>   ARM: dts: sun5i: q8-common: Enable display pipeline and LCD display
>
>  arch/arm/boot/dts/axp209.dtsi          |  1 +
>  arch/arm/boot/dts/sun5i-q8-common.dtsi | 62 ++++++++++++++++++++++++++++++++++
>  drivers/gpu/drm/sun4i/sun4i_tcon.c     |  6 +++-
>  3 files changed, 68 insertions(+), 1 deletion(-)
>

[toc] | [prev] | [next] | [standalone]


#1406875 — Re: [PATCH 0/6] ARM: dts: sun5i: q8-common: Enable various peripherals

FromMaxime Ripard <maxime.ripard@free-electrons.com>
Date2016-05-25 14:50 +0200
SubjectRe: [PATCH 0/6] ARM: dts: sun5i: q8-common: Enable various peripherals
Message-ID<rCGq6-11q-11@gated-at.bofh.it>
In reply to#1402782

[Multipart message — attachments visible in raw view] — view raw

Hi Hans,

On Wed, May 18, 2016 at 10:13:52AM +0200, Hans de Goede wrote:
> Hi Chen-Yu,
> 
> On 17-05-16 17:56, Chen-Yu Tsai wrote:
> >Hi everyone,
> >
> >This series enables more peripherals for Allwinner A13-based Q8 devices.
> >The peripherals include the WiFi, the PMIC's micro-usb power supply
> >(driver), audio codec (headphone and speaker), and full display support
> >with the new DRM KMS driver. The series is based on parts of Maxime's
> >"drm: Add Support for Passive RGB to VGA bridges" series, specifically
> >the clk and drm fixes, and common DTS bits.
> >
> >Hans, since you have a collection of q8 tablets, I'm hoping you could
> >test these bits and provide some feedback.
> 
> I've not run any tests, just looked at the patches, the stuff in
> patch 3 is already present in arch/arm/boot/dts/sun5i-a13-q8-tablet.dts
> I put it there because I saw some .fex files which don't use ldo3 for wifi
> I'm fine with moving it to -common though, I believe that you're right
> that it makes more sense there, having it in 2 places is not really
> useful though.

I'm not quite sure what you mean, do you want Chen-Yu to send a second
version, or are you ok with this patch?

Thanks,
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web