* [RFT PATCH 1/1] ARM64: dts: meson-gxbb: convert devices to use pwm-leds
2017-03-18 14:37 [RFT PATCH 0/1] Meson GXBB: use pwm-leds on supported devices Martin Blumenstingl
@ 2017-03-18 14:37 ` Martin Blumenstingl
2017-03-20 8:43 ` [RFT PATCH 0/1] Meson GXBB: use pwm-leds on supported devices Neil Armstrong
1 sibling, 0 replies; 4+ messages in thread
From: Martin Blumenstingl @ 2017-03-18 14:37 UTC (permalink / raw)
To: linus-amlogic
All supported GXBB devices have their system LED connected to GPIOAO_13.
This pin can be driven by the PWM_AO controller (PWM_AO_B). Use the
pwm-leds driver (instead of gpio-leds) for these LEDs instead to enable
dimming (setting the brightness).
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
.../boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts | 18 +++++++++++----
.../arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts | 16 ++++++++++---
.../boot/dts/amlogic/meson-gxbb-vega-s95.dtsi | 17 ++++++++++----
.../boot/dts/amlogic/meson-gxbb-wetek-hub.dts | 19 +++++++++++----
.../boot/dts/amlogic/meson-gxbb-wetek-play2.dts | 27 ++++++++++++++++------
5 files changed, 74 insertions(+), 23 deletions(-)
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts
index dbfa441f479e..283dad3b0be3 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts
@@ -65,12 +65,14 @@
reg = <0x0 0x0 0x0 0x40000000>;
};
- leds {
- compatible = "gpio-leds";
+ pwmleds {
+ compatible = "pwm-leds";
+
blue {
label = "a95x:system-status";
- gpios = <&gpio_ao GPIOAO_13 GPIO_ACTIVE_LOW>;
- linux,default-trigger = "heartbeat";
+ pwms = <&pwm_AO_ab 1 7812500 0>;
+ max-brightness = <255>;
+ linux,default-trigger = "default-on";
default-state = "off";
};
};
@@ -249,6 +251,14 @@
vqmmc-supply = <&vddio_boot>;
};
+&pwm_AO_ab {
+ status = "okay";
+ pinctrl-0 = <&pwm_ao_b_pins>;
+ pinctrl-names = "default";
+ clocks = <&clkc CLKID_FCLK_DIV4>;
+ clock-names = "clkin0";
+};
+
&pwm_ef {
status = "okay";
pinctrl-0 = <&pwm_e_pins>;
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
index c80d3a913907..7f9de1b236ed 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
@@ -76,11 +76,13 @@
enable-active-high;
};
- leds {
- compatible = "gpio-leds";
+ pwmleds {
+ compatible = "pwm-leds";
+
blue {
label = "c2:blue:alive";
- gpios = <&gpio_ao GPIOAO_13 GPIO_ACTIVE_LOW>;
+ pwms = <&pwm_AO_ab 1 7812500 0>;
+ max-brightness = <255>;
linux,default-trigger = "heartbeat";
default-state = "off";
};
@@ -201,6 +203,14 @@
status = "okay";
};
+&pwm_AO_ab {
+ status = "okay";
+ pinctrl-0 = <&pwm_ao_b_pins>;
+ pinctrl-names = "default";
+ clocks = <&clkc CLKID_FCLK_DIV4>;
+ clock-names = "clkin0";
+};
+
/* SD */
&sd_emmc_b {
status = "okay";
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi
index aefa66dff72d..6b9608e5a488 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi
@@ -53,13 +53,14 @@
stdout-path = "serial0:115200n8";
};
- leds {
- compatible = "gpio-leds";
+ pwmleds {
+ compatible = "pwm-leds";
blue {
label = "vega-s95:blue:on";
- gpios = <&gpio_ao GPIOAO_13 GPIO_ACTIVE_HIGH>;
- default-state = "on";
+ pwms = <&pwm_AO_ab 1 7812500 0>;
+ max-brightness = <255>;
+ linux,default-trigger = "default-on";
panic-indicator;
};
};
@@ -229,6 +230,14 @@
vmmcq-sumpply = <&vcc_1v8>;
};
+&pwm_AO_ab {
+ status = "okay";
+ pinctrl-0 = <&pwm_ao_b_pins>;
+ pinctrl-names = "default";
+ clocks = <&clkc CLKID_FCLK_DIV4>;
+ clock-names = "clkin0";
+};
+
&pwm_ef {
status = "okay";
pinctrl-0 = <&pwm_e_pins>;
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-hub.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-hub.dts
index f057fb48fee5..1d94e2d4c927 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-hub.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-hub.dts
@@ -49,13 +49,14 @@
compatible = "wetek,hub", "amlogic,meson-gxbb";
model = "WeTek Hub";
- leds {
- compatible = "gpio-leds";
+ pwmleds {
+ compatible = "pwm-leds";
system {
- label = "wetek-play:system-status";
- gpios = <&gpio_ao GPIOAO_13 GPIO_ACTIVE_HIGH>;
- default-state = "on";
+ label = "wetek-hub:system-status";
+ pwms = <&pwm_AO_ab 1 7812500 0>;
+ max-brightness = <255>;
+ linux,default-trigger = "default-on";
panic-indicator;
};
};
@@ -90,3 +91,11 @@
};
};
};
+
+&pwm_AO_ab {
+ status = "okay";
+ pinctrl-0 = <&pwm_ao_b_pins>;
+ pinctrl-names = "default";
+ clocks = <&clkc CLKID_FCLK_DIV4>;
+ clock-names = "clkin0";
+};
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-play2.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-play2.dts
index 743acb5f5d06..5114d645d733 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-play2.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-play2.dts
@@ -53,13 +53,6 @@
leds {
compatible = "gpio-leds";
- system {
- label = "wetek-play:system-status";
- gpios = <&gpio_ao GPIOAO_13 GPIO_ACTIVE_HIGH>;
- default-state = "on";
- panic-indicator;
- };
-
wifi {
label = "wetek-play:wifi-status";
gpios = <&gpio GPIODV_26 GPIO_ACTIVE_HIGH>;
@@ -73,6 +66,18 @@
};
};
+ pwmleds {
+ compatible = "pwm-leds";
+
+ system {
+ label = "wetek-play:system-status";
+ pwms = <&pwm_AO_ab 1 7812500 0>;
+ max-brightness = <255>;
+ linux,default-trigger = "default-on";
+ panic-indicator;
+ };
+ };
+
gpio-keys-polled {
compatible = "gpio-keys-polled";
#address-cells = <1>;
@@ -118,3 +123,11 @@
pinctrl-0 = <&i2c_a_pins>;
pinctrl-names = "default";
};
+
+&pwm_AO_ab {
+ status = "okay";
+ pinctrl-0 = <&pwm_ao_b_pins>;
+ pinctrl-names = "default";
+ clocks = <&clkc CLKID_FCLK_DIV4>;
+ clock-names = "clkin0";
+};
--
2.12.0
^ permalink raw reply [flat|nested] 4+ messages in thread* [RFT PATCH 0/1] Meson GXBB: use pwm-leds on supported devices
2017-03-18 14:37 [RFT PATCH 0/1] Meson GXBB: use pwm-leds on supported devices Martin Blumenstingl
2017-03-18 14:37 ` [RFT PATCH 1/1] ARM64: dts: meson-gxbb: convert devices to use pwm-leds Martin Blumenstingl
@ 2017-03-20 8:43 ` Neil Armstrong
2017-03-20 19:56 ` Martin Blumenstingl
1 sibling, 1 reply; 4+ messages in thread
From: Neil Armstrong @ 2017-03-20 8:43 UTC (permalink / raw)
To: linus-amlogic
On 03/18/2017 03:37 PM, Martin Blumenstingl wrote:
> This patch enables brightness support through the pwm-leds driver for
> the GXBB devices which use GPIOAO_13 for their system/status LED.
>
> Affected devices are:
> - NEXBOX A95X (GXBB, S905 variant)
> - Odroid-C2
> - the Tronsmart Vega S95 series (Meta, Pro, Telos)
> - WeTek Hub
> - WeTek Play 2
>
> unfortunately my GXBB board (a Tronsmart Vega S95 Meta clone) is not
> working anymore, so I can't test this at all.
> if it works on one of the devices then we can probably assume that it
> works fine on all other devices as well.
>
>
> Martin Blumenstingl (1):
> ARM64: dts: meson-gxbb: convert devices to use pwm-leds
>
> .../boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts | 18 +++++++++++----
> .../arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts | 16 ++++++++++---
> .../boot/dts/amlogic/meson-gxbb-vega-s95.dtsi | 17 ++++++++++----
> .../boot/dts/amlogic/meson-gxbb-wetek-hub.dts | 19 +++++++++++----
> .../boot/dts/amlogic/meson-gxbb-wetek-play2.dts | 27 ++++++++++++++++------
> 5 files changed, 74 insertions(+), 23 deletions(-)
>
Hi Martin,
I'm concerned about how the LED is managed by the firmware.
The system led is usually managed by the firmware and color is changed
when in suspend or poweroff mode.
But I'm not sure of the behavior if the pin mode is set to PWM.
Can you check this ?
Thanks,
Neil
^ permalink raw reply [flat|nested] 4+ messages in thread