linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] ARM: sun9i: Enable extra uarts, leds and i2c controllers
@ 2014-10-28  9:50 Chen-Yu Tsai
  2014-10-28  9:50 ` [PATCH 1/6] ARM: dts: sun9i: Add i2c controller nodes to a80 dtsi Chen-Yu Tsai
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: Chen-Yu Tsai @ 2014-10-28  9:50 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

This series enables the uart and i2c controller found on the A80 Optimus
board's gpio expansion header, as well as 2 out of 3 onboard LEDs. The
last LED needs R_PIO support.

This series contains only changes to the dtsi and dts files, and is based
on Maxime's pinctrl driver series. The patches should be self-explanatory.


Cheers,
ChenYu


Chen-Yu Tsai (6):
  ARM: dts: sun9i: Add i2c controller nodes to a80 dtsi
  ARM: dts: sun9i: Add i2c3 pinmux setting for A80 SoC
  ARM: dts: sun9i: Enable i2c3 on A80 Optimus board
  ARM: dts: sun9i: Add GPIO LEDs for A80 Optimus board
  ARM: dts: sun9i: Add uart4 pinmux setting for A80 SoC
  ARM: dts: sun9i: Enable uart4 for A80 Optimus board

 arch/arm/boot/dts/sun9i-a80-optimus.dts | 49 +++++++++++++++++++++++
 arch/arm/boot/dts/sun9i-a80.dtsi        | 69 +++++++++++++++++++++++++++++++++
 2 files changed, 118 insertions(+)

-- 
2.1.1

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

* [PATCH 1/6] ARM: dts: sun9i: Add i2c controller nodes to a80 dtsi
  2014-10-28  9:50 [PATCH 0/6] ARM: sun9i: Enable extra uarts, leds and i2c controllers Chen-Yu Tsai
@ 2014-10-28  9:50 ` Chen-Yu Tsai
  2014-10-28  9:50 ` [PATCH 2/6] ARM: dts: sun9i: Add i2c3 pinmux setting for A80 SoC Chen-Yu Tsai
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 15+ messages in thread
From: Chen-Yu Tsai @ 2014-10-28  9:50 UTC (permalink / raw)
  To: linux-arm-kernel

The A80 has 5 i2c controllers in the main processor block.

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

diff --git a/arch/arm/boot/dts/sun9i-a80.dtsi b/arch/arm/boot/dts/sun9i-a80.dtsi
index e8b24cd..b03d791 100644
--- a/arch/arm/boot/dts/sun9i-a80.dtsi
+++ b/arch/arm/boot/dts/sun9i-a80.dtsi
@@ -435,6 +435,61 @@
 			status = "disabled";
 		};
 
+		i2c0: i2c at 07002800 {
+			compatible = "allwinner,sun6i-a31-i2c";
+			reg = <0x07002800 0x400>;
+			interrupts = <0 6 4>;
+			clocks = <&apb1_gates 0>;
+			resets = <&apb1_resets 0>;
+			status = "disabled";
+			#address-cells = <1>;
+			#size-cells = <0>;
+		};
+
+		i2c1: i2c at 07002c00 {
+			compatible = "allwinner,sun6i-a31-i2c";
+			reg = <0x07002c00 0x400>;
+			interrupts = <0 7 4>;
+			clocks = <&apb1_gates 1>;
+			resets = <&apb1_resets 1>;
+			status = "disabled";
+			#address-cells = <1>;
+			#size-cells = <0>;
+		};
+
+		i2c2: i2c at 07003000 {
+			compatible = "allwinner,sun6i-a31-i2c";
+			reg = <0x07003000 0x400>;
+			interrupts = <0 8 4>;
+			clocks = <&apb1_gates 2>;
+			resets = <&apb1_resets 2>;
+			status = "disabled";
+			#address-cells = <1>;
+			#size-cells = <0>;
+		};
+
+		i2c3: i2c at 07003400 {
+			compatible = "allwinner,sun6i-a31-i2c";
+			reg = <0x07003400 0x400>;
+			interrupts = <0 9 4>;
+			clocks = <&apb1_gates 3>;
+			resets = <&apb1_resets 3>;
+			status = "disabled";
+			#address-cells = <1>;
+			#size-cells = <0>;
+		};
+
+		i2c4: i2c at 07003800 {
+			compatible = "allwinner,sun6i-a31-i2c";
+			reg = <0x07003800 0x400>;
+			interrupts = <0 10 4>;
+			clocks = <&apb1_gates 4>;
+			resets = <&apb1_resets 4>;
+			status = "disabled";
+			#address-cells = <1>;
+			#size-cells = <0>;
+		};
+
 		r_wdt: watchdog at 08001000 {
 			compatible = "allwinner,sun6i-a31-wdt";
 			reg = <0x08001000 0x20>;
-- 
2.1.1

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

* [PATCH 2/6] ARM: dts: sun9i: Add i2c3 pinmux setting for A80 SoC
  2014-10-28  9:50 [PATCH 0/6] ARM: sun9i: Enable extra uarts, leds and i2c controllers Chen-Yu Tsai
  2014-10-28  9:50 ` [PATCH 1/6] ARM: dts: sun9i: Add i2c controller nodes to a80 dtsi Chen-Yu Tsai
