From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44B3CC433E2 for ; Tue, 15 Sep 2020 23:07:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EF20B208E4 for ; Tue, 15 Sep 2020 23:07:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600211268; bh=utJVhgwJTrunVJwtarb0ds5g2F08QaKajk/8z09HS/I=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=Gnq1TqyQoDcegymkJvCPQXleFVAm1za31PDcJ/nXgnxLgtxinO37ewfGyDcMFaxrs ZSKQLwuLa8Uf7Vs3Vn1j3DIU3t5ewNh1Ywh/ecqK2y5EJL3DyV7p2weHrddqJ3nWJ5 2v7Q2S4959/qhWrKkNhmOd3TefimThMTCb57iQJ0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727337AbgIOXHi (ORCPT ); Tue, 15 Sep 2020 19:07:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:48810 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727278AbgIOOlk (ORCPT ); Tue, 15 Sep 2020 10:41:40 -0400 Received: from mail-ot1-f47.google.com (mail-ot1-f47.google.com [209.85.210.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 23F7922265; Tue, 15 Sep 2020 14:32:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600180327; bh=utJVhgwJTrunVJwtarb0ds5g2F08QaKajk/8z09HS/I=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=TFk0KmOgqkxPnPhwCUKPEH/u1GObeQ1s3DyU/vyGg9+rqkrmmgXCM3vQPAlVv4IwE N5R1qn5EJsfYcQSTp9mJ2R9ouUzUzDtnj4xZzOJjrAcbaMdhsCpd+crPPqi8zQ+DIG dari9jShrtKauwrggJ+jY94Hw+p1UL8pw3YCmTGQ= Received: by mail-ot1-f47.google.com with SMTP id o8so3440225otl.4; Tue, 15 Sep 2020 07:32:07 -0700 (PDT) X-Gm-Message-State: AOAM530xGpfA2Y6dQwR6fFQ9riHJ3Om6cS6iW9j3uKlJknlZofW5VRFI aAJlTzcW9FF34f/MA0B8/OWbAA6LzlkoYzn2Cw== X-Google-Smtp-Source: ABdhPJxotHRWZRWMUoSLoNeE7xePoRIjifT/7QqjsQ5ljfN00watvkgScFQsGBTpsE8eUJBLvPaa5rChQkwszRGChsw= X-Received: by 2002:a9d:411:: with SMTP id 17mr13481301otc.192.1600180326428; Tue, 15 Sep 2020 07:32:06 -0700 (PDT) MIME-Version: 1.0 References: <20200905133230.1014581-1-j.neuschaefer@gmx.net> <20200905133230.1014581-5-j.neuschaefer@gmx.net> <20200915005443.GA604385@bogus> <20200915082348.2f6fff7a@aktux> In-Reply-To: <20200915082348.2f6fff7a@aktux> From: Rob Herring Date: Tue, 15 Sep 2020 08:31:55 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 04/10] dt-bindings: pwm: Add bindings for PWM function in Netronix EC To: Andreas Kemnade Cc: =?UTF-8?Q?Jonathan_Neusch=C3=A4fer?= , "linux-kernel@vger.kernel.org" , Lee Jones , Thierry Reding , =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , Alessandro Zummo , Alexandre Belloni , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Sam Ravnborg , Linus Walleij , Heiko Stuebner , Stephan Gerhold , Lubomir Rintel , Mark Brown , allen , Mauro Carvalho Chehab , "David S. Miller" , devicetree@vger.kernel.org, Linux PWM List , "open list:REAL TIME CLOCK (RTC) SUBSYSTEM" , linux-arm-kernel , Heiko Stuebner , Josua Mayer , Arnd Bergmann , Daniel Palmer Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 15, 2020 at 12:24 AM Andreas Kemnade wro= te: > > Hi, > > On Mon, 14 Sep 2020 18:54:43 -0600 > Rob Herring wrote: > > > On Sat, Sep 05, 2020 at 03:32:24PM +0200, Jonathan Neusch=C3=A4fer wrot= e: > > > The Netronix embedded controller as found in Kobo Aura and Tolino Shi= ne > > > supports one PWM channel, which is used to control the frontlight > > > brightness on these devices. > > > > > > Signed-off-by: Jonathan Neusch=C3=A4fer > > > --- > > > > > > 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 r= equires 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 =3D "netronix,ntxec"; > > > ... > > > > > > ec_pwm: pwm { > > > compatible =3D "netronix,ntxec-pwm"; > > > #pwm-cells =3D <1>; > > > }; > > > }; > > > > > > ... > > > > > > backlight { > > > compatible =3D "pwm-backlight"; > > > pwms =3D <&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,nt= xec-pwm.yaml > > > > > > diff --git a/Documentation/devicetree/bindings/mfd/netronix,ntxec.yam= l 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 =3D <11 IRQ_TYPE_EDGE_FALLING>; > > > interrupt-controller; > > > #interrupt-cells =3D <1>; > > > + > > > + ec_pwm: pwm { > > > + compatible =3D "netronix,ntxec-pwm"; > > > + #pwm-cells =3D <2>; > > > + }; > > > }; > > > }; > > > + > > > + backlight { > > > + compatible =3D "pwm-backlight"; > > > + pwms =3D <&ec_pwm 0 50000>; > > > + power-supply =3D <&backlight_regulator>; > > > + }; > > > + > > > + backlight_regulator: regulator-dummy { > > > + compatible =3D "regulator-fixed"; > > > + regulator-name =3D "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=C3=A4fer > > > + > > > +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. > > > hmm, there are apparently devices without rtc. If there is a child node > for the rtc, the corresponding devicetrees could disable rtc by not > having that node. > But maybe using the controller version is also feasible for that task. If not probeable, then the compatible string should distinguish that. Rob