From patchwork Mon Oct 5 20:34:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alexander Dahl X-Patchwork-Id: 11817675 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D66336CA for ; Mon, 5 Oct 2020 20:38:06 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ABE63204EA for ; Mon, 5 Oct 2020 20:38:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="hM5AGzPJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ABE63204EA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lespocky.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=mgAbre2ysoW2DzAfml9fwJqspqQeG5fxLGTpEKtzkAY=; b=hM5AGzPJ9wcZWDS6KjfTwISnm VCw2yHA4ntm3OA2LadFuf7zNSBudNRYUYcqtfeuLtAz0N76cBoXZiIU93qkkvWeKlQmy6NYoY7MgS lYFvh2IsO8JRP/9z9LF4ortIZsORiieHvXNtER/JYi5Yg4CE/+obG2n6qNDZK0Sm9XtmQGfRUxs5v et9WfAU7lF6FETJoehSCivObbwM8JLYI3LRAqeDUOwmiLzibVXk9DCIInTRc1pGKNG9EqQQxiPGgN Em0Vx3dYVVoqvBoia8JqxVgJwluFCA+sWb/cBw8fcGkAQXXUKgI82ffjlgWs8byWPu0EspbfcJEnM lMP1CFbRA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kPXDT-0006Wi-Mm; Mon, 05 Oct 2020 20:36:15 +0000 Received: from mout.kundenserver.de ([217.72.192.75]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kPXDM-0006TP-Pn; Mon, 05 Oct 2020 20:36:10 +0000 Received: from methusalix.internal.home.lespocky.de ([92.117.55.152]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1N3sNa-1kYIcK2VtY-00zkKZ; Mon, 05 Oct 2020 22:35:44 +0200 Received: from lemmy.internal.home.lespocky.de ([192.168.243.176] helo=lemmy.home.lespocky.de) by methusalix.internal.home.lespocky.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1kPXCu-0004VK-1I; Mon, 05 Oct 2020 22:35:41 +0200 Received: (nullmailer pid 10319 invoked by uid 2001); Mon, 05 Oct 2020 20:35:37 -0000 From: Alexander Dahl To: Pavel Machek , Dan Murphy , Rob Herring Subject: [PATCH v7 02/12] dt-bindings: leds: Convert pwm to yaml Date: Mon, 5 Oct 2020 22:34:41 +0200 Message-Id: <20201005203451.9985-3-post@lespocky.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201005203451.9985-1-post@lespocky.de> References: <20201005203451.9985-1-post@lespocky.de> MIME-Version: 1.0 X-Scan-Signature: 3918240c492f27c9e5cce722baaeb3bb X-Spam-Score: -2.9 (--) X-Provags-ID: V03:K1:uUbDr4x43FG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p4/ 3/TDWkfWuxliYsbiIJGgG1llM5jbh0XtFecMU/mXjQteOIIjBqKD5QBeHyZk1MUc09NvkYB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201005_163609_053042_66C4E252 X-CRM114-Status: GOOD ( 20.92 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [217.72.192.75 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [217.72.192.75 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, Rob Herring , Alexander Dahl , linux-kernel@vger.kernel.org, Krzysztof Kozlowski , linux-mips@vger.kernel.org, Peter Ujfalusi , Russell King , Alexander Dahl , Jacek Anaszewski , linux-amlogic@lists.infradead.org, linux-omap@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-leds@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The example was adapted in the following ways: - make use of the now supported 'function' and 'color' properties - remove pwm nodes, those are documented elsewhere - align node names to new dt schema rules and dt recommendations License was not explicitly set before. The license set now is recommended by DT project. Suggested-by: Jacek Anaszewski Signed-off-by: Alexander Dahl Reviewed-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Cc: Peter Ujfalusi Cc: Russell King Acked-by: Russell King --- Notes: NOTE: Due to license set/change this needs Acked-by or Signed-off-by from: * Peter Ujfalusi * Russell King That was discussed already with Peter (original author), still waiting for Acked-by though … Changelog --------- v6 -> v7: * added Reviewed-by (Krzysztof Kozlowski) * reworded commit message (suggested by Krzysztof) * added Reviewed-by (Rob Herring) v5 -> v6: * removed pwm nodes from example (Rob) * renamed led-controller node in example (Rob) v4 -> v5: * updated based on feedback by Rob Herring * removed Acked-by v3 -> v4: * added Cc to original author of the binding v2 -> v3: * changed license identifier to recommended one * added Acked-by v2: * added this patch to series (Suggested-by: Jacek Anaszewski) .../devicetree/bindings/leds/leds-pwm.txt | 50 ------------- .../devicetree/bindings/leds/leds-pwm.yaml | 70 +++++++++++++++++++ 2 files changed, 70 insertions(+), 50 deletions(-) delete mode 100644 Documentation/devicetree/bindings/leds/leds-pwm.txt create mode 100644 Documentation/devicetree/bindings/leds/leds-pwm.yaml diff --git a/Documentation/devicetree/bindings/leds/leds-pwm.txt b/Documentation/devicetree/bindings/leds/leds-pwm.txt deleted file mode 100644 index 6c6583c35f2f..000000000000 --- a/Documentation/devicetree/bindings/leds/leds-pwm.txt +++ /dev/null @@ -1,50 +0,0 @@ -LED connected to PWM - -Required properties: -- compatible : should be "pwm-leds". - -Each LED is represented as a sub-node of the pwm-leds device. Each -node's name represents the name of the corresponding LED. - -LED sub-node properties: -- pwms : PWM property to point to the PWM device (phandle)/port (id) and to - specify the period time to be used: <&phandle id period_ns>; -- pwm-names : (optional) Name to be used by the PWM subsystem for the PWM device - For the pwms and pwm-names property please refer to: - Documentation/devicetree/bindings/pwm/pwm.txt -- max-brightness : Maximum brightness possible for the LED -- active-low : (optional) For PWMs where the LED is wired to supply - rather than ground. -- label : (optional) - see Documentation/devicetree/bindings/leds/common.txt -- linux,default-trigger : (optional) - see Documentation/devicetree/bindings/leds/common.txt - -Example: - -twl_pwm: pwm { - /* provides two PWMs (id 0, 1 for PWM1 and PWM2) */ - compatible = "ti,twl6030-pwm"; - #pwm-cells = <2>; -}; - -twl_pwmled: pwmled { - /* provides one PWM (id 0 for Charing indicator LED) */ - compatible = "ti,twl6030-pwmled"; - #pwm-cells = <2>; -}; - -pwmleds { - compatible = "pwm-leds"; - kpad { - label = "omap4::keypad"; - pwms = <&twl_pwm 0 7812500>; - max-brightness = <127>; - }; - - charging { - label = "omap4:green:chrg"; - pwms = <&twl_pwmled 0 7812500>; - max-brightness = <255>; - }; -}; diff --git a/Documentation/devicetree/bindings/leds/leds-pwm.yaml b/Documentation/devicetree/bindings/leds/leds-pwm.yaml new file mode 100644 index 000000000000..fe4d5fd25913 --- /dev/null +++ b/Documentation/devicetree/bindings/leds/leds-pwm.yaml @@ -0,0 +1,70 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/leds/leds-pwm.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: LEDs connected to PWM + +maintainers: + - Pavel Machek + +description: + Each LED is represented as a sub-node of the pwm-leds device. Each + node's name represents the name of the corresponding LED. + +properties: + compatible: + const: pwm-leds + +patternProperties: + "^led(-[0-9a-f]+)?$": + type: object + + $ref: common.yaml# + + properties: + pwms: + maxItems: 1 + + pwm-names: true + + max-brightness: + description: + Maximum brightness possible for the LED + $ref: /schemas/types.yaml#/definitions/uint32 + + active-low: + description: + For PWMs where the LED is wired to supply rather than ground. + type: boolean + + required: + - pwms + - max-brightness + +additionalProperties: false + +examples: + - | + + #include + + led-controller { + compatible = "pwm-leds"; + + led-1 { + label = "omap4::keypad"; + pwms = <&twl_pwm 0 7812500>; + max-brightness = <127>; + }; + + led-2 { + color = ; + function = LED_FUNCTION_CHARGING; + pwms = <&twl_pwmled 0 7812500>; + max-brightness = <255>; + }; + }; + +...