@ 2014-10-28  9:50 ` Chen-Yu Tsai
  2014-10-28  9:50 ` [PATCH 3/6] ARM: dts: sun9i: Enable i2c3 on A80 Optimus board Chen-Yu Tsai
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 15+ messages in thread
From: Chen-Yu Tsai @ 2014-10-28  9:50 UTC (permalink / raw)
  To: linux-arm-kernel

i2c3 has only one possible pinmux setting on the A80 SoC.

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

diff --git a/arch/arm/boot/dts/sun9i-a80.dtsi b/arch/arm/boot/dts/sun9i-a80.dtsi
index b03d791..653bb4d 100644
--- a/arch/arm/boot/dts/sun9i-a80.dtsi
+++ b/arch/arm/boot/dts/sun9i-a80.dtsi
@@ -361,6 +361,13 @@
 			#size-cells = <0>;
 			#gpio-cells = <3>;
 
+			i2c3_pins_a: i2c3 at 0 {
+				allwinner,pins = "PG10", "PG11";
+				allwinner,function = "i2c3";
+				allwinner,drive = <0>;
+				allwinner,pull = <0>;
+			};
+
 			uart0_pins_a: uart0 at 0 {
 				allwinner,pins = "PH12", "PH13";
 				allwinner,function = "uart0";
-- 
2.1.1

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

* [PATCH 3/6] ARM: dts: sun9i: Enable i2c3 on A80 Optimus board
  2014-10-28  9:50 [PATCH 0/6] ARM: sun9i: Enable extra uarts, leds and i2c controllers Chen-Yu Tsai
  2014-10-28  9:50 ` [PATCH 1/6] ARM: dts: sun9i: Add i2c controller nodes to a80 dtsi Chen-Yu Tsai
  2014-10-28  9:50 ` [PATCH 2/6] ARM: dts: sun9i: Add i2c3 pinmux setting for A80 SoC Chen-Yu Tsai
@ 2014-10-28  9:50 ` Chen-Yu Tsai
  2014-10-28  9:50 ` [PATCH 4/6] ARM: dts: sun9i: Add GPIO LEDs for " Chen-Yu Tsai
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 15+ messages in thread
From: Chen-Yu Tsai @ 2014-10-28  9:50 UTC (permalink / raw)
  To: linux-arm-kernel

i2c3 is exposed on the GPIO extension header. Enable it so we can use it.

Also enable internal pull-ups on the pins, as they don't seem to have
external pull-up resistors.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm/boot/dts/sun9i-a80-optimus.dts | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/arm/boot/dts/sun9i-a80-optimus.dts b/arch/arm/boot/dts/sun9i-a80-optimus.dts
index 9ed60f3..25fe775 100644
--- a/arch/arm/boot/dts/sun9i-a80-optimus.dts
+++ b/arch/arm/boot/dts/sun9i-a80-optimus.dts
@@ -59,10 +59,23 @@
 	};
 
 	soc {
+		pio: pinctrl at 06000800 {
+			i2c3_pins_a: i2c3 at 0 {
+				/* Enable internal pull-up */
+				allwinner,pull = <1>;
+			};
+		};
+
 		uart0: serial at 07000000 {
 			pinctrl-names = "default";
 			pinctrl-0 = <&uart0_pins_a>;
 			status = "okay";
 		};
+
+		i2c3: i2c at 07003400 {
+			pinctrl-names = "default";
+			pinctrl-0 = <&i2c3_pins_a>;
+			status = "okay";
+		};
 	};
 };
-- 
2.1.1

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

* [PATCH 4/6] ARM: dts: sun9i: Add GPIO LEDs for A80 Optimus board
  2014-10-28  9:50 [PATCH 0/6] ARM: sun9i: Enable extra uarts, leds and i2c controllers Chen-Yu Tsai
                   ` (2 preceding siblings ...)
  2014-10-28  9:50 ` [PATCH 3/6] ARM: dts: sun9i: Enable i2c3 on A80 Optimus board Chen-Yu Tsai
