Skip to contentSkip to conversation

DT: leds: Improve examples by adding some context

PATCH Applied Rafał Miłecki 2 participants 2 messages Dec 6, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 DT: leds: Improve examples by adding some context

From: Rafał Miłecki <[email protected]>

During my work on some new LED trigger I tried adding example similar to the existing ones which received following comment from Rob:

Quoted 2 lines

It's not really clear in the example this is an LED node as it is incomplete.

Keeping that in mind I suggest adding context for the existing example entries in hope to make documentation more clear.

---
Should this patch go through linux-leds tree?

Richard, Jacek: would you take it?

---
 Documentation/devicetree/bindings/leds/common.txt | 28 +++++++++++++++--------
 1 file changed, 18 insertions(+), 10 deletions(-)
Documentation/devicetree/bindings/leds/common.txt +18 -10
index 696be57..24b6560 100644
@@ -61,16 +61,24 @@ property can be omitted.
 
 Examples:
 
-system-status {
-	label = "Status";
-	linux,default-trigger = "heartbeat";
-	...
+gpio-leds {
+	compatible = "gpio-leds";
+
+	system-status {
+		label = "Status";
+		linux,default-trigger = "heartbeat";
+		gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
+	};
 };
 
-camera-flash {
-	label = "Flash";
-	led-sources = <0>, <1>;
-	led-max-microamp = <50000>;
-	flash-max-microamp = <320000>;
-	flash-max-timeout-us = <500000>;
+max77693-led {
+	compatible = "maxim,max77693-led";
+
+	camera-flash {
+		label = "Flash";
+		led-sources = <0>, <1>;
+		led-max-microamp = <50000>;
+		flash-max-microamp = <320000>;
+		flash-max-timeout-us = <500000>;
+	};
 };
Signature · 6 lines
2.10.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#1 lore raw

Hi Rafał,

Thanks for the patch.

Quoted 49 lines · Rafał Miłecki

From: Rafał Miłecki <[email protected]>

During my work on some new LED trigger I tried adding example similar to the existing ones which received following comment from Rob:

Quoted 2 lines

It's not really clear in the example this is an LED node as it is incomplete.

Keeping that in mind I suggest adding context for the existing example entries in hope to make documentation more clear.

---
Should this patch go through linux-leds tree?

Richard, Jacek: would you take it?

---
 Documentation/devicetree/bindings/leds/common.txt | 28 +++++++++++++++--------
 1 file changed, 18 insertions(+), 10 deletions(-)
Documentation/devicetree/bindings/leds/common.txt +9 -10
index 696be57..24b6560 100644
@@ -61,16 +61,24 @@ property can be omitted.
 
 Examples:
 
-system-status {
-	label = "Status";
-	linux,default-trigger = "heartbeat";
-	...
+gpio-leds {
+	compatible = "gpio-leds";
+
+	system-status {
+		label = "Status";
+		linux,default-trigger = "heartbeat";
+		gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
+	};
 };
 
-camera-flash {
-	label = "Flash";
-	led-sources = <0>, <1>;
-	led-max-microamp = <50000>;
-	flash-max-microamp = <320000>;
-	flash-max-timeout-us = <500000>;
+max77693-led {

Documentation/devicetree/bindings/leds/common.txt property can be omitted. · line 84

Quoted 10 lines
Documentation/devicetree/bindings/leds/common.txt +9 -0
+	compatible = "maxim,max77693-led";
+
+	camera-flash {
+		label = "Flash";
+		led-sources = <0>, <1>;
+		led-max-microamp = <50000>;
+		flash-max-microamp = <320000>;
+		flash-max-timeout-us = <500000>;
+	};
 };

Although this file documents a sub-node properties it will be indeed useful to have the parent node in the example as well.

Applied to the for-4.11 branch of linux-leds.git.

Signature · 6 lines
Best regards,
Jacek Anaszewski
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html