diff mbox

[v4,1/4] Documentation: devicetree: Add document bindings for leds-mt6323

Message ID 1487962041-6548-2-git-send-email-sean.wang@mediatek.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sean Wang Feb. 24, 2017, 6:47 p.m. UTC
From: Sean Wang <sean.wang@mediatek.com>

This patch adds documentation for devicetree bindings
for LED support on MT6323 PMIC

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
---
 .../devicetree/bindings/leds/leds-mt6323.txt       | 64 ++++++++++++++++++++++
 1 file changed, 64 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/leds/leds-mt6323.txt

Comments

Jacek Anaszewski Feb. 26, 2017, 5:35 p.m. UTC | #1
Hi Sean,

Thanks for the update. I have one comment below.

On 02/24/2017 07:47 PM, sean.wang@mediatek.com wrote:
> From: Sean Wang <sean.wang@mediatek.com>
> 
> This patch adds documentation for devicetree bindings
> for LED support on MT6323 PMIC
> 
> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> ---
>  .../devicetree/bindings/leds/leds-mt6323.txt       | 64 ++++++++++++++++++++++
>  1 file changed, 64 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/leds/leds-mt6323.txt
> 
> diff --git a/Documentation/devicetree/bindings/leds/leds-mt6323.txt b/Documentation/devicetree/bindings/leds/leds-mt6323.txt
> new file mode 100644
> index 0000000..950b8c6
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/leds/leds-mt6323.txt
> @@ -0,0 +1,64 @@
> +Device Tree Bindings for LED support on MT6323 PMIC
> +
> +MT6323 LED controller is subfunction provided by
> +MT6323 PMIC, so the LED controllers are defined as
> +the subnode of the function node provided by MT6323
> +PMIC controller that is being defined as one kind of
> +Muti-Function Device (MFD) using shared bus called
> +PMIC wrapper for each subfunction to access remote
> +MT6323 PMIC hardware.
> +
> +For MT6323 MFD bindings see:
> +Documentation/devicetree/bindings/mfd/mt6397.txt
> +For MediaTek PMIC wrapper bindings see:
> +Documentation/devicetree/bindings/soc/mediatek/pwrap.txt
> +
> +There's sub-node for the LED controller that describes
> +the initial behavior for each LED physically and currently
> +only four LED sub-nodes can be supported.
> +
> +Required properties:
> +- compatible : Must be "mediatek,mt6323-led"
> +- reg : LED channel number (0..3)
> +
> +Optional properties:
> +- label : (optional)
> +  see Documentation/devicetree/bindings/leds/common.txt
> +- linux,default-trigger : (optional)
> +  see Documentation/devicetree/bindings/leds/common.txt
> +- default-state: (optional) The initial state of the LED
> +  see Documentation/devicetree/bindings/leds/common.txt
> +
> +Example:
> +
> +&pwrap {
> +	pmic: mt6323 {
> +		compatible = "mediatek,mt6323";
> +		interrupt-parent = <&pio>;
> +		interrupts = <150 IRQ_TYPE_LEVEL_HIGH>;
> +		interrupt-controller;
> +		#interrupt-cells = <2>;
> +
> +		mt6323led: mt6323led{
> +			compatible = "mediatek,mt6323-led";

You require here also:

#address-cells = <1>;
#size-cells = <0>;

Without these entries you should notice a warning from dtc compiler.


> +
> +			led0: isink0 {
> +				reg = <0>;
> +				label = "LED0"
> +				linux,default-trigger = "timer";
> +				default-state = "on";
> +			};
> +			led1: isink1 {
> +				reg = <1>;
> +				label = "LED1";
> +				default-state = "on";
> +			};
> +			led2: isink2 {
> +				reg = <2>;
> +				label = "LED2";
> +				linux,default-trigger = "timer";
> +				default-state = "off";
> +			};
> +		};
> +	};
> +};
>
Rob Herring Feb. 28, 2017, 1:14 a.m. UTC | #2
On Sun, Feb 26, 2017 at 06:35:11PM +0100, Jacek Anaszewski wrote:
> Hi Sean,
> 
> Thanks for the update. I have one comment below.
> 
> On 02/24/2017 07:47 PM, sean.wang@mediatek.com wrote:
> > From: Sean Wang <sean.wang@mediatek.com>
> > 
> > This patch adds documentation for devicetree bindings
> > for LED support on MT6323 PMIC
> > 
> > Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> > ---
> >  .../devicetree/bindings/leds/leds-mt6323.txt       | 64 ++++++++++++++++++++++
> >  1 file changed, 64 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/leds/leds-mt6323.txt
> > 
> > diff --git a/Documentation/devicetree/bindings/leds/leds-mt6323.txt b/Documentation/devicetree/bindings/leds/leds-mt6323.txt
> > new file mode 100644
> > index 0000000..950b8c6
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/leds/leds-mt6323.txt
> > @@ -0,0 +1,64 @@
> > +Device Tree Bindings for LED support on MT6323 PMIC
> > +
> > +MT6323 LED controller is subfunction provided by
> > +MT6323 PMIC, so the LED controllers are defined as
> > +the subnode of the function node provided by MT6323
> > +PMIC controller that is being defined as one kind of
> > +Muti-Function Device (MFD) using shared bus called
> > +PMIC wrapper for each subfunction to access remote
> > +MT6323 PMIC hardware.
> > +
> > +For MT6323 MFD bindings see:
> > +Documentation/devicetree/bindings/mfd/mt6397.txt
> > +For MediaTek PMIC wrapper bindings see:
> > +Documentation/devicetree/bindings/soc/mediatek/pwrap.txt
> > +
> > +There's sub-node for the LED controller that describes
> > +the initial behavior for each LED physically and currently
> > +only four LED sub-nodes can be supported.
> > +
> > +Required properties:
> > +- compatible : Must be "mediatek,mt6323-led"
> > +- reg : LED channel number (0..3)
> > +
> > +Optional properties:
> > +- label : (optional)
> > +  see Documentation/devicetree/bindings/leds/common.txt
> > +- linux,default-trigger : (optional)
> > +  see Documentation/devicetree/bindings/leds/common.txt
> > +- default-state: (optional) The initial state of the LED
> > +  see Documentation/devicetree/bindings/leds/common.txt
> > +
> > +Example:
> > +
> > +&pwrap {
> > +	pmic: mt6323 {
> > +		compatible = "mediatek,mt6323";
> > +		interrupt-parent = <&pio>;
> > +		interrupts = <150 IRQ_TYPE_LEVEL_HIGH>;
> > +		interrupt-controller;
> > +		#interrupt-cells = <2>;
> > +
> > +		mt6323led: mt6323led{
> > +			compatible = "mediatek,mt6323-led";
> 
> You require here also:
> 
> #address-cells = <1>;
> #size-cells = <0>;
> 
> Without these entries you should notice a warning from dtc compiler.
> 
> 
> > +
> > +			led0: isink0 {

Also, these should be "led@0"

> > +				reg = <0>;
> > +				label = "LED0"
> > +				linux,default-trigger = "timer";
> > +				default-state = "on";
> > +			};
> > +			led1: isink1 {
> > +				reg = <1>;
> > +				label = "LED1";
> > +				default-state = "on";
> > +			};
> > +			led2: isink2 {
> > +				reg = <2>;
> > +				label = "LED2";
> > +				linux,default-trigger = "timer";
> > +				default-state = "off";
> > +			};
> > +		};
> > +	};
> > +};
> > 
> 
> -- 
> Best regards,
> Jacek Anaszewski
Rob Herring Feb. 28, 2017, 1:17 a.m. UTC | #3
On Sat, Feb 25, 2017 at 02:47:18AM +0800, sean.wang@mediatek.com wrote:
> From: Sean Wang <sean.wang@mediatek.com>
> 
> This patch adds documentation for devicetree bindings
> for LED support on MT6323 PMIC

Also, please use "dt-bindings: leds: ..." for the subject prefix.

> 
> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> ---
>  .../devicetree/bindings/leds/leds-mt6323.txt       | 64 ++++++++++++++++++++++
>  1 file changed, 64 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/leds/leds-mt6323.txt
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/leds/leds-mt6323.txt b/Documentation/devicetree/bindings/leds/leds-mt6323.txt
new file mode 100644
index 0000000..950b8c6
--- /dev/null
+++ b/Documentation/devicetree/bindings/leds/leds-mt6323.txt
@@ -0,0 +1,64 @@ 
+Device Tree Bindings for LED support on MT6323 PMIC
+
+MT6323 LED controller is subfunction provided by
+MT6323 PMIC, so the LED controllers are defined as
+the subnode of the function node provided by MT6323
+PMIC controller that is being defined as one kind of
+Muti-Function Device (MFD) using shared bus called
+PMIC wrapper for each subfunction to access remote
+MT6323 PMIC hardware.
+
+For MT6323 MFD bindings see:
+Documentation/devicetree/bindings/mfd/mt6397.txt
+For MediaTek PMIC wrapper bindings see:
+Documentation/devicetree/bindings/soc/mediatek/pwrap.txt
+
+There's sub-node for the LED controller that describes
+the initial behavior for each LED physically and currently
+only four LED sub-nodes can be supported.
+
+Required properties:
+- compatible : Must be "mediatek,mt6323-led"
+- reg : LED channel number (0..3)
+
+Optional properties:
+- label : (optional)
+  see Documentation/devicetree/bindings/leds/common.txt
+- linux,default-trigger : (optional)
+  see Documentation/devicetree/bindings/leds/common.txt
+- default-state: (optional) The initial state of the LED
+  see Documentation/devicetree/bindings/leds/common.txt
+
+Example:
+
+&pwrap {
+	pmic: mt6323 {
+		compatible = "mediatek,mt6323";
+		interrupt-parent = <&pio>;
+		interrupts = <150 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-controller;
+		#interrupt-cells = <2>;
+
+		mt6323led: mt6323led{
+			compatible = "mediatek,mt6323-led";
+
+			led0: isink0 {
+				reg = <0>;
+				label = "LED0"
+				linux,default-trigger = "timer";
+				default-state = "on";
+			};
+			led1: isink1 {
+				reg = <1>;
+				label = "LED1";
+				default-state = "on";
+			};
+			led2: isink2 {
+				reg = <2>;
+				label = "LED2";
+				linux,default-trigger = "timer";
+				default-state = "off";
+			};
+		};
+	};
+};