@ 2014-10-28  9:50 ` Chen-Yu Tsai
  2014-10-28 11:04   ` [linux-sunxi] " Koen Kooi
  2014-10-28 20:16   ` Maxime Ripard
  2014-10-28  9:50 ` [PATCH 5/6] ARM: dts: sun9i: Add uart4 pinmux setting for A80 SoC Chen-Yu Tsai
  2014-10-28  9:50 ` [PATCH 6/6] ARM: dts: sun9i: Enable uart4 for A80 Optimus board Chen-Yu Tsai
  5 siblings, 2 replies; 15+ messages in thread
From: Chen-Yu Tsai @ 2014-10-28  9:50 UTC (permalink / raw)
  To: linux-arm-kernel

The A80 Optimus board has 3 usable LEDs that are controlled via GPIO.

This patch adds support for 2 of them which are driver by GPIOs in the
main pin controller. The remaining one uses GPIO from the R_PIO
controller, which we don't support yet.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm/boot/dts/sun9i-a80-optimus.dts | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/arch/arm/boot/dts/sun9i-a80-optimus.dts b/arch/arm/boot/dts/sun9i-a80-optimus.dts
index 25fe775..91eda76 100644
--- a/arch/arm/boot/dts/sun9i-a80-optimus.dts
+++ b/arch/arm/boot/dts/sun9i-a80-optimus.dts
@@ -64,6 +64,13 @@
 				/* Enable internal pull-up */
 				allwinner,pull = <1>;
 			};
+
+			led_pins_optimus: led_pins at 0 {
+				allwinner,pins = "PH0", "PH1";
+				allwinner,function = "gpio_out";
+				allwinner,drive = <0>;
+				allwinner,pull = <0>;
+			};
 		};
 
 		uart0: serial at 07000000 {
@@ -78,4 +85,22 @@
 			status = "okay";
 		};
 	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-names = "default";
+		pinctrl-0 = <&led_pins_optimus>;
+
+		led2 {
+			label = "a80_optimus:led2:usr";
+			gpios = <&pio 7 0 0>;
+		};
+
+		/* led3 is on PM15, in R_PIO */
+
+		led4 {
+			label = "a80_optimus:led4:usr";
+			gpios = <&pio 7 1 0>;
+		};
+	};
 };
-- 
2.1.1

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

* [PATCH 5/6] ARM: dts: sun9i: Add uart4 pinmux setting for A80 SoC
  2014-10-28  9:50 [PATCH 0/6] ARM: sun9i: Enable extra uarts, leds and i2c controllers Chen-Yu Tsai
                   ` (3 preceding siblings ...)
  2014-10-28  9:50 ` [PATCH 4/6] ARM: dts: sun9i: Add GPIO LEDs for " Chen-Yu Tsai
@ 2014-10-28  9:50 ` Chen-Yu Tsai
  2014-10-28  9:50 ` [PATCH 6/6] ARM: dts: sun9i: Enable uart4 for A80 Optimus board Chen-Yu Tsai
  5 siblings, 0 replies; 15+ messages in thread
From: Chen-Yu Tsai @ 2014-10-28  9:50 UTC (permalink / raw)
  To: linux-arm-kernel

uart4 only has one possible pinmux setting on the A80 SoC.

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

diff --git a/arch/arm/boot/dts/sun9i-a80.dtsi b/arch/arm/boot/dts/sun9i-a80.dtsi
index 653bb4d..2d744d2 100644
--- a/arch/arm/boot/dts/sun9i-a80.dtsi
+++ b/arch/arm/boot/dts/sun9i-a80.dtsi
@@ -374,6 +374,13 @@
 				allwinner,drive = <0>;
 				allwinner,pull = <0>;
 			};
+
+			uart4_pins_a: uart4 at 0 {
+				allwinner,pins = "PG12", "PG13", "PG14", "PG15";
+				allwinner,function = "uart4";
+				allwinner,drive = <0>;
+				allwinner,pull = <0>;
+			};
 		};
 
 		uart0: serial at 07000000 {
-- 
2.1.1

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

* [PATCH 6/6] ARM: dts: sun9i: Enable uart4 for A80 Optimus board
  2014-10-28  9:50 [PATCH 0/6] ARM: sun9i: Enable extra uarts, leds and i2c controllers Chen-Yu Tsai
                   ` (4 preceding siblings ...)
  2014-10-28  9:50 ` [PATCH 5/6] ARM: dts: sun9i: Add uart4 pinmux setting for A80 SoC Chen-Yu Tsai
@ 2014-10-28  9:50 ` Chen-Yu Tsai
  5 siblings, 0 replies; 15+ messages in thread
