Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2711888pxk; Mon, 14 Sep 2020 23:27:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkGJVYPmQJXRhZfRMs0YVocEa1f1GAb+5Gm5X8bNhXkiCABKB7GcMXetS/1ptYQlJfGuff X-Received: by 2002:a50:bb65:: with SMTP id y92mr20618799ede.53.1600151263717; Mon, 14 Sep 2020 23:27:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600151263; cv=none; d=google.com; s=arc-20160816; b=G+8hFplUznD7oByiV2/8M3nHWGM4fVKsHn8NRoC0RTbwiQpkwEjzkDX+2/j9BF4wJ2 j4YJAY3JlCIymRGxmqFDmt233DHM8BMdbafLAwBun52NuWVIpr0qHRSprC0QJbHS49uC HT3tCEkLm2MWw1DEEn1DDQxZGf8tgFbmUQq7jrXta5sCMSHDtlpQG5jQLatnJXSMRM5E tPnTfJmgVKtHOElBDPQuJFnlTFfVO/4XWmnyzi+epaOfh7b5fSSeQooOaPSGo7lwvMnu GH/vA7Qh/qjPNTQt/b8wkeCG3cxuD5FixGVAQbYX9vMO3NFvQcePuoMHEGUW/PvBUX1E +vxQ== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=QHbkyesd8bkWd5SRIkxU2MuBCURyk8IvmzYZixbpLow=; b=p72Swvp1hOxx4kVWQNHW82Hf3zPnMOg9KCETGoGk74UY5TjHc9P/9NuwplArGoM7yh 8xfaQM8q6Tpc3RNnM2SRIqubLTi75x/fWYluIqA+2e6WcdSmAsH4gLKtKBFiWQQJJDu0 5/278Mxi7j0Cub9UlOcXKFpBZ2qdf7M6cTI2YZUJnS0nOVPY9m/U0w7THwG/ylDOzdOO QYafcoTUCyZSYhQ0sSP7Rww28hjLpLYd+6KGm3/XJhDqoLZgbu9zXmXfi+FmAMHn76A9 7vF9q1WznaK0dgHyAD0oSBjhw+f9JtUaUxdlEoWHzkX/MC9ud2tiq7VLQcvXJGj4+tCs fl3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kemnade.info header.s=20180802 header.b=IcLYXYdL; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j4si8498127ejt.277.2020.09.14.23.27.21; Mon, 14 Sep 2020 23:27:43 -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=fail header.i=@kemnade.info header.s=20180802 header.b=IcLYXYdL; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726062AbgIOGYW (ORCPT + 99 others); Tue, 15 Sep 2020 02:24:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726031AbgIOGYT (ORCPT ); Tue, 15 Sep 2020 02:24:19 -0400 Received: from mail.andi.de1.cc (mail.andi.de1.cc [IPv6:2a01:238:4321:8900:456f:ecd6:43e:202c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 065B3C06174A; Mon, 14 Sep 2020 23:24:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kemnade.info; s=20180802; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=QHbkyesd8bkWd5SRIkxU2MuBCURyk8IvmzYZixbpLow=; b=IcLYXYdLwXMuWNI5YNV+beexWG VqKS5TR08XAcjscu1cr636dh1OtKXDLvJUekejY5Pe7iRra7sRFCN+MGjhi9L9kIITwbsU0GE/dsS 2lrKX43k35Tg5+myx3sKwZ5AuK/zsHpwfTcHmsogpeaPkXmV989SyD5YnzEbbS/TQG9M=; Received: from p200300ccff0cb3001a3da2fffebfd33a.dip0.t-ipconnect.de ([2003:cc:ff0c:b300:1a3d:a2ff:febf:d33a] helo=aktux) by mail.andi.de1.cc with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1kI4Na-0003Xe-8h; Tue, 15 Sep 2020 08:23:50 +0200 Date: Tue, 15 Sep 2020 08:23:48 +0200 From: Andreas Kemnade To: Rob Herring Cc: Jonathan =?UTF-8?B?TmV1c2Now6RmZXI=?= , linux-kernel@vger.kernel.org, Lee Jones , Thierry Reding , Uwe =?UTF-8?B?S2xlaW5lLUvDtm5pZw==?= , 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@vger.kernel.org, linux-rtc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Heiko Stuebner , Josua Mayer , Arnd Bergmann , Daniel Palmer Subject: Re: [PATCH v2 04/10] dt-bindings: pwm: Add bindings for PWM function in Netronix EC Message-ID: <20200915082348.2f6fff7a@aktux> In-Reply-To: <20200915005443.GA604385@bogus> References: <20200905133230.1014581-1-j.neuschaefer@gmx.net> <20200905133230.1014581-5-j.neuschaefer@gmx.net> <20200915005443.GA604385@bogus> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -1.0 (-) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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. > >=20 > > Signed-off-by: Jonathan Neusch=C3=A4fer > > --- > >=20 > > 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 req= uires a > > power supply > >=20 > >=20 > > For reference, here is the binding in text form: > >=20 > >=20 > > PWM functionality in Netronix Embedded Controller > >=20 > > Required properties: > > - compatible: should be "netronix,ntxec-pwm" > > - #pwm-cells: should be 2. > >=20 > > Available PWM channels: > > - 0: The PWM channel controlled by registers 0xa1-0xa7 > >=20 > > Example: > >=20 > > embedded-controller@43 { > > compatible =3D "netronix,ntxec"; > > ... > >=20 > > ec_pwm: pwm { > > compatible =3D "netronix,ntxec-pwm"; > > #pwm-cells =3D <1>; > > }; > > }; > >=20 > > ... > >=20 > > 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,ntxe= c-pwm.yaml > >=20 > > 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 > >=20 > > + 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.y= aml 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 =20 >=20 > Just move this to the parent and make the parent a pwm provider. There's= =20 > no need for child nodes for this or the rtc. >=20 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. Regards, Andreas