Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2571484pxk; Mon, 14 Sep 2020 17:55:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYeAw6KDPO/ZAIjIDjmD79H0Z9oxMtd1RuGNgQkN0sLNVyIhMTBF8FH7uqk8NQreS2+Nt0 X-Received: by 2002:a17:906:fa81:: with SMTP id lt1mr17187106ejb.459.1600131343601; Mon, 14 Sep 2020 17:55:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600131343; cv=none; d=google.com; s=arc-20160816; b=RbQAqJDMKe4o3559x6ubx/UNSU5X5LRhFUU4AUT1t3TpHxZvDBdgpHQqUFGbxn7GqK DlfBoQUtiuyiAY3YCfdv0XN452qfB+uJ7aLntbA220yiEkELx5c8vj6hvlmA2xY3Phw7 Nmw24A9692oCVoTHWwLAGZRuAPPIeUvbqc/g8vdNKQP6Ed1MfiWy2VjOPB8reQCF8+b3 twk79JI9mHSOLXEPxYv98iV/YFpDxceZq+xZ27KWplvLT78oCW/ercRjrP8EDWjbXZfg lnPsrO/W/bvixw2pCWuPA9lW51OwxKlE7dYola5zYGI53Eq1rrJhm1BeAJt+BKBaQeGr w04w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Uu60TNaJ5WiZEoTUp5Pm6cAzGAGF09qo0+Sx8E6CGrY=; b=S6EcRjs13kykwSGtWCN7V0rqyBK6L1d/ZBR/UQl9TKZfuOSP8CIkGTS0NgW1kHB42R zEkwVszbCPcd7O9X6Mxrg+3o9cji9mD+a6b5D0cFZnjR5vVcHXRRI8GN08JvDRmN4vUP zE5tBTqxBz+tkTdACoUXGhKectVfzFeoU18kKbXnu5nfiV27CFeMtXwSYrh+fwxTR3Wz tJZy7vB6Ej2FFdTfGZYJgsws+g7xuE1eUhPvsB96NszCNg5h/Be6XlfexNifkfG8zE6s MM+Un4fCNrFaIvSjE0kMWYN1v5qaW6gdcVDgIzO7F38ZJzhTEygC/CFNf/ePHhGWVAaP 8OHQ== ARC-Authentication-Results: i=1; mx.google.com; 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 g7si8670168edp.272.2020.09.14.17.55.20; Mon, 14 Sep 2020 17:55: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; 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 S1726082AbgIOAyw (ORCPT + 99 others); Mon, 14 Sep 2020 20:54:52 -0400 Received: from mail-il1-f194.google.com ([209.85.166.194]:44787 "EHLO mail-il1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726045AbgIOAys (ORCPT ); Mon, 14 Sep 2020 20:54:48 -0400 Received: by mail-il1-f194.google.com with SMTP id h11so1370281ilj.11; Mon, 14 Sep 2020 17:54:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=Uu60TNaJ5WiZEoTUp5Pm6cAzGAGF09qo0+Sx8E6CGrY=; b=heY3zxtdOgIrU3wtNWBxZBeB1J8d2iZkZJ4HjX0hiFBQ0bi51R99c/BjHWK5/ABfBI zuRGHnQB38T+4pP6w3hwYlAbpYpUw79FOxS9I+NmvmUqDo8epzhrHkeDbLRNOf2oGi4u 2VpRyTDzr5XWyOBPD+Ux1UMMHaVJLvdO7WOb0kMqYFSXF+KrjIYSHFoWKHVCi0Qu6rEq ctnjFSGlqxCo6n6Ows9SdFeudVluC4p6MktQZl5++Yo8f7f3autCWwqVL/rX0ZfHDm+X GlGFVLTePhkgY+7Xcs+mBAUgCizZEVIA5JZTF3o2b9WrqMs7lqvSlS/cp3ZYxUqmRb5w IfDQ== X-Gm-Message-State: AOAM532cTTgxjAq8xU12B4f/CnpwxVpihi38TPeaxEf428Tdqq718k6c 1P/fMuzR5N64G5npqYOWvw== X-Received: by 2002:a92:9fcc:: with SMTP id z73mr7796328ilk.234.1600131286742; Mon, 14 Sep 2020 17:54:46 -0700 (PDT) Received: from xps15 ([64.188.179.253]) by smtp.gmail.com with ESMTPSA id y10sm6805351ioy.25.2020.09.14.17.54.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Sep 2020 17:54:45 -0700 (PDT) Received: (nullmailer pid 610633 invoked by uid 1000); Tue, 15 Sep 2020 00:54:43 -0000 Date: Mon, 14 Sep 2020 18:54:43 -0600 From: Rob Herring To: Jonathan =?iso-8859-1?Q?Neusch=E4fer?= Cc: 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@vger.kernel.org, linux-rtc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Heiko Stuebner , Josua Mayer , Andreas Kemnade , Arnd Bergmann , Daniel Palmer Subject: Re: [PATCH v2 04/10] dt-bindings: pwm: Add bindings for PWM function in Netronix EC Message-ID: <20200915005443.GA604385@bogus> References: <20200905133230.1014581-1-j.neuschaefer@gmx.net> <20200905133230.1014581-5-j.neuschaefer@gmx.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200905133230.1014581-5-j.neuschaefer@gmx.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > > 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 > + > +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