[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200915005443.GA604385@bogus>
Date: Mon, 14 Sep 2020 18:54:43 -0600
From: Rob Herring <robh@...nel.org>
To: Jonathan Neuschäfer <j.neuschaefer@....net>
Cc: linux-kernel@...r.kernel.org, Lee Jones <lee.jones@...aro.org>,
Thierry Reding <thierry.reding@...il.com>,
Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>,
Alessandro Zummo <a.zummo@...ertech.it>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Fabio Estevam <festevam@...il.com>,
NXP Linux Team <linux-imx@....com>,
Sam Ravnborg <sam@...nborg.org>,
Linus Walleij <linus.walleij@...aro.org>,
Heiko Stuebner <heiko.stuebner@...obroma-systems.com>,
Stephan Gerhold <stephan@...hold.net>,
Lubomir Rintel <lkundrak@...sk>,
Mark Brown <broonie@...nel.org>, allen <allen.chen@....com.tw>,
Mauro Carvalho Chehab <mchehab+huawei@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
devicetree@...r.kernel.org, linux-pwm@...r.kernel.org,
linux-rtc@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
Heiko Stuebner <heiko@...ech.de>,
Josua Mayer <josua.mayer@....eu>,
Andreas Kemnade <andreas@...nade.info>,
Arnd Bergmann <arnd@...db.de>, Daniel Palmer <daniel@...f.com>
Subject: Re: [PATCH v2 04/10] dt-bindings: pwm: Add bindings for PWM function
in Netronix EC
On Sat, Sep 05, 2020 at 03:32:24PM +0200, Jonathan Neuschäfer 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.
>
> Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@....net>
> ---
>
> v2:
> - Add plaintext binding to patch description, for comparison
> - Fix pwm-cells property (should be 2, not 1)
> - Add dummy regulator to example, because the pwm-backlight binding requires a
> power supply
>
>
> For reference, here is the binding in text form:
>
>
> PWM functionality in Netronix Embedded Controller
>
> Required properties:
> - compatible: should be "netronix,ntxec-pwm"
> - #pwm-cells: should be 2.
>
> Available PWM channels:
> - 0: The PWM channel controlled by registers 0xa1-0xa7
>
> Example:
>
> embedded-controller@43 {
> compatible = "netronix,ntxec";
> ...
>
> ec_pwm: pwm {
> compatible = "netronix,ntxec-pwm";
> #pwm-cells = <1>;
> };
> };
>
> ...
>
> backlight {
> compatible = "pwm-backlight";
> pwms = <&ec_pwm 0 50000>;
> };
> ---
> .../bindings/mfd/netronix,ntxec.yaml | 19 +++++++++++
> .../bindings/pwm/netronix,ntxec-pwm.yaml | 33 +++++++++++++++++++
> 2 files changed, 52 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..73c873dda3e70 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,21 @@ examples:
> interrupts = <11 IRQ_TYPE_EDGE_FALLING>;
> interrupt-controller;
> #interrupt-cells = <1>;
> +
> + ec_pwm: pwm {
> + compatible = "netronix,ntxec-pwm";
> + #pwm-cells = <2>;
> + };
> };
> };
> +
> + backlight {
> + compatible = "pwm-backlight";
> + pwms = <&ec_pwm 0 50000>;
> + power-supply = <&backlight_regulator>;
> + };
> +
> + backlight_regulator: regulator-dummy {
> + compatible = "regulator-fixed";
> + regulator-name = "backlight";
> + };
> 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..0c9d2801b8de1
> --- /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@....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: 2
Just move this to the parent and make the parent a pwm provider. There's
no need for child nodes for this or the rtc.
Rob
Powered by blists - more mailing lists