diff mbox

[10/12] ARM: dts: dragonboard-600c: Add on board leds support

Message ID 1458762484-9768-1-git-send-email-srinivas.kandagatla@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Srinivas Kandagatla March 23, 2016, 7:48 p.m. UTC
This patch adds support to 4 user leds, wlan and bt led on board.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 .../arm/boot/dts/qcom-apq8064-dragonboard-600c.dts | 76 ++++++++++++++++++++++
 1 file changed, 76 insertions(+)

Comments

Nicolas Dechesne March 24, 2016, 4:51 p.m. UTC | #1
On Wed, Mar 23, 2016 at 8:48 PM, Srinivas Kandagatla
<srinivas.kandagatla@linaro.org> wrote:
> +                       led@1 {
> +                               label = "dragonboard-600c:green:user1";
> +                               gpios = <&tlmm_pinmux 3 GPIO_ACTIVE_HIGH>;
> +                               linux,default-trigger = "heartbeat";
> +                               default-state = "off";
> +                       };
> +
> +                       led@2 {
> +                               label = "dragonboard-600c:green:user2";
> +                               gpios = <&tlmm_pinmux 7 GPIO_ACTIVE_HIGH>;
> +                               linux,default-trigger = "mmc0";
> +                               default-state = "off";
> +                       };
> +
> +                       led@3 {
> +                               label = "dragonboard-600c:green:user3";
> +                               gpios = <&tlmm_pinmux 10 GPIO_ACTIVE_HIGH>;
> +                               linux,default-trigger = "mmc1";
> +                               default-state = "off";
> +                       };
> +
> +                       led@4 {
> +                               label = "apq8016-sbc:green:user4";

typo ^^

> +                               gpios = <&tlmm_pinmux 11 GPIO_ACTIVE_HIGH>;
> +                               linux,default-trigger = "none";
> +                               default-state = "off";
> +                       };

also, if i read the 96boards specs correctly, the LED are labeled
3-2-1-0 , if you look at the board with the LEDs on the bottom. With
this DT config, you end up with 0-1-2-3 instead.

also, they should be labeled 0 to 3, not 1 to 4.
Bjorn Andersson March 27, 2016, 5:50 a.m. UTC | #2
On Wed 23 Mar 12:48 PDT 2016, Srinivas Kandagatla wrote:

> This patch adds support to 4 user leds, wlan and bt led on board.
> 
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

I'm not fond of the overly complicated names; and I think it should at
least be shortened to "db600c:...".

Tested this on my DB600c, seems to work, except the WiFi/BT triggers,
see comments below.

> +		leds {
> +			pinctrl-names = "default";
> +			pinctrl-0 = <&user_leds>, <&mpp_leds>;
> +
> +			compatible = "gpio-leds";
> +
> +			led@1 {
> +				label = "dragonboard-600c:green:user1";
> +				gpios = <&tlmm_pinmux 3 GPIO_ACTIVE_HIGH>;
> +				linux,default-trigger = "heartbeat";
> +				default-state = "off";
> +			};
> +
> +			led@2 {
> +				label = "dragonboard-600c:green:user2";
> +				gpios = <&tlmm_pinmux 7 GPIO_ACTIVE_HIGH>;
> +				linux,default-trigger = "mmc0";
> +				default-state = "off";
> +			};
> +
> +			led@3 {
> +				label = "dragonboard-600c:green:user3";
> +				gpios = <&tlmm_pinmux 10 GPIO_ACTIVE_HIGH>;
> +				linux,default-trigger = "mmc1";
> +				default-state = "off";
> +			};
> +
> +			led@4 {
> +				label = "apq8016-sbc:green:user4";
> +				gpios = <&tlmm_pinmux 11 GPIO_ACTIVE_HIGH>;
> +				linux,default-trigger = "none";
> +				default-state = "off";
> +			};
> +
> +			led@5 {
> +				label = "dragonboard-600c:yellow:wlan";
> +				gpios = <&pm8921_mpps 7 GPIO_ACTIVE_HIGH>;
> +				linux,default-trigger = "wlan";

This should either be "phy0rx", "phy0tx", "phy0assoc" or "phy0radio". TX
does not seem to work, so this should be debugged; "assoc" is probably
the one that makes most sense.

> +				default-state = "off";
> +			};
> +
> +			led@6 {
> +				label = "dragonboard-600c:blue:bt";
> +				gpios = <&pm8921_mpps 8 GPIO_ACTIVE_HIGH>;
> +				linux,default-trigger = "bt";

This should be "hci0-power".

> +				default-state = "off";
> +			};
> +		};
> +

Regards,
Bjorn
Srinivas Kandagatla March 29, 2016, 1:30 p.m. UTC | #3
Thanks Nico,

On 24/03/16 16:51, Nicolas Dechesne wrote:
> On Wed, Mar 23, 2016 at 8:48 PM, Srinivas Kandagatla
> <srinivas.kandagatla@linaro.org> wrote:
>> +                       led@1 {
>> +                               label = "dragonboard-600c:green:user1";
>> +                               gpios = <&tlmm_pinmux 3 GPIO_ACTIVE_HIGH>;
>> +                               linux,default-trigger = "heartbeat";
>> +                               default-state = "off";
>> +                       };
>> +
>> +                       led@2 {
>> +                               label = "dragonboard-600c:green:user2";
>> +                               gpios = <&tlmm_pinmux 7 GPIO_ACTIVE_HIGH>;
>> +                               linux,default-trigger = "mmc0";
>> +                               default-state = "off";
>> +                       };
>> +
>> +                       led@3 {
>> +                               label = "dragonboard-600c:green:user3";
>> +                               gpios = <&tlmm_pinmux 10 GPIO_ACTIVE_HIGH>;
>> +                               linux,default-trigger = "mmc1";
>> +                               default-state = "off";
>> +                       };
>> +
>> +                       led@4 {
>> +                               label = "apq8016-sbc:green:user4";
>
> typo ^^
>
Yep, Will fix this.
>> +                               gpios = <&tlmm_pinmux 11 GPIO_ACTIVE_HIGH>;
>> +                               linux,default-trigger = "none";
>> +                               default-state = "off";
>> +                       };
>
> also, if i read the 96boards specs correctly, the LED are labeled
> 3-2-1-0 , if you look at the board with the LEDs on the bottom. With
> this DT config, you end up with 0-1-2-3 instead.
>
> also, they should be labeled 0 to 3, not 1 to 4.

I agree Will fix it. The structure was copied from the 8016.

Its strange that DB410c LEDS labels on the board are from 1 to 4 rather 
than 0 to 3, on the other hand DB600c does not have any labels as such.

For Now I can change DB600c to start with 0 rather than 1.


>
Srinivas Kandagatla March 29, 2016, 2:20 p.m. UTC | #4
Thanks Bjorn,

On 27/03/16 06:50, Bjorn Andersson wrote:
> On Wed 23 Mar 12:48 PDT 2016, Srinivas Kandagatla wrote:
>
>> This patch adds support to 4 user leds, wlan and bt led on board.
>>
>> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>
> I'm not fond of the overly complicated names; and I think it should at
> least be shortened to "db600c:...".

I agree, I will fix this in next version.

>
> Tested this on my DB600c, seems to work, except the WiFi/BT triggers,
> see comments below.
>
>> +		leds {
>> +			pinctrl-names = "default";
>> +			pinctrl-0 = <&user_leds>, <&mpp_leds>;
>> +
>> +			compatible = "gpio-leds";
>> +
>> +			led@1 {
>> +				label = "dragonboard-600c:green:user1";
>> +				gpios = <&tlmm_pinmux 3 GPIO_ACTIVE_HIGH>;
>> +				linux,default-trigger = "heartbeat";
>> +				default-state = "off";
>> +			};
>> +
>> +			led@2 {
>> +				label = "dragonboard-600c:green:user2";
>> +				gpios = <&tlmm_pinmux 7 GPIO_ACTIVE_HIGH>;
>> +				linux,default-trigger = "mmc0";
>> +				default-state = "off";
>> +			};
>> +
>> +			led@3 {
>> +				label = "dragonboard-600c:green:user3";
>> +				gpios = <&tlmm_pinmux 10 GPIO_ACTIVE_HIGH>;
>> +				linux,default-trigger = "mmc1";
>> +				default-state = "off";
>> +			};
>> +
>> +			led@4 {
>> +				label = "apq8016-sbc:green:user4";
>> +				gpios = <&tlmm_pinmux 11 GPIO_ACTIVE_HIGH>;
>> +				linux,default-trigger = "none";
>> +				default-state = "off";
>> +			};
>> +
>> +			led@5 {
>> +				label = "dragonboard-600c:yellow:wlan";
>> +				gpios = <&pm8921_mpps 7 GPIO_ACTIVE_HIGH>;
>> +				linux,default-trigger = "wlan";
>
> This should either be "phy0rx", "phy0tx", "phy0assoc" or "phy0radio". TX
> does not seem to work, so this should be debugged; "assoc" is probably
> the one that makes most sense.


Am ok, to change, did you get activity leds works with any of these 
strings with WLAN or BT?

phy0rx/tx seems to be bit more generic and atleast the name looks bit 
non-specific to wlan.

These names should be documented somewhere, Its very difficult to find 
which names to use unless you read the code.

It would be nice to just provide a phandle to the device which 
led-trigger should use, which makes it clear and explicit.



>
>> +				default-state = "off";
>> +			};
>> +
>> +			led@6 {
>> +				label = "dragonboard-600c:blue:bt";
>> +				gpios = <&pm8921_mpps 8 GPIO_ACTIVE_HIGH>;
>> +				linux,default-trigger = "bt";
>
> This should be "hci0-power".

Does this trigger work for you?
Name is bit misleading though.

Thanks,
srini
>
>> +				default-state = "off";
>> +			};
>> +		};
>> +
>
> Regards,
> Bjorn
>
Bjorn Andersson March 29, 2016, 2:51 p.m. UTC | #5
On Tue 29 Mar 07:20 PDT 2016, Srinivas Kandagatla wrote:

> Thanks Bjorn,
> 
> On 27/03/16 06:50, Bjorn Andersson wrote:
> >On Wed 23 Mar 12:48 PDT 2016, Srinivas Kandagatla wrote:
[..]
> >>+
> >>+			led@5 {
> >>+				label = "dragonboard-600c:yellow:wlan";
> >>+				gpios = <&pm8921_mpps 7 GPIO_ACTIVE_HIGH>;
> >>+				linux,default-trigger = "wlan";
> >
> >This should either be "phy0rx", "phy0tx", "phy0assoc" or "phy0radio". TX
> >does not seem to work, so this should be debugged; "assoc" is probably
> >the one that makes most sense.
> 
> 
> Am ok, to change, did you get activity leds works with any of these strings
> with WLAN or BT?
> 

I did test them; rx, assoc and radio seems to work. Tx does not tickle
the led, but should probably.

I didn't find the spec for the baord, so I'm not sure what the LEDs
should indicate. But it feels like radio or assoc makes most sense, and
follows what we can do with the BT led.

> phy0rx/tx seems to be bit more generic and atleast the name looks bit
> non-specific to wlan.
> 
> These names should be documented somewhere, Its very difficult to find which
> names to use unless you read the code.
> 
> It would be nice to just provide a phandle to the device which led-trigger
> should use, which makes it clear and explicit.
> 

I agree, I was surprised by their naming. The phandle solution would
have been nice, except that you have no way from sysfs to pick which
node to follow.

> 
> 
> >
> >>+				default-state = "off";
> >>+			};
> >>+
> >>+			led@6 {
> >>+				label = "dragonboard-600c:blue:bt";
> >>+				gpios = <&pm8921_mpps 8 GPIO_ACTIVE_HIGH>;
> >>+				linux,default-trigger = "bt";
> >
> >This should be "hci0-power".
> 
> Does this trigger work for you?
> Name is bit misleading though.
> 

I don't think I tested it, but it is the only bt led trigger exposed by
the bluetooth framework. I don't think we have any other hci devices on
this board, so it should be fine.

Regards,
Bjorn
Nicolas Dechesne March 29, 2016, 6:32 p.m. UTC | #6
On Tue, Mar 29, 2016 at 4:51 PM, Bjorn Andersson
<bjorn.andersson@linaro.org> wrote:
>> Am ok, to change, did you get activity leds works with any of these strings
>> with WLAN or BT?
>>
>
> I did test them; rx, assoc and radio seems to work. Tx does not tickle
> the led, but should probably.
>
> I didn't find the spec for the baord, so I'm not sure what the LEDs
> should indicate. But it feels like radio or assoc makes most sense, and
> follows what we can do with the BT led.

this is in the 96boards 'specs' at [1], which states

-
The User LEDs shall be directly programmable from the SoC.
1. WiFi activity LED
2. Bluetooth activity LED
-

[1] http://www.96boards.org/ce-specification
Bjorn Andersson March 29, 2016, 9:10 p.m. UTC | #7
On Tue 29 Mar 11:32 PDT 2016, Nicolas Dechesne wrote:

> On Tue, Mar 29, 2016 at 4:51 PM, Bjorn Andersson
> <bjorn.andersson@linaro.org> wrote:
> >> Am ok, to change, did you get activity leds works with any of these strings
> >> with WLAN or BT?
> >>
> >
> > I did test them; rx, assoc and radio seems to work. Tx does not tickle
> > the led, but should probably.
> >
> > I didn't find the spec for the baord, so I'm not sure what the LEDs
> > should indicate. But it feels like radio or assoc makes most sense, and
> > follows what we can do with the BT led.
> 
> this is in the 96boards 'specs' at [1], which states
> 
> -
> The User LEDs shall be directly programmable from the SoC.
> 1. WiFi activity LED
> 2. Bluetooth activity LED
> -
> 
> [1] http://www.96boards.org/ce-specification

Thanks Nico. I presume "activity" here means it should be off and blink
upon data being transmitted in either direction?

Sounds like we need to plan some work to extend the existing triggers
with a phyXactivity and hciX-activity.


For now I think we should go with phy0assoc and hci-power though, so we
have something related to WiFi and BT.

Regards,
Bjorn
Rob Herring March 30, 2016, 12:54 p.m. UTC | #8
On Sun, Mar 27, 2016 at 12:50 AM, Bjorn Andersson
<bjorn.andersson@linaro.org> wrote:
> On Wed 23 Mar 12:48 PDT 2016, Srinivas Kandagatla wrote:
>
>> This patch adds support to 4 user leds, wlan and bt led on board.
>>
>> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>
> I'm not fond of the overly complicated names; and I think it should at
> least be shortened to "db600c:...".

These names are exposed to userspace. They should be the same across
all 96boards. Same goes for UART numbering and I2C bus labels on the
connector.

> Tested this on my DB600c, seems to work, except the WiFi/BT triggers,
> see comments below.
>
>> +             leds {
>> +                     pinctrl-names = "default";
>> +                     pinctrl-0 = <&user_leds>, <&mpp_leds>;
>> +
>> +                     compatible = "gpio-leds";
>> +
>> +                     led@1 {

unit-address w/o reg property will warn on new dtc. I'd suggest
something like "userX-led".


>> +                             label = "dragonboard-600c:green:user1";
>> +                             gpios = <&tlmm_pinmux 3 GPIO_ACTIVE_HIGH>;
>> +                             linux,default-trigger = "heartbeat";
>> +                             default-state = "off";
>> +                     };
diff mbox

Patch

diff --git a/arch/arm/boot/dts/qcom-apq8064-dragonboard-600c.dts b/arch/arm/boot/dts/qcom-apq8064-dragonboard-600c.dts
index 52f742c..4fecd94 100644
--- a/arch/arm/boot/dts/qcom-apq8064-dragonboard-600c.dts
+++ b/arch/arm/boot/dts/qcom-apq8064-dragonboard-600c.dts
@@ -53,6 +53,33 @@ 
 					bias-disable;
 				};
 			};
+
+			user_leds: user_leds {
+				mux {
+					pins = "gpio3", "gpio7", "gpio10", "gpio11";
+					function = "gpio";
+				};
+
+				conf {
+					pins = "gpio3", "gpio7", "gpio10", "gpio11";
+					function = "gpio";
+					output-low;
+				};
+			};
+		};
+
+		qcom,ssbi@500000 {
+			pmic@0 {
+				mpps@50 {
+					mpp_leds: mpp_leds {
+						pinconf {
+							pins = "mpp7", "mpp8";
+							function = "digital";
+							output-low;
+						};
+					};
+				};
+			};
 		};
 
 		rpm@108000 {
@@ -165,6 +192,55 @@ 
 			};
 		};
 
+		leds {
+			pinctrl-names = "default";
+			pinctrl-0 = <&user_leds>, <&mpp_leds>;
+
+			compatible = "gpio-leds";
+
+			led@1 {
+				label = "dragonboard-600c:green:user1";
+				gpios = <&tlmm_pinmux 3 GPIO_ACTIVE_HIGH>;
+				linux,default-trigger = "heartbeat";
+				default-state = "off";
+			};
+
+			led@2 {
+				label = "dragonboard-600c:green:user2";
+				gpios = <&tlmm_pinmux 7 GPIO_ACTIVE_HIGH>;
+				linux,default-trigger = "mmc0";
+				default-state = "off";
+			};
+
+			led@3 {
+				label = "dragonboard-600c:green:user3";
+				gpios = <&tlmm_pinmux 10 GPIO_ACTIVE_HIGH>;
+				linux,default-trigger = "mmc1";
+				default-state = "off";
+			};
+
+			led@4 {
+				label = "apq8016-sbc:green:user4";
+				gpios = <&tlmm_pinmux 11 GPIO_ACTIVE_HIGH>;
+				linux,default-trigger = "none";
+				default-state = "off";
+			};
+
+			led@5 {
+				label = "dragonboard-600c:yellow:wlan";
+				gpios = <&pm8921_mpps 7 GPIO_ACTIVE_HIGH>;
+				linux,default-trigger = "wlan";
+				default-state = "off";
+			};
+
+			led@6 {
+				label = "dragonboard-600c:blue:bt";
+				gpios = <&pm8921_mpps 8 GPIO_ACTIVE_HIGH>;
+				linux,default-trigger = "bt";
+				default-state = "off";
+			};
+		};
+
 		pci@1b500000 {
 			status = "okay";
 			vdda-supply = <&pm8921_s3>;