Message ID | 20200620224222.1312520-4-j.neuschaefer@gmx.net (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | None | expand |
On Sun, 21 Jun 2020 00:42:16 +0200 Jonathan Neuschäfer <j.neuschaefer@gmx.net> wrote: > The Netronix embedded controller as found in Kobo Aura and Tolino Shine > supports one PWM channel, which is used to control the frontlight > brightness on these devices. > > Known problems: > - `make dt_binding_check` shows the following warnings: > Documentation/devicetree/bindings/mfd/netronix,ntxec.example.dts:49.17-42: > Warning (pwms_property): /example-0/backlight:pwms: cell 2 is not a > phandle reference > Documentation/devicetree/bindings/mfd/netronix,ntxec.example.dts:49.17-42: > Warning (pwms_property): /example-0/backlight:pwms: Could not get > phandle node for (cell 2) > In the tolino sources in ./drivers/misc/ntx-misc.c I find this line if(4==gptHWCFG->m_val.bFL_PWM) { No idea what it does but I would expect to have a kind of translation to a dt property? > Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net> > --- > .../bindings/mfd/netronix,ntxec.yaml | 13 ++++++++ > .../bindings/pwm/netronix,ntxec-pwm.yaml | 33 +++++++++++++++++++ > 2 files changed, 46 insertions(+) > create mode 100644 Documentation/devicetree/bindings/pwm/netronix,ntxec-pwm.yaml > > diff --git a/Documentation/devicetree/bindings/mfd/netronix,ntxec.yaml b/Documentation/devicetree/bindings/mfd/netronix,ntxec.yaml > index 596df460f98eb..6562c41c5a9a9 100644 > --- a/Documentation/devicetree/bindings/mfd/netronix,ntxec.yaml > +++ b/Documentation/devicetree/bindings/mfd/netronix,ntxec.yaml > @@ -31,6 +31,9 @@ properties: > description: > The EC can signal interrupts via a GPIO line > > + pwm: > + $ref: ../pwm/netronix,ntxec-pwm.yaml > + > required: > - compatible > - reg > @@ -53,5 +56,15 @@ examples: > interrupts = <11 IRQ_TYPE_EDGE_FALLING>; > interrupt-controller; > #interrupt-cells = <1>; > + > + ec_pwm: pwm { > + compatible = "netronix,ntxec-pwm"; > + #pwm-cells = <1>; shouldn't that be 2? > + }; > }; > }; > + > + backlight { > + compatible = "pwm-backlight"; > + pwms = <&ec_pwm 0 50000>; since you have 2 values after the &ec_pwm > + }; > diff --git a/Documentation/devicetree/bindings/pwm/netronix,ntxec-pwm.yaml b/Documentation/devicetree/bindings/pwm/netronix,ntxec-pwm.yaml > new file mode 100644 > index 0000000000000..1dc1b1aba081c > --- /dev/null > +++ b/Documentation/devicetree/bindings/pwm/netronix,ntxec-pwm.yaml > @@ -0,0 +1,33 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/pwm/netronix,ntxec-pwm.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: PWM functionality in Netronix embedded controller > + > +maintainers: > + - Jonathan Neuschäfer <j.neuschaefer@gmx.net> > + > +description: | > + See also Documentation/devicetree/bindings/mfd/netronix,ntxec.yaml > + > + The Netronix EC contains PWM functionality, which is usually used to drive > + the backlight LED. > + > + The following PWM channels are supported: > + - 0: The PWM channel controlled by registers 0xa1-0xa7 > + > +allOf: > + - $ref: pwm.yaml# > + > +properties: > + compatible: > + const: netronix,ntxec-pwm > + > + "#pwm-cells": > + const: 1 shouln't that be 2? > + > +required: > + - compatible > + - "#pwm-cells" > -- > 2.27.0 > > Regards, Andreas
On Sun, Jun 21, 2020 at 08:41:23PM +0200, Andreas Kemnade wrote: > On Sun, 21 Jun 2020 00:42:16 +0200 > Jonathan Neuschäfer <j.neuschaefer@gmx.net> wrote: > > > The Netronix embedded controller as found in Kobo Aura and Tolino Shine > > supports one PWM channel, which is used to control the frontlight > > brightness on these devices. > > > > Known problems: > > - `make dt_binding_check` shows the following warnings: > > Documentation/devicetree/bindings/mfd/netronix,ntxec.example.dts:49.17-42: > > Warning (pwms_property): /example-0/backlight:pwms: cell 2 is not a > > phandle reference > > Documentation/devicetree/bindings/mfd/netronix,ntxec.example.dts:49.17-42: > > Warning (pwms_property): /example-0/backlight:pwms: Could not get > > phandle node for (cell 2) > > > In the tolino sources in ./drivers/misc/ntx-misc.c I find this line > > if(4==gptHWCFG->m_val.bFL_PWM) { > > No idea what it does but I would expect to have a kind of translation to > a dt property? As far as I understand it, FL_PWM=4 means that there is a second PWM channel, in order to provide different backlight colors. I think it should be possible to simply extend the binding to list another available PWM channel, once we add support for such hardware. > > + ec_pwm: pwm { > > + compatible = "netronix,ntxec-pwm"; > > + #pwm-cells = <1>; > shouldn't that be 2? > > + }; > > }; > > }; > > + > > + backlight { > > + compatible = "pwm-backlight"; > > + pwms = <&ec_pwm 0 50000>; > since you have 2 values after the &ec_pwm [...] > > +properties: > > + compatible: > > + const: netronix,ntxec-pwm > > + > > + "#pwm-cells": > > + const: 1 > > shouln't that be 2? Right, I'll fix that. Thanks, Jonathan
diff --git a/Documentation/devicetree/bindings/mfd/netronix,ntxec.yaml b/Documentation/devicetree/bindings/mfd/netronix,ntxec.yaml index 596df460f98eb..6562c41c5a9a9 100644 --- a/Documentation/devicetree/bindings/mfd/netronix,ntxec.yaml +++ b/Documentation/devicetree/bindings/mfd/netronix,ntxec.yaml @@ -31,6 +31,9 @@ properties: description: The EC can signal interrupts via a GPIO line + pwm: + $ref: ../pwm/netronix,ntxec-pwm.yaml + required: - compatible - reg @@ -53,5 +56,15 @@ examples: interrupts = <11 IRQ_TYPE_EDGE_FALLING>; interrupt-controller; #interrupt-cells = <1>; + + ec_pwm: pwm { + compatible = "netronix,ntxec-pwm"; + #pwm-cells = <1>; + }; }; }; + + backlight { + compatible = "pwm-backlight"; + pwms = <&ec_pwm 0 50000>; + }; diff --git a/Documentation/devicetree/bindings/pwm/netronix,ntxec-pwm.yaml b/Documentation/devicetree/bindings/pwm/netronix,ntxec-pwm.yaml new file mode 100644 index 0000000000000..1dc1b1aba081c --- /dev/null +++ b/Documentation/devicetree/bindings/pwm/netronix,ntxec-pwm.yaml @@ -0,0 +1,33 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/pwm/netronix,ntxec-pwm.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: PWM functionality in Netronix embedded controller + +maintainers: + - Jonathan Neuschäfer <j.neuschaefer@gmx.net> + +description: | + See also Documentation/devicetree/bindings/mfd/netronix,ntxec.yaml + + The Netronix EC contains PWM functionality, which is usually used to drive + the backlight LED. + + The following PWM channels are supported: + - 0: The PWM channel controlled by registers 0xa1-0xa7 + +allOf: + - $ref: pwm.yaml# + +properties: + compatible: + const: netronix,ntxec-pwm + + "#pwm-cells": + const: 1 + +required: + - compatible + - "#pwm-cells"
The Netronix embedded controller as found in Kobo Aura and Tolino Shine supports one PWM channel, which is used to control the frontlight brightness on these devices. Known problems: - `make dt_binding_check` shows the following warnings: Documentation/devicetree/bindings/mfd/netronix,ntxec.example.dts:49.17-42: Warning (pwms_property): /example-0/backlight:pwms: cell 2 is not a phandle reference Documentation/devicetree/bindings/mfd/netronix,ntxec.example.dts:49.17-42: Warning (pwms_property): /example-0/backlight:pwms: Could not get phandle node for (cell 2) Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net> --- .../bindings/mfd/netronix,ntxec.yaml | 13 ++++++++ .../bindings/pwm/netronix,ntxec-pwm.yaml | 33 +++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 Documentation/devicetree/bindings/pwm/netronix,ntxec-pwm.yaml -- 2.27.0