Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp358910pxk; Fri, 11 Sep 2020 08:50:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzw6h4IXGZMDof/ydLRn1VU750WSAkWD2sVrMhwIciPFN6D88j1yI4FuKlTdDDoRdTcZUD9 X-Received: by 2002:aa7:d144:: with SMTP id r4mr2768159edo.303.1599839448664; Fri, 11 Sep 2020 08:50:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599839448; cv=none; d=google.com; s=arc-20160816; b=X7jXqNQXGDgk/N7Y/6slWfnhVsanYx2vFOedZGQJ5kXwy7pTc7mMehbTTsBuP358VG k6Ol8FJwU3e8vDwC4BLAo8AyLLHfrRktSh2pSkVAkYCw5hk9zEnh4s8aAeGDjbiwhxvR CWVUd3k94cWeTExHG/6T0vhUWuvKeDsfBBdnZfiPFNm0SB3aGKqCyV9gfCXtmmbFAYn4 8bnOrS2URpdnvjXFpFC1I0kJ9FnorZuaz/KRP6DW5jkZ8jDao7gZmfQ5NWcxJTCVt9jr /s9x3tpAe0rm4aoJMIrUnxbkuf7encR4JlAUtitMXvBNf+m9h9y6WV+yAv0C5eEIuyBi /OqQ== 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; bh=0Td/+WJy7xcUl7mzlNagUp4K3Vp3YcmQKQHrpoFecHI=; b=yIKS+/aswzZpOxeYR22zKSblvJ5/VSLgg179hB5uADeQzExJefrBi8xnocy+r1ZcA+ 0ms4UyC4DfLmjZLM+zUyUuPxcIcnkxZT9VABXa9wTCQxl4xI+zFBS/EzQpNCWnKrgIk5 NPlLG51ZF6adJ1zpJnOh8GhH4iPKAQgGjKxweIMWTEO16T3eZUmnWvEq+VDSRY+l/0D1 4p2wlxpYRoNOd2AUbs3rHZ5tCYTyMaanENN+oJbyG3699k3MQRO8xQZD+ITPBz+tkG54 +4pPQ9ntqOd7XZMXVUgJQNbN5KiuShioD1iwGSlzcBgfHrCLC/0SYAfkYZjDgnRaT1fN IKyQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p11si1841689ejc.160.2020.09.11.08.50.25; Fri, 11 Sep 2020 08:50:48 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726472AbgIKPqv (ORCPT + 99 others); Fri, 11 Sep 2020 11:46:51 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:34537 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726538AbgIKPnk (ORCPT ); Fri, 11 Sep 2020 11:43:40 -0400 Received: from methusalix.internal.home.lespocky.de ([109.250.103.56]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MGA0o-1kK4Z30yom-00GafJ; Fri, 11 Sep 2020 17:41:05 +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 1kGlAc-00013I-Pk; Fri, 11 Sep 2020 17:41:03 +0200 Received: (nullmailer pid 28469 invoked by uid 2001); Fri, 11 Sep 2020 15:41:02 -0000 From: Alexander Dahl To: linux-leds@vger.kernel.org, devicetree@vger.kernel.org Cc: Jacek Anaszewski , Pavel Machek , Dan Murphy , Rob Herring , linux-kernel@vger.kernel.org, Peter Ujfalusi , Alexander Dahl , Alexander Dahl Subject: [PATCH v4 3/3] dt-bindings: leds: Convert pwm to yaml Date: Fri, 11 Sep 2020 17:40:04 +0200 Message-Id: <20200911154004.28354-4-post@lespocky.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200911154004.28354-1-post@lespocky.de> References: <20200911154004.28354-1-post@lespocky.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scan-Signature: a27db00201996a3601d2552749fb2316 X-Spam-Score: -2.9 (--) X-Provags-ID: V03:K1:Rc3ucBdQVYvH6p2B5iOmO02x3lqJqnDJA5ydqTPMWrr+j+/QhWs 68YtQfgrNlfvdAGmhLSRSSxlEUDXwjoOkkGdF82QLXgft6mbX1onkJr5QuV3ThjOdExzG29 p89l4CbhlKVMM9YZr68X73yyz3zYp+NyK40x4tYNd/zL0AXoBHFxHVbpxuvfSZgqZaf1vEh aY2i+mEWpL1iwyrcECLRA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:5FkSoacWUCI=:tjaCre2lJBYxvBG3E+NQuv h8fiA00zgIJUJx26vL2M3CAwXrfmRyQJvSd7WmM2Paju4yK3ahgLr6IQzsp2T6FH36DvOZnVv EfdwLnwNuP7JI24jdY4G5SlRr6PyJTw5PSuBLJHdNvwWb+xtH1XpQpZhFqY2pnBiuM9duGbIb m1AzKRiucvXTo6b0S1gXvGMSVUzckIJhPiToAPvMuCrZEGLJdCF2u7Bw6cBPWQ3LDuoi8Gf69 36A5y+cFgVVhEw4jRQ59Eu1Kq1f7aHJYhqDtnAucuJt4BvorIFRDKT7fP1DlgcBkK5as3ywvZ zLEmsEWvGINVNwUXHGPnO2x9OT+c/E21TfTatLjClxyZCDIGSTLzkyQ/+55RNaNipg3Z+6ByM qVpqwyT/peOVTnH93ZhfG0qVPFjxpjA+QATq5tutwcV9lvcksd3qN6LH/Mr275XC3hREz/jIP mUsLgPk21bIcNsVJyeTlqVW1zQW41Lr5kLqpLHyBuTD8w4ts1oIHxWI7QrAjrWHDZTtKLL+Xk oQFhYN1frwO8oX8dEfByYHqwJHxugQFn5GWnuGBxJQpKP8M+cj5l+BXgo9uagItVL8pu3x1CI /5owOHZz5DsGy2pEpFytEx3ShJY+IRcF3KT6Eeu0r5lycdHr7UgEUPsINQlvQ3g5ppK3dV0XY OfwypLscNNz/2yqw/H/Jf+0xPQu+qpHACIL3RuKbYe1EALD+qllKdE74Zq5cay+fLwUaLYQ1Z F7lQinZgJf5UySyOGymAKFiO32F2YXoJESbKz6kSTypvx2Wnlvk+MRH1oR40fXWJMM/jvmgYI 3/en5zfbHtneot6DEjC7Rwrdupt0Pd1/khPgCqH+qEq5KatWlBWFc/oyPVIJMMygZpNDPQr Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The example was adapted slightly to make use of the 'function' and 'color' properties. License discussed with the original author. Suggested-by: Jacek Anaszewski Signed-off-by: Alexander Dahl Acked-by: Jacek Anaszewski Cc: Peter Ujfalusi --- Notes: 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 | 85 +++++++++++++++++++ 2 files changed, 85 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..c74867492424 --- /dev/null +++ b/Documentation/devicetree/bindings/leds/leds-pwm.yaml @@ -0,0 +1,85 @@ +# 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: + "^pwm-led-([0-9a-f])$": + type: object + + $ref: common.yaml# + + properties: + pwms: + description: + "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: + description: + "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: + description: + Maximum brightness possible for the LED + + active-low: + description: + For PWMs where the LED is wired to supply rather than ground. + + required: + - pwms + - max-brightness + +examples: + - | + + #include + + 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>; + }; + + pwm_leds { + compatible = "pwm-leds"; + + pwm-led-1 { + label = "omap4::keypad"; + pwms = <&twl_pwm 0 7812500>; + max-brightness = <127>; + }; + + pwm-led-2 { + color = ; + function = LED_FUNCTION_CHARGING; + pwms = <&twl_pwmled 0 7812500>; + max-brightness = <255>; + }; + }; + +... -- 2.20.1