From: Chen-Yu Tsai @ 2014-10-28  9:50 UTC (permalink / raw)
  To: linux-arm-kernel

The A80 Optimus board exposes uart4 on the GPIO expansion header.
Enable it so we can use it.

Also enable the internal pull-ups, as there doesn't seem to be
external pull-up resistors for pins on the expansion header.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm/boot/dts/sun9i-a80-optimus.dts | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/arch/arm/boot/dts/sun9i-a80-optimus.dts b/arch/arm/boot/dts/sun9i-a80-optimus.dts
index 91eda76..105a324 100644
--- a/arch/arm/boot/dts/sun9i-a80-optimus.dts
+++ b/arch/arm/boot/dts/sun9i-a80-optimus.dts
@@ -71,6 +71,11 @@
 				allwinner,drive = <0>;
 				allwinner,pull = <0>;
 			};
+
+			uart4_pins_a: uart4 at 0 {
+				/* Enable internal pull-up */
+				allwinner,pull = <1>;
+			};
 		};
 
 		uart0: serial at 07000000 {
@@ -79,6 +84,12 @@
 			status = "okay";
 		};
 
+		uart4: serial at 07001000 {
+			pinctrl-names = "default";
+			pinctrl-0 = <&uart4_pins_a>;
+			status = "okay";
+		};
+
 		i2c3: i2c at 07003400 {
 			pinctrl-names = "default";
 			pinctrl-0 = <&i2c3_pins_a>;
-- 
2.1.1

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

* [linux-sunxi] [PATCH 4/6] ARM: dts: sun9i: Add GPIO LEDs for A80 Optimus board
  2014-10-28  9:50 ` [PATCH 4/6] ARM: dts: sun9i: Add GPIO LEDs for " Chen-Yu Tsai
@ 2014-10-28 11:04   ` Koen Kooi
  2014-10-28 20:27     ` Maxime Ripard
  2014-10-28 20:16   ` Maxime Ripard
  1 sibling, 1 reply; 15+ messages in thread
From: Koen Kooi @ 2014-10-28 11:04 UTC (permalink / raw)
  To: linux-arm-kernel


> Op 28 okt. 2014, om 10:50 heeft Chen-Yu Tsai <wens@csie.org> het volgende geschreven:
> 
> The A80 Optimus board has 3 usable LEDs that are controlled via GPIO.
> 
> This patch adds support for 2 of them which are driver by GPIOs in the
> main pin controller. The remaining one uses GPIO from the R_PIO
> controller, which we don't support yet.

Out of curiousity, are those LEDs labeled and if so, would it make sense to assign default triggers matching the labels to them? As a personal preference I tend to have one of the LEDs use the 'heartbeat' trigger so I can see that it's alive.

regards,

Koen

> 
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> ---
> arch/arm/boot/dts/sun9i-a80-optimus.dts | 25 +++++++++++++++++++++++++
> 1 file changed, 25 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/sun9i-a80-optimus.dts b/arch/arm/boot/dts/sun9i-a80-optimus.dts
> index 25fe775..91eda76 100644
> --- a/arch/arm/boot/dts/sun9i-a80-optimus.dts
> +++ b/arch/arm/boot/dts/sun9i-a80-optimus.dts
> @@ -64,6 +64,13 @@
> 				/* Enable internal pull-up */
> 				allwinner,pull = <1>;
> 			};
> +
> +			led_pins_optimus: led_pins at 0 {
> +				allwinner,pins = "PH0", "PH1";
> +				allwinner,function = "gpio_out";
> +				allwinner,drive = <0>;
> +				allwinner,pull = <0>;
> +			};
> 		};
> 
> 		uart0: serial at 07000000 {
> @@ -78,4 +85,22 @@
> 			status = "okay";
> 		};
> 	};
> +
> +	leds {
> +		compatible = "gpio-leds";
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&led_pins_optimus>;
> +
> +		led2 {
> +			label = "a80_optimus:led2:usr";
> +			gpios = <&pio 7 0 0>;
> +		};
> +
> +		/* led3 is on PM15, in R_PIO */
> +
> +		led4 {
> +			label = "a80_optimus:led4:usr";
> +			gpios = <&pio 7 1 0>;
> +		};
> +	};
> };
> -- 
> 2.1.1
> 
> -- 
> You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe at googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
> 

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

* [PATCH 4/6] ARM: dts: sun9i: Add GPIO LEDs for A80 Optimus board
  2014-10-28  9:50 ` [PATCH 4/6] ARM: dts: sun9i: Add GPIO LEDs for " Chen-Yu Tsai
  2014-10-28 11:04   ` [linux-sunxi] " Koen Kooi
