From patchwork Sat Mar 9 13:24:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Gansterer X-Patchwork-Id: 13587650 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AC2E4C54E41 for ; Sat, 9 Mar 2024 13:25:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D8658112056; Sat, 9 Mar 2024 13:25:43 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=paroga.com header.i=@paroga.com header.b="dKZZpPzc"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=paroga.com header.i=@paroga.com header.b="dKZZpPzc"; dkim-atps=neutral Received: from mx201.easyname.com (mx201.easyname.com [217.74.15.4]) by gabe.freedesktop.org (Postfix) with ESMTPS id 20162112057 for ; Sat, 9 Mar 2024 13:25:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=paroga.com; s=easyname; h=Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject :Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=HYn6oVROL4EgNKsgpkXuKHwwHnkgeAR9ydCIlfi6hlE=; b=dKZZpPzcjCEGJihZzAWDA8QPQn wrGzguAdeiDlK20Em7CqCJE4FrqAP8uGexR+hC2QLWKAWWOY3zD9+TSUmHCOfpZ2chvRUDbxnWLQi tzQF031xqof3fH2khiyVDAop12UbWQ7uL2mL6Cp9pPcJjcRnUNCgCkLLX/tAjAjZ9gL0M9LBtI3UX ocWBNEkplm58Ezn79bgcW5pXMYWu4zakHV0kRkJiz6tDGPTHgZR0sfhuDkpidor3K66/gIm0nucm7 nF1LCi/tVkr8xqrxtRy0zSxXPy/airR1GUPd9HCHBBEcYg3QadrnVi/yLkzXsXuz4BgvNGYfEJuT8 CGDNNl7w==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=paroga.com; s=easyname; h=Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject :Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=HYn6oVROL4EgNKsgpkXuKHwwHnkgeAR9ydCIlfi6hlE=; b=dKZZpPzcjCEGJihZzAWDA8QPQn wrGzguAdeiDlK20Em7CqCJE4FrqAP8uGexR+hC2QLWKAWWOY3zD9+TSUmHCOfpZ2chvRUDbxnWLQi tzQF031xqof3fH2khiyVDAop12UbWQ7uL2mL6Cp9pPcJjcRnUNCgCkLLX/tAjAjZ9gL0M9LBtI3UX ocWBNEkplm58Ezn79bgcW5pXMYWu4zakHV0kRkJiz6tDGPTHgZR0sfhuDkpidor3K66/gIm0nucm7 nF1LCi/tVkr8xqrxtRy0zSxXPy/airR1GUPd9HCHBBEcYg3QadrnVi/yLkzXsXuz4BgvNGYfEJuT8 CGDNNl7w==; Received: from 84-115-228-205.cable.dynamic.surfer.at ([84.115.228.205] helo=localhost.localdomain) by mx.easyname.com with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1riwhi-000Dah-TM; Sat, 09 Mar 2024 13:25:39 +0000 From: Patrick Gansterer To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Cc: Lee Jones , Daniel Thompson , Jingoo Han , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Patrick Gansterer Subject: [PATCH v3 1/2] dt-bindings: backlight: Add Texas Instruments LM3509 Date: Sat, 9 Mar 2024 14:24:55 +0100 Message-ID: <20240309132521.1290173-1-paroga@paroga.com> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 X-Easy-Autoreply: EN X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add Device Tree bindings for Texas Instruments LM3509 - a High Efficiency Boost for White LED's and/or OLED Displays Signed-off-by: Patrick Gansterer Reviewed-by: Krzysztof Kozlowski --- Changes in v3: Improved device tree bindings documentation style v2: https://lore.kernel.org/all/20240308215617.1729664-1-paroga@paroga.com/ Changes in v2: Add device tree nodes for each output Addressed multiple smaller review comments v1: https://lore.kernel.org/all/20240302212757.1871164-1-paroga@paroga.com/ .../bindings/leds/backlight/ti,lm3509.yaml | 139 ++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 Documentation/devicetree/bindings/leds/backlight/ti,lm3509.yaml diff --git a/Documentation/devicetree/bindings/leds/backlight/ti,lm3509.yaml b/Documentation/devicetree/bindings/leds/backlight/ti,lm3509.yaml new file mode 100644 index 000000000000..b67f67648852 --- /dev/null +++ b/Documentation/devicetree/bindings/leds/backlight/ti,lm3509.yaml @@ -0,0 +1,139 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/leds/backlight/ti,lm3509.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: TI LM3509 High Efficiency Boost for White LED's and/or OLED Displays + +maintainers: + - Patrick Gansterer + +description: + The LM3509 current mode boost converter offers two separate outputs. + https://www.ti.com/product/LM3509 + +properties: + compatible: + const: ti,lm3509 + + reg: + maxItems: 1 + + "#address-cells": + const: 1 + + "#size-cells": + const: 0 + + reset-gpios: + maxItems: 1 + + ti,brightness-rate-of-change-us: + description: Brightness Rate of Change in microseconds. + enum: [51, 13000, 26000, 52000] + + ti,oled-mode: + description: Enable OLED mode. + type: boolean + +patternProperties: + "^led@[01]$": + type: object + description: Properties for a string of connected LEDs. + + allOf: + - $ref: common.yaml# + + properties: + reg: + description: + The control register that is used to program the two current sinks. + The LM3509 has two registers (BMAIN and BSUB) and are represented + as 0 or 1 in this property. The two current sinks can be controlled + independently with both registers, or register BMAIN can be + configured to control both sinks with the led-sources property. + minimum: 0 + maximum: 1 + + label: true + + led-sources: + allOf: + - minItems: 1 + maxItems: 2 + items: + minimum: 0 + maximum: 1 + + default-brightness: + minimum: 0 + maximum: 31 + default: 18 + + max-brightness: + minimum: 0 + maximum: 31 + default: 31 + + required: + - reg + + additionalProperties: false + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + #include + i2c { + #address-cells = <1>; + #size-cells = <0>; + + backlight@36 { + compatible = "ti,lm3509"; + reg = <0x36>; + reset-gpios = <&gpio2 5 GPIO_ACTIVE_LOW>; + + ti,oled-mode; + ti,brightness-rate-of-change-us = <52000>; + + #address-cells = <1>; + #size-cells = <0>; + + led@0 { + reg = <0>; + led-sources = <0 1>; + label = "lcd-backlight"; + default-brightness = <12>; + max-brightness = <31>; + }; + }; + }; + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + backlight@36 { + compatible = "ti,lm3509"; + reg = <0x36>; + + #address-cells = <1>; + #size-cells = <0>; + + led@0 { + reg = <0>; + default-brightness = <12>; + }; + + led@1 { + reg = <1>; + default-brightness = <15>; + }; + }; + };