Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2044491pxk; Sat, 5 Sep 2020 06:45:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEgvGigTEV56+b03IB64LfozEdpJwMZoqa95oY96is6Ge5beI7fithocRj1b7xsXkX4ySz X-Received: by 2002:a17:906:4103:: with SMTP id j3mr12450331ejk.5.1599313516392; Sat, 05 Sep 2020 06:45:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599313516; cv=none; d=google.com; s=arc-20160816; b=PIp1ep+0qgFBYDPNDRiDrZWmFzTFGxtbfOUKgADZQjy+6tTh3Dbl95XybxUCsOxxN/ ZYb0csl+8+vEzJ4UYKwN2rcVig1QB9LBJdMsB5rQ5kJvGFabxlNGvE8TIUK00asx31BK 2B79Gqh74X71i/8bX3ZRmI0PEa7caFBGD0Z83D1I55TthV/9nu30yJmlTMfm6TU9jP+c paRugrPPA5RfDtaJO2rm+IHQt4vMiPsYAf7Bh7V3Ggg8ns+miZPy/kNsKKmxP6x8utL5 FQGyUl5hi0ZzXb8qF8iDn6bMcL2djbmxXiLv432L2u3qn5hW3kDTRG2dMLnCXoMG4rm6 C5sg== 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:date:subject:cc:to:from :dkim-signature; bh=8wNKC6tqR/O2TlnOeQxfDAEJyiqy+y5fmSHVopsy4QU=; b=vRgXWIz111s8Td+gbKySIYjR9kLPJIBSQYH91WCAbxDSRMnq+AT9x1VPkKbKAN6M2M Jvs/yqTl08DNsww9GvWK/3s82NC8toDoc9iMJwlFi8Qa4Enho8gfuE8musXr2939qJYW hVMIh+qDlrQD1fuvHAf+ZHBHBl0JxvU5rw2L/ZXUPY7nHj5AinYhOVN2zz+NSHMy+eic bHQurWsuJR8TlLpOBeWVvuChCq6Fox3QqXCJiTwVE2z/3Q2Fpwh7mcKies4WJ2Qr5Nr7 E3HrrfQMO8rPO8uyLesKLyJ6y+bsdINGQ8pl1wb0SY9X/LocuGT0oY7gf5Q3Vne4cvuI yvWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=VTrOrwLd; 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 c7si6100566ejz.677.2020.09.05.06.44.53; Sat, 05 Sep 2020 06:45:16 -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=@gmx.net header.s=badeba3b8450 header.b=VTrOrwLd; 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 S1728372AbgIENkK (ORCPT + 99 others); Sat, 5 Sep 2020 09:40:10 -0400 Received: from mout.gmx.net ([212.227.15.18]:60687 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728248AbgIENg0 (ORCPT ); Sat, 5 Sep 2020 09:36:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1599312868; bh=u6aT3F2Q3gGj9nh0VqE3OXnqr1dQ+ZyFPqUs/hm8TgM=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=VTrOrwLdl4pu3ogu+tX1ulxWEe25edkYiUMGaIhQ/mTYlTRBQOoFvpqExbfUQUSry JOrlpStlTpnVAsnfTjlxaxKe2R/Gunh+GF03rfAbLw6g+nu60sbvsYBZFZsOK+GajF ItQfPSPZGJ6UY6SwcxSmNpqIB/LPZwDjYOYwZzsw= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from longitude ([5.146.195.151]) by mail.gmx.com (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N1fis-1kh7lb4104-0121s1; Sat, 05 Sep 2020 15:34:28 +0200 From: =?UTF-8?q?Jonathan=20Neusch=C3=A4fer?= To: linux-kernel@vger.kernel.org Cc: Lee Jones , Rob Herring , =?UTF-8?q?Jonathan=20Neusch=C3=A4fer?= , Thierry Reding , =?UTF-8?q?Uwe=20Kleine-K=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: [PATCH v2 04/10] dt-bindings: pwm: Add bindings for PWM function in Netronix EC Date: Sat, 5 Sep 2020 15:32:24 +0200 Message-Id: <20200905133230.1014581-5-j.neuschaefer@gmx.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200905133230.1014581-1-j.neuschaefer@gmx.net> References: <20200905133230.1014581-1-j.neuschaefer@gmx.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:BsE/idGOdG/2VXSLRx4X2BZv664ZNJ0vKz0CEYNYAzQ7v4uWeOA AH0UJ2IvlSFVX/IPDzYUdnVcGC28q2xjtegYX7p1jz6XfdEKfPefQNjGkbZtUVs0iWyDsdq pi1cQ/C4oPqlEjjGnAJWf4fX/TKoh1ScMzVbK0LXQgdYA4NsLCioS6RizAlvLK1+CLNqmE7 y1U84rzjlrWmDVon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5i+bDBwLmRhElPqjhv 5aIMBEjR/7BHC20WhFr8gAGB802rwo+y6dLxiuWQDPwsvtahqvKybyO7az5kI7tlebOvcyesy qv/KyjhP0oWNKqQCRro/10VOjjWzUl4frT86KXg+DNrQkq7P9005Het/s7AxMqFJrq38AAL8a v0NZHR2T28KJ9c+8pSHqsvvPi98mSqvABWRFJBvtFe/BqN6ilvXx1lV4UdBmRIH9ecgppIhMJ Kg2t0RUPELK4a94nagaOer/50rwkWsi54i2g7ig== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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=C3=A4fer =2D-- 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 requir= es 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>; }; =2D-- .../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-p= wm.yaml diff --git a/Documentation/devicetree/bindings/mfd/netronix,ntxec.yaml b/D= ocumentation/devicetree/bindings/mfd/netronix,ntxec.yaml index 596df460f98eb..73c873dda3e70 100644 =2D-- 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 =2D-- /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 dr= ive + 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 + +required: + - compatible + - "#pwm-cells" =2D- 2.28.0