@ 2014-10-28 20:16   ` Maxime Ripard
  2014-10-28 21:19     ` Andreas Färber
  2014-10-29  1:50     ` Chen-Yu Tsai
  1 sibling, 2 replies; 15+ messages in thread
From: Maxime Ripard @ 2014-10-28 20:16 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Chen-Yu,

On Tue, Oct 28, 2014 at 05:50:41PM +0800, Chen-Yu Tsai wrote:
> The A80 Optimus board has 3 usable LEDs that are controlled via GPIO.
> 
> This patch adds support for 2 of them which are driver by GPIOs in the
> main pin controller. The remaining one uses GPIO from the R_PIO
> controller, which we don't support yet.
> 
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> ---
>  arch/arm/boot/dts/sun9i-a80-optimus.dts | 25 +++++++++++++++++++++++++
>  1 file changed, 25 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/sun9i-a80-optimus.dts b/arch/arm/boot/dts/sun9i-a80-optimus.dts
> index 25fe775..91eda76 100644
> --- a/arch/arm/boot/dts/sun9i-a80-optimus.dts
> +++ b/arch/arm/boot/dts/sun9i-a80-optimus.dts
> @@ -64,6 +64,13 @@
>  				/* Enable internal pull-up */
>  				allwinner,pull = <1>;
>  			};
> +
> +			led_pins_optimus: led_pins at 0 {
> +				allwinner,pins = "PH0", "PH1";
> +				allwinner,function = "gpio_out";
> +				allwinner,drive = <0>;
> +				allwinner,pull = <0>;
> +			};
>  		};
>  
>  		uart0: serial at 07000000 {
> @@ -78,4 +85,22 @@
>  			status = "okay";
>  		};
>  	};
> +
> +	leds {
> +		compatible = "gpio-leds";
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&led_pins_optimus>;
> +
> +		led2 {
> +			label = "a80_optimus:led2:usr";

We're usually using a dash instead of an underscore as a separator.

> +			gpios = <&pio 7 0 0>;
> +		};
> +
> +		/* led3 is on PM15, in R_PIO */

You were saying that there is three LEDs, why start the numbering at
2?

> +
> +		led4 {
> +			label = "a80_optimus:led4:usr";
> +			gpios = <&pio 7 1 0>;
> +		};
> +	};
>  };

The rest of your patchset is fine for me, we just need to get the
pinctrl driver merged first :)

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141028/a985b3b6/attachment.sig>

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

* [linux-sunxi] [PATCH 4/6] ARM: dts: sun9i: Add GPIO LEDs for A80 Optimus board
  2014-10-28 11:04   ` [linux-sunxi] " Koen Kooi
@ 2014-10-28 20:27     ` Maxime Ripard
  2014-10-29  1:54       ` Chen-Yu Tsai
  0 siblings, 1 reply; 15+ messages in thread
From: Maxime Ripard @ 2014-10-28 20:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Oct 28, 2014 at 12:04:28PM +0100, Koen Kooi wrote:
> 
> > Op 28 okt. 2014, om 10:50 heeft Chen-Yu Tsai <wens@csie.org> het volgende geschreven:
> > 
> > The A80 Optimus board has 3 usable LEDs that are controlled via GPIO.
> > 
> > This patch adds support for 2 of them which are driver by GPIOs in the
> > main pin controller. The remaining one uses GPIO from the R_PIO
> > controller, which we don't support yet.
> 
> Out of curiousity, are those LEDs labeled and if so, would it make
> sense to assign default triggers matching the labels to them? As a
> personal preference I tend to have one of the LEDs use the
> 'heartbeat' trigger so I can see that it's alive.

I'm not a huge fan of forcing this kind of policy decision down to the
users, especially for such "generic" boards that don't have any
labeled LEDs.

I feel like it's a userspace decision, but I don't have a strong
opinion on this :)

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141028/b04bf649/attachment.sig>

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

