diff mbox series

[v1,2/2] mfd: rt4505: Adds DT binding document for Richtek RT4831 MFD core

Message ID 1604286803-20698-2-git-send-email-u0084500@gmail.com
State Superseded
Headers show
Series None | expand

Commit Message

cy_huang Nov. 2, 2020, 3:13 a.m. UTC
From: ChiYuan Huang <cy_huang@richtek.com>

Adds DT binding document for Richtek RT4831 MFD core.

Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
---
 .../devicetree/bindings/mfd/richtek,rt4831.yaml    | 89 ++++++++++++++++++++++
 include/dt-bindings/leds/rt4831-backlight.h        | 23 ++++++
 2 files changed, 112 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/richtek,rt4831.yaml
 create mode 100644 include/dt-bindings/leds/rt4831-backlight.h

Comments

cy_huang Nov. 2, 2020, 5:53 a.m. UTC | #1
Hi,
  I seems I typo the wrong comment headline, not RT4505. It's RT4831.
Please just review the contents, I'll fix it in next series patch.


cy_huang <u0084500@gmail.com> 於 2020年11月2日 週一 上午11:13寫道:
>

> From: ChiYuan Huang <cy_huang@richtek.com>

>

> Adds DT binding document for Richtek RT4831 MFD core.

>

> Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>

> ---

>  .../devicetree/bindings/mfd/richtek,rt4831.yaml    | 89 ++++++++++++++++++++++

>  include/dt-bindings/leds/rt4831-backlight.h        | 23 ++++++

>  2 files changed, 112 insertions(+)

>  create mode 100644 Documentation/devicetree/bindings/mfd/richtek,rt4831.yaml

>  create mode 100644 include/dt-bindings/leds/rt4831-backlight.h

>

> diff --git a/Documentation/devicetree/bindings/mfd/richtek,rt4831.yaml b/Documentation/devicetree/bindings/mfd/richtek,rt4831.yaml

> new file mode 100644

> index 00000000..c602d50

> --- /dev/null

> +++ b/Documentation/devicetree/bindings/mfd/richtek,rt4831.yaml

> @@ -0,0 +1,89 @@

> +# SPDX-License-Identifier: GPL-2.0

> +%YAML 1.2

> +---

> +$id: http://devicetree.org/schemas/mfd/richtek,rt4831.yaml#

> +$schema: http://devicetree.org/meta-schemas/core.yaml#

> +

> +title: Richtek RT4831 DSV and Backlight Integrated IC

> +

> +maintainers:

> +  - ChiYuan Huang <cy_huang@richtek.com>

> +

> +description: |

> +  RT4831 is a mutifunctional device that can provide display panel power for

> +  positive/negative voltage and also display panel wled driving.

> +

> +  For the display voltage output, the range is about 4V to 6.5V. It is sufficient

> +  to meet the current display panel design.

> +

> +  For the panel backlight, it can provide four channels driving capability

> +  Each driving current is up to 30mA

> +

> +  Datasheet is available at

> +  https://www.richtek.com/assets/product_file/RT4831A/DS4831A-05.pdf

> +

> +properties:

> +  compatible:

> +    const: richtek,rt4831

> +

> +  reg:

> +    description: I2C device address.

> +    maxItems: 1

> +

> +  enable-gpios:

> +    description: |

> +      GPIO to enable/disable the chip. It is optional.

> +      Some usage directly tied this pin to follow VIO 1.8V power on sequence.

> +    maxItems: 1

> +

> +  regulators:

> +    $ref: ../regulator/richtek,rt4831-regulator.yaml

> +

> +  backlight:

> +    $ref: ../leds/backlight/richtek,rt4831-backlight.yaml

> +

> +required:

> +  - compatible

> +  - reg

> +

> +additionalProperties: false

> +

> +examples:

> +  - |

> +    #include <dt-bindings/leds/rt4831-backlight.h>

> +    i2c {

> +      #address-cells = <1>;

> +      #size-cells = <0>;

> +

> +      rt4831@11 {

> +        compatible = "richtek,rt4831";

> +        reg = <0x11>;

> +

> +        regulators {

> +          DSVLCM {

> +            regulator-min-microvolt = <4000000>;

> +            regulator-max-microvolt = <7150000>;

> +          };

> +          DSVP {

> +            regulator-name = "rt4831-dsvp";

> +            regulator-min-microvolt = <4000000>;

> +            regulator-max-microvolt = <6500000>;

> +            regulator-boot-on;

> +          };

> +          DSVN {

> +            regulator-name = "rt4831-dsvn";

> +            regulator-min-microvolt = <4000000>;

> +            regulator-max-microvolt = <6500000>;

> +            regulator-boot-on;

> +          };

> +        };

> +

> +        backlight {

> +          compatible = "richtek,rt4831-backlight";

> +          default-brightness = <1024>;

> +          max-brightness = <2048>;

> +          richtek,bled-ovp-sel = /bits/ 8 <RT4831_BLOVPLVL_21V>;

> +          richtek,channel-use = /bits/ 8 <RT4831_BLED_ALLCHEN>;

> +        };

> +      };

> +    };

> diff --git a/include/dt-bindings/leds/rt4831-backlight.h b/include/dt-bindings/leds/rt4831-backlight.h

> new file mode 100644

> index 00000000..7084906

> --- /dev/null

> +++ b/include/dt-bindings/leds/rt4831-backlight.h

> @@ -0,0 +1,23 @@

> +/*

> + * This header provides constants for rt4831 backlight bindings.

> + *

> + * This file is licensed under the terms of the GNU General Public

> + * License version 2.  This program is licensed "as is" without any

> + * warranty of any kind, whether express or implied.

> + */

> +

> +#ifndef _DT_BINDINGS_RT4831_BACKLIGHT_H

> +#define _DT_BINDINGS_RT4831_BACKLIGHT_H

> +

> +#define RT4831_BLOVPLVL_17V    0

> +#define RT4831_BLOVPLVL_21V    1

> +#define RT4831_BLOVPLVL_25V    2

> +#define RT4831_BLOVPLVL_29V    3

> +

> +#define RT4831_BLED_CH1EN      (1 << 0)

> +#define RT4831_BLED_CH2EN      (1 << 1)

> +#define RT4831_BLED_CH3EN      (1 << 2)

> +#define RT4831_BLED_CH4EN      (1 << 3)

> +#define RT4831_BLED_ALLCHEN    ((1 << 4) - 1)

> +

> +#endif /* _DT_BINDINGS_RT4831_BACKLIGHT_H */

> --

> 2.7.4

>
Rob Herring Nov. 2, 2020, 5:21 p.m. UTC | #2
On Mon, 02 Nov 2020 11:13:23 +0800, cy_huang wrote:
> From: ChiYuan Huang <cy_huang@richtek.com>

> 

> Adds DT binding document for Richtek RT4831 MFD core.

> 

> Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>

> ---

>  .../devicetree/bindings/mfd/richtek,rt4831.yaml    | 89 ++++++++++++++++++++++

>  include/dt-bindings/leds/rt4831-backlight.h        | 23 ++++++

>  2 files changed, 112 insertions(+)

>  create mode 100644 Documentation/devicetree/bindings/mfd/richtek,rt4831.yaml

>  create mode 100644 include/dt-bindings/leds/rt4831-backlight.h

> 



My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Unknown file referenced: [Errno 2] No such file or directory: '/usr/local/lib/python3.8/dist-packages/dtschema/schemas/regulator/richtek,rt4831-regulator.yaml'
xargs: dt-doc-validate: exited with status 255; aborting
make[1]: *** [Documentation/devicetree/bindings/Makefile:59: Documentation/devicetree/bindings/processed-schema-examples.json] Error 124
make: *** [Makefile:1364: dt_binding_check] Error 2


See https://patchwork.ozlabs.org/patch/1391911

The base for the patch is generally the last rc1. Any dependencies
should be noted.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit.
cy_huang Nov. 3, 2020, 1:14 a.m. UTC | #3
Rob Herring <robh@kernel.org> 於 2020年11月3日 週二 上午1:21寫道:
>

> On Mon, 02 Nov 2020 11:13:23 +0800, cy_huang wrote:

> > From: ChiYuan Huang <cy_huang@richtek.com>

> >

> > Adds DT binding document for Richtek RT4831 MFD core.

> >

> > Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>

> > ---

> >  .../devicetree/bindings/mfd/richtek,rt4831.yaml    | 89 ++++++++++++++++++++++

> >  include/dt-bindings/leds/rt4831-backlight.h        | 23 ++++++

> >  2 files changed, 112 insertions(+)

> >  create mode 100644 Documentation/devicetree/bindings/mfd/richtek,rt4831.yaml

> >  create mode 100644 include/dt-bindings/leds/rt4831-backlight.h

> >

>

>

> My bot found errors running 'make dt_binding_check' on your patch:

>

> yamllint warnings/errors:

>

> dtschema/dtc warnings/errors:

> Unknown file referenced: [Errno 2] No such file or directory: '/usr/local/lib/python3.8/dist-packages/dtschema/schemas/regulator/richtek,rt4831-regulator.yaml'

> xargs: dt-doc-validate: exited with status 255; aborting

> make[1]: *** [Documentation/devicetree/bindings/Makefile:59: Documentation/devicetree/bindings/processed-schema-examples.json] Error 124

> make: *** [Makefile:1364: dt_binding_check] Error 2

>

>

> See https://patchwork.ozlabs.org/patch/1391911

>

> The base for the patch is generally the last rc1. Any dependencies

> should be noted.

>

> If you already ran 'make dt_binding_check' and didn't see the above

> error(s), then make sure 'yamllint' is installed and dt-schema is up to

> date:

>

> pip3 install dtschema --upgrade

>

> Please check and re-submit.

>

Sorry, I have one question.
If the richtek,rt4831.yaml is depend upon the other yaml, do I need to
merge it all into one patch?
Currently, my submitting order is mfd, backlight, and regulator.
Each part divided into two patches (one for source code, another for
dt_binding_document)
I have tried dt_binding_check. It cause the error like your bot said.
If dt_binding_check want to be pass, it means I should merge all dt
binding document into one patch due to the dependency.

If yes, I'll do it in next series patch.
Rob Herring Nov. 3, 2020, 1:58 a.m. UTC | #4
On Mon, Nov 2, 2020 at 7:14 PM ChiYuan Huang <u0084500@gmail.com> wrote:
>

> Rob Herring <robh@kernel.org> 於 2020年11月3日 週二 上午1:21寫道:

> >

> > On Mon, 02 Nov 2020 11:13:23 +0800, cy_huang wrote:

> > > From: ChiYuan Huang <cy_huang@richtek.com>

> > >

> > > Adds DT binding document for Richtek RT4831 MFD core.

> > >

> > > Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>

> > > ---

> > >  .../devicetree/bindings/mfd/richtek,rt4831.yaml    | 89 ++++++++++++++++++++++

> > >  include/dt-bindings/leds/rt4831-backlight.h        | 23 ++++++

> > >  2 files changed, 112 insertions(+)

> > >  create mode 100644 Documentation/devicetree/bindings/mfd/richtek,rt4831.yaml

> > >  create mode 100644 include/dt-bindings/leds/rt4831-backlight.h

> > >

> >

> >

> > My bot found errors running 'make dt_binding_check' on your patch:

> >

> > yamllint warnings/errors:

> >

> > dtschema/dtc warnings/errors:

> > Unknown file referenced: [Errno 2] No such file or directory: '/usr/local/lib/python3.8/dist-packages/dtschema/schemas/regulator/richtek,rt4831-regulator.yaml'

> > xargs: dt-doc-validate: exited with status 255; aborting

> > make[1]: *** [Documentation/devicetree/bindings/Makefile:59: Documentation/devicetree/bindings/processed-schema-examples.json] Error 124

> > make: *** [Makefile:1364: dt_binding_check] Error 2

> >

> >

> > See https://patchwork.ozlabs.org/patch/1391911

> >

> > The base for the patch is generally the last rc1. Any dependencies

> > should be noted.

> >

> > If you already ran 'make dt_binding_check' and didn't see the above

> > error(s), then make sure 'yamllint' is installed and dt-schema is up to

> > date:

> >

> > pip3 install dtschema --upgrade

> >

> > Please check and re-submit.

> >

> Sorry, I have one question.

> If the richtek,rt4831.yaml is depend upon the other yaml, do I need to

> merge it all into one patch?

> Currently, my submitting order is mfd, backlight, and regulator.

> Each part divided into two patches (one for source code, another for

> dt_binding_document)


Doesn't have to be 1 patch, but should be one series with MFD coming
last as it references the others. Example goes in the MFD binding. I
need to see a complete picture for what the device is to effectively
review the binding.

Rob
cy_huang Nov. 3, 2020, 5:48 a.m. UTC | #5
Rob Herring <robh@kernel.org> 於 2020年11月3日 週二 上午9:58寫道:
>

> On Mon, Nov 2, 2020 at 7:14 PM ChiYuan Huang <u0084500@gmail.com> wrote:

> >

> > Rob Herring <robh@kernel.org> 於 2020年11月3日 週二 上午1:21寫道:

> > >

> > > On Mon, 02 Nov 2020 11:13:23 +0800, cy_huang wrote:

> > > > From: ChiYuan Huang <cy_huang@richtek.com>

> > > >

> > > > Adds DT binding document for Richtek RT4831 MFD core.

> > > >

> > > > Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>

> > > > ---

> > > >  .../devicetree/bindings/mfd/richtek,rt4831.yaml    | 89 ++++++++++++++++++++++

> > > >  include/dt-bindings/leds/rt4831-backlight.h        | 23 ++++++

> > > >  2 files changed, 112 insertions(+)

> > > >  create mode 100644 Documentation/devicetree/bindings/mfd/richtek,rt4831.yaml

> > > >  create mode 100644 include/dt-bindings/leds/rt4831-backlight.h

> > > >

> > >

> > >

> > > My bot found errors running 'make dt_binding_check' on your patch:

> > >

> > > yamllint warnings/errors:

> > >

> > > dtschema/dtc warnings/errors:

> > > Unknown file referenced: [Errno 2] No such file or directory: '/usr/local/lib/python3.8/dist-packages/dtschema/schemas/regulator/richtek,rt4831-regulator.yaml'

> > > xargs: dt-doc-validate: exited with status 255; aborting

> > > make[1]: *** [Documentation/devicetree/bindings/Makefile:59: Documentation/devicetree/bindings/processed-schema-examples.json] Error 124

> > > make: *** [Makefile:1364: dt_binding_check] Error 2

> > >

> > >

> > > See https://patchwork.ozlabs.org/patch/1391911

> > >

> > > The base for the patch is generally the last rc1. Any dependencies

> > > should be noted.

> > >

> > > If you already ran 'make dt_binding_check' and didn't see the above

> > > error(s), then make sure 'yamllint' is installed and dt-schema is up to

> > > date:

> > >

> > > pip3 install dtschema --upgrade

> > >

> > > Please check and re-submit.

> > >

> > Sorry, I have one question.

> > If the richtek,rt4831.yaml is depend upon the other yaml, do I need to

> > merge it all into one patch?

> > Currently, my submitting order is mfd, backlight, and regulator.

> > Each part divided into two patches (one for source code, another for

> > dt_binding_document)

>

> Doesn't have to be 1 patch, but should be one series with MFD coming

> last as it references the others. Example goes in the MFD binding. I

> need to see a complete picture for what the device is to effectively

> review the binding.

>

Got it. Next, I'll add the regulator and backlight dt-binding into the
series patch.
And add the description into mfd core dt-binding like as below.

This patch depends on
    "backlight: rt4831: Adds DT binding document for Richtek RT4831
backlight module".
    "regulator: rt4831: Adds DT binding document for Richtek RT4831 DSV module".


> Rob
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/mfd/richtek,rt4831.yaml b/Documentation/devicetree/bindings/mfd/richtek,rt4831.yaml
new file mode 100644
index 00000000..c602d50
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/richtek,rt4831.yaml
@@ -0,0 +1,89 @@ 
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mfd/richtek,rt4831.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Richtek RT4831 DSV and Backlight Integrated IC
+
+maintainers:
+  - ChiYuan Huang <cy_huang@richtek.com>
+
+description: |
+  RT4831 is a mutifunctional device that can provide display panel power for
+  positive/negative voltage and also display panel wled driving.
+
+  For the display voltage output, the range is about 4V to 6.5V. It is sufficient
+  to meet the current display panel design.
+
+  For the panel backlight, it can provide four channels driving capability
+  Each driving current is up to 30mA
+
+  Datasheet is available at
+  https://www.richtek.com/assets/product_file/RT4831A/DS4831A-05.pdf
+
+properties:
+  compatible:
+    const: richtek,rt4831
+
+  reg:
+    description: I2C device address.
+    maxItems: 1
+
+  enable-gpios:
+    description: |
+      GPIO to enable/disable the chip. It is optional.
+      Some usage directly tied this pin to follow VIO 1.8V power on sequence.
+    maxItems: 1
+
+  regulators:
+    $ref: ../regulator/richtek,rt4831-regulator.yaml
+
+  backlight:
+    $ref: ../leds/backlight/richtek,rt4831-backlight.yaml
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/leds/rt4831-backlight.h>
+    i2c {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      rt4831@11 {
+        compatible = "richtek,rt4831";
+        reg = <0x11>;
+
+        regulators {
+          DSVLCM {
+            regulator-min-microvolt = <4000000>;
+            regulator-max-microvolt = <7150000>;
+          };
+          DSVP {
+            regulator-name = "rt4831-dsvp";
+            regulator-min-microvolt = <4000000>;
+            regulator-max-microvolt = <6500000>;
+            regulator-boot-on;
+          };
+          DSVN {
+            regulator-name = "rt4831-dsvn";
+            regulator-min-microvolt = <4000000>;
+            regulator-max-microvolt = <6500000>;
+            regulator-boot-on;
+          };
+        };
+
+        backlight {
+          compatible = "richtek,rt4831-backlight";
+          default-brightness = <1024>;
+          max-brightness = <2048>;
+          richtek,bled-ovp-sel = /bits/ 8 <RT4831_BLOVPLVL_21V>;
+          richtek,channel-use = /bits/ 8 <RT4831_BLED_ALLCHEN>;
+        };
+      };
+    };
diff --git a/include/dt-bindings/leds/rt4831-backlight.h b/include/dt-bindings/leds/rt4831-backlight.h
new file mode 100644
index 00000000..7084906
--- /dev/null
+++ b/include/dt-bindings/leds/rt4831-backlight.h
@@ -0,0 +1,23 @@ 
+/*
+ * This header provides constants for rt4831 backlight bindings.
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#ifndef _DT_BINDINGS_RT4831_BACKLIGHT_H
+#define _DT_BINDINGS_RT4831_BACKLIGHT_H
+
+#define RT4831_BLOVPLVL_17V	0
+#define RT4831_BLOVPLVL_21V	1
+#define RT4831_BLOVPLVL_25V	2
+#define RT4831_BLOVPLVL_29V	3
+
+#define RT4831_BLED_CH1EN	(1 << 0)
+#define RT4831_BLED_CH2EN	(1 << 1)
+#define RT4831_BLED_CH3EN	(1 << 2)
+#define RT4831_BLED_CH4EN	(1 << 3)
+#define RT4831_BLED_ALLCHEN	((1 << 4) - 1)
+
+#endif /* _DT_BINDINGS_RT4831_BACKLIGHT_H */