Received: by 2002:a4f:b056:0:0:0:0:0 with SMTP id m22csp2666964ivi; Tue, 15 Sep 2020 16:10:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIOP68JT7WPLxxhgqN5yboyF8396YrRvxCY5DP7QrPMvHSpPVM6dz2jlCiWUrXT4kTicqy X-Received: by 2002:a17:906:d78d:: with SMTP id pj13mr23151855ejb.15.1600211441325; Tue, 15 Sep 2020 16:10:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600211441; cv=none; d=google.com; s=arc-20160816; b=AQQA9Z85uY0DqlKPuTFDK4N8gKXWgh6Tfp7XmC/yTG12fvVFxb9kHZvSXbGtiw0/bY IlciK+qm1efzSFaXhPc8EEy/L5/GNy5MXk6T9Lk7XD4y1GdwYJDZ5r9GYruqqw7kp5E2 xmJeErNP0D/R+fYgND3Xj2I1oBQo4HNLOBSxjrYP5PZbWUVxAdT113KH5h/po91IexIZ 0kw1vNu2XmReHr6VMZuqAhJHbmgVTGiGQEzwoGsrvsmbQZaviRvwSVmbtABLmjgjZqJJ ZNqnoMl6JmbiUXNWEjOpGiw7qLrSbXfc6e5E+qCOwmJK0LYk17aHJQdJPu8alAjq3D3G f1uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=r9QXMlYPwHG42IDzYNGBKX28uoaunbzilSFFkCPLuSU=; b=FQxorLG766Jd83zq4bc4m0es4KZxtb+xvYCIqmxM9DdUUlUim+xfNlMnW+4ndu7ry8 2Vl/6FIA2rhyCoQMbmrpOrmjNkhB6qPNqnRWgxuwCZO854xdcWrheAkpJoWpMfku9QK1 WRLgYkfFoS38pzjN+xG7RNk5uXsMSXkxliZUyGN7Exo3ru4AFuG+n663puxZ0xfUyb3c qSue4uvSTvU18SBd8OLr8ylRFDVV+YgIAU8IkMwZQjM2P4MOPVWWJlpbPKxmgCJkyeZ1 FkXPCZHfcSjr+PkCn4oUXhboxt12TGQpLorNipvjHlouGTLokg3LUmLGwU6YzfbcNQbe 6OzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TFk0KmOg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c61si10725870edf.394.2020.09.15.16.10.09; Tue, 15 Sep 2020 16:10:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TFk0KmOg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727402AbgIOXHg (ORCPT + 99 others); Tue, 15 Sep 2020 19:07:36 -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-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