* [PATCH 4/6] ARM: dts: sun9i: Add GPIO LEDs for A80 Optimus board
  2014-10-28 20:16   ` Maxime Ripard
@ 2014-10-28 21:19     ` Andreas Färber
  2014-10-29  2:02       ` Chen-Yu Tsai
  2014-10-30 15:53       ` Maxime Ripard
  2014-10-29  1:50     ` Chen-Yu Tsai
  1 sibling, 2 replies; 15+ messages in thread
From: Andreas Färber @ 2014-10-28 21:19 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

Am 28.10.2014 um 21:16 schrieb Maxime Ripard:
> Hi Chen-Yu,
> 
> On Tue, Oct 28, 2014 at 05:50:41PM +0800, Chen-Yu Tsai wrote:
>> The A80 Optimus board has 3 usable LEDs that are controlled via GPIO.
>>
>> This patch adds support for 2 of them which are driver by GPIOs in the
>> main pin controller. The remaining one uses GPIO from the R_PIO
>> controller, which we don't support yet.
>>
>> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
>> ---
>>  arch/arm/boot/dts/sun9i-a80-optimus.dts | 25 +++++++++++++++++++++++++
>>  1 file changed, 25 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/sun9i-a80-optimus.dts b/arch/arm/boot/dts/sun9i-a80-optimus.dts
>> index 25fe775..91eda76 100644
>> --- a/arch/arm/boot/dts/sun9i-a80-optimus.dts
>> +++ b/arch/arm/boot/dts/sun9i-a80-optimus.dts
>> @@ -64,6 +64,13 @@
>>  				/* Enable internal pull-up */
>>  				allwinner,pull = <1>;
>>  			};
>> +
>> +			led_pins_optimus: led_pins at 0 {

Here too, led-pins at 0 would be more in line with DT conventions.

>> +				allwinner,pins = "PH0", "PH1";
>> +				allwinner,function = "gpio_out";
>> +				allwinner,drive = <0>;
>> +				allwinner,pull = <0>;
>> +			};
>>  		};
>>  
>>  		uart0: serial at 07000000 {
>> @@ -78,4 +85,22 @@
>>  			status = "okay";
>>  		};
>>  	};
>> +
>> +	leds {
>> +		compatible = "gpio-leds";
>> +		pinctrl-names = "default";
>> +		pinctrl-0 = <&led_pins_optimus>;
>> +
>> +		led2 {
>> +			label = "a80_optimus:led2:usr";
> 
> We're usually using a dash instead of an underscore as a separator.

I wonder, why a80_? The board is labeled "Allwinner Tech Optimus Board",
and the Cubietruck LEDs are not prefixed with a20_ either.

>> +			gpios = <&pio 7 0 0>;
>> +		};
>> +
>> +		/* led3 is on PM15, in R_PIO */
> 
> You were saying that there is three LEDs, why start the numbering at
> 2?

They are labeled "LED2", "LED4", "LED3" right-to-left.
Additionally there's a "PWR" LED, maybe that counts as number 1...

>> +
>> +		led4 {
>> +			label = "a80_optimus:led4:usr";
>> +			gpios = <&pio 7 1 0>;
>> +		};
>> +	};
>>  };
> 
> The rest of your patchset is fine for me, we just need to get the
> pinctrl driver merged first :)

Cheers,
Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imend?rffer; HRB 16746 AG N?rnberg

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141028/b4a122d3/attachment.sig>

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

* [PATCH 4/6] ARM: dts: sun9i: Add GPIO LEDs for A80 Optimus board
  2014-10-28 20:16   ` Maxime Ripard
  2014-10-28 21:19     ` Andreas Färber
@ 2014-10-29  1:50     ` Chen-Yu Tsai
  1 sibling, 0 replies; 15+ messages in thread
From: Chen-Yu Tsai @ 2014-10-29  1:50 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Oct 29, 2014 at 4:16 AM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> Hi Chen-Yu,
>
> On Tue, Oct 28, 2014 at 05:50:41PM +0800, Chen-Yu Tsai wrote:
>> The A80 Optimus board has 3 usable LEDs that are controlled via GPIO.
>>
>> This patch adds support for 2 of them which are driver by GPIOs in the
>> main pin controller. The remaining one uses GPIO from the R_PIO
>> controller, which we don't support yet.
>>
>> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
>> ---
>>  arch/arm/boot/dts/sun9i-a80-optimus.dts | 25 +++++++++++++++++++++++++
>>  1 file changed, 25 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/sun9i-a80-optimus.dts b/arch/arm/boot/dts/sun9i-a80-optimus.dts
>> index 25fe775..91eda76 100644
>> --- a/arch/arm/boot/dts/sun9i-a80-optimus.dts
>> +++ b/arch/arm/boot/dts/sun9i-a80-optimus.dts
>> @@ -64,6 +64,13 @@
>>                               /* Enable internal pull-up */
>>                               allwinner,pull = <1>;
>>                       };
>> +
>> +                     led_pins_optimus: led_pins at 0 {
>> +                             allwinner,pins = "PH0", "PH1";
>> +                             allwinner,function = "gpio_out";
>> +                             allwinner,drive = <0>;
>> +                             allwinner,pull = <0>;
>> +                     };
>>               };
>>
>>               uart0: serial at 07000000 {
>> @@ -78,4 +85,22 @@
>>                       status = "okay";
>>               };
>>       };
>> +
>> +     leds {
>> +             compatible = "gpio-leds";
>> +             pinctrl-names = "default";
>> +             pinctrl-0 = <&led_pins_optimus>;
>> +
>> +             led2 {
>> +                     label = "a80_optimus:led2:usr";
>
> We're usually using a dash instead of an underscore as a separator.

Ok.

>> +                     gpios = <&pio 7 0 0>;
>> +             };
>> +
>> +             /* led3 is on PM15, in R_PIO */
>
> You were saying that there is three LEDs, why start the numbering at
> 2?

That's what's printed on the board next to the LEDs.
I looked around but couldn't find LED1.

>> +
>> +             led4 {
>> +                     label = "a80_optimus:led4:usr";
>> +                     gpios = <&pio 7 1 0>;
>> +             };
>> +     };
>>  };
>
> The rest of your patchset is fine for me, we just need to get the
> pinctrl driver merged first :)

Thanks!
ChenYu

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

* [linux-sunxi] [PATCH 4/6] ARM: dts: sun9i: Add GPIO LEDs for A80 Optimus board
  2014-10-28 20:27     ` Maxime Ripard
@ 2014-10-29  1:54       ` Chen-Yu Tsai
  0 siblings, 0 replies; 15+ messages in thread
From: Chen-Yu Tsai @ 2014-10-29  1:54 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Oct 29, 2014 at 4:27 AM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> On Tue, Oct 28, 2014 at 12:04:28PM +0100, Koen Kooi wrote:
>>
>> > Op 28 okt. 2014, om 10:50 heeft Chen-Yu Tsai <wens@csie.org> het volgende geschreven:
>> >
>> > The A80 Optimus board has 3 usable LEDs that are controlled via GPIO.
>> >
>> > This patch adds support for 2 of them which are driver by GPIOs in the
>> > main pin controller. The remaining one uses GPIO from the R_PIO
>> > controller, which we don't support yet.
>>
>> Out of curiousity, are those LEDs labeled and if so, would it make
>> sense to assign default triggers matching the labels to them? As a
>> personal preference I tend to have one of the LEDs use the
>> 'heartbeat' trigger so I can see that it's alive.

They are not labeled in any meaningful way (LED2~4), are next to each
other, and are all the same color. Not very helpful. :|

The stock firmware uses them for mmc0, mmc1, and sleep activity.

> I'm not a huge fan of forcing this kind of policy decision down to the
> users, especially for such "generic" boards that don't have any
> labeled LEDs.
>
> I feel like it's a userspace decision, but I don't have a strong
> opinion on this :)

If the LEDs were more distinguishable from each other, I would go for
a default behavior. But that is not the case.

ChenYu

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

* [PATCH 4/6] ARM: dts: sun9i: Add GPIO LEDs for A80 Optimus board
  2014-10-28 21:19     ` Andreas Färber
@ 2014-10-29  2:02       ` Chen-Yu Tsai
  2014-10-30 15:53       ` Maxime Ripard
  1 sibling, 0 replies; 15+ messages in thread
From: Chen-Yu Tsai @ 2014-10-29  2:02 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Wed, Oct 29, 2014 at 5:19 AM, Andreas F?rber <afaerber@suse.de> wrote:
> Hi,
>
> Am 28.10.2014 um 21:16 schrieb Maxime Ripard:
>> Hi Chen-Yu,
>>
>> On Tue, Oct 28, 2014 at 05:50:41PM +0800, Chen-Yu Tsai wrote:
>>> The A80 Optimus board has 3 usable LEDs that are controlled via GPIO.
>>>
>>> This patch adds support for 2 of them which are driver by GPIOs in the
>>> main pin controller. The remaining one uses GPIO from the R_PIO
>>> controller, which we don't support yet.
>>>
>>> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
>>> ---
>>>  arch/arm/boot/dts/sun9i-a80-optimus.dts | 25 +++++++++++++++++++++++++
>>>  1 file changed, 25 insertions(+)
>>>
>>> diff --git a/arch/arm/boot/dts/sun9i-a80-optimus.dts b/arch/arm/boot/dts/sun9i-a80-optimus.dts
>>> index 25fe775..91eda76 100644
>>> --- a/arch/arm/boot/dts/sun9i-a80-optimus.dts
>>> +++ b/arch/arm/boot/dts/sun9i-a80-optimus.dts
>>> @@ -64,6 +64,13 @@
>>>                              /* Enable internal pull-up */
>>>                              allwinner,pull = <1>;
>>>                      };
>>> +
>>> +                    led_pins_optimus: led_pins at 0 {
>
> Here too, led-pins at 0 would be more in line with DT conventions.

Ok. To be fair we were mixing usage in the past, with most of
them using underscores.

>>> +                            allwinner,pins = "PH0", "PH1";
>>> +                            allwinner,function = "gpio_out";
>>> +                            allwinner,drive = <0>;
>>> +                            allwinner,pull = <0>;
>>> +                    };
>>>              };
>>>
>>>              uart0: serial at 07000000 {
>>> @@ -78,4 +85,22 @@
>>>                      status = "okay";
>>>              };
>>>      };
>>> +
>>> +    leds {
>>> +            compatible = "gpio-leds";
>>> +            pinctrl-names = "default";
>>> +            pinctrl-0 = <&led_pins_optimus>;
>>> +
>>> +            led2 {
>>> +                    label = "a80_optimus:led2:usr";
>>
>> We're usually using a dash instead of an underscore as a separator.
>
> I wonder, why a80_? The board is labeled "Allwinner Tech Optimus Board",
> and the Cubietruck LEDs are not prefixed with a20_ either.

IIRC, The board was first marketed as "A80 Optimus Board". Merrii's
website now lists it as "A80 OptimusBoard", while as you said, the
board itself is labeled "Allwinner Tech Optimus Board"

Furthermore, the dts has model = "Merrii A80 Optimus Board".
Anyway, I'll drop the a80_ prefix, unless someone thinks we should
keep it.

>>> +                    gpios = <&pio 7 0 0>;
>>> +            };
>>> +
>>> +            /* led3 is on PM15, in R_PIO */
>>
>> You were saying that there is three LEDs, why start the numbering at
>> 2?
>
> They are labeled "LED2", "LED4", "LED3" right-to-left.
> Additionally there's a "PWR" LED, maybe that counts as number 1...
>
>>> +
>>> +            led4 {
>>> +                    label = "a80_optimus:led4:usr";
>>> +                    gpios = <&pio 7 1 0>;
>>> +            };
>>> +    };
>>>  };
>>
>> The rest of your patchset is fine for me, we just need to get the
>> pinctrl driver merged first :)

Cheers
ChenYu

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

* [PATCH 4/6] ARM: dts: sun9i: Add GPIO LEDs for A80 Optimus board
  2014-10-28 21:19     ` Andreas Färber
  2014-10-29  2:02       ` Chen-Yu Tsai
@ 2014-10-30 15:53       ` Maxime Ripard
  1 sibling, 0 replies; 15+ messages in thread
From: Maxime Ripard @ 2014-10-30 15:53 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Oct 28, 2014 at 10:19:34PM +0100, Andreas F?rber wrote:
> >> +			gpios = <&pio 7 0 0>;
> >> +		};
> >> +
> >> +		/* led3 is on PM15, in R_PIO */
> > 
> > You were saying that there is three LEDs, why start the numbering at
> > 2?
> 
> They are labeled "LED2", "LED4", "LED3" right-to-left.
> Additionally there's a "PWR" LED, maybe that counts as number 1...

I knew I should have looked at my board. That makes perfect sense,
thanks.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141030/56de73d0/attachment.sig>

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

end of thread, other threads:[~2014-10-30 15:53 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-28  9:50 [PATCH 0/6] ARM: sun9i: Enable extra uarts, leds and i2c controllers Chen-Yu Tsai
2014-10-28  9:50 ` [PATCH 1/6] ARM: dts: sun9i: Add i2c controller nodes to a80 dtsi Chen-Yu Tsai
2014-10-28  9:50 ` [PATCH 2/6] ARM: dts: sun9i: Add i2c3 pinmux setting for A80 SoC Chen-Yu Tsai
2014-10-28  9:50 ` [PATCH 3/6] ARM: dts: sun9i: Enable i2c3 on A80 Optimus board Chen-Yu Tsai
2014-10-28  9:50 ` [PATCH 4/6] ARM: dts: sun9i: Add GPIO LEDs for " Chen-Yu Tsai
2014-10-28 11:04   ` [linux-sunxi] " Koen Kooi
2014-10-28 20:27     ` Maxime Ripard
2014-10-29  1:54       ` Chen-Yu Tsai
2014-10-28 20:16   ` Maxime Ripard
2014-10-28 21:19     ` Andreas Färber
2014-10-29  2:02       ` Chen-Yu Tsai
2014-10-30 15:53       ` Maxime Ripard
2014-10-29  1:50     ` Chen-Yu Tsai
2014-10-28  9:50 ` [PATCH 5/6] ARM: dts: sun9i: Add uart4 pinmux setting for A80 SoC Chen-Yu Tsai
2014-10-28  9:50 ` [PATCH 6/6] ARM: dts: sun9i: Enable uart4 for A80 Optimus board Chen-Yu Tsai

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).