From patchwork Fri Dec 17 17:07:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 526752 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7846C433F5 for ; Fri, 17 Dec 2021 17:07:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239129AbhLQRHU (ORCPT ); Fri, 17 Dec 2021 12:07:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239636AbhLQRHT (ORCPT ); Fri, 17 Dec 2021 12:07:19 -0500 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40A77C061574; Fri, 17 Dec 2021 09:07:19 -0800 (PST) Received: by mail-wm1-x32b.google.com with SMTP id bg2-20020a05600c3c8200b0034565c2be15so4543844wmb.0; Fri, 17 Dec 2021 09:07:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rj5IyEdB5LfycbzI0ZIjHtZ0iD/3vI9d8AkqKZ9gT38=; b=adHyDt0K5r7da7gXAlO/cl46F93q8YB11ACsGn9ohSPiTWVmEGrZpe0QikzYVTH78z aiJDKCfXGbsebmia2ilp44/EOrdOcVWqUfzZHxwaalhR8nLduf9pLfYkaVS3PkuYqAb4 oRZp8ZyUN9uYyyoXvzOC/Utcs6+1U1zwUplvNZ3kKIq7JcFhAMwhs4ybfLAd9V6WGQe6 XRRjscRRLnTA+VfxmhwD6p9o2BxVthAR9D6R9/Uq87/Zf/hL4dD7+/00wXk18SPZRGys 3KCrSGtBCsf/+wOcRwywCcVwr97gT8p/zrGNvfHgQT/E7MNNgwJZuhFntOp9fKMYhtbN xJ2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rj5IyEdB5LfycbzI0ZIjHtZ0iD/3vI9d8AkqKZ9gT38=; b=KbYE1QxjI/mir7ZWjJhbPRYq4VMNnoR1zuSAKYor0i7+CGr4EDFewl6pRan4sXbUHZ T1pQUqyFC2G1/fcnG9q+s016K6zDi3PWJS38PT/DvUyr/1PNqt9NvTChFe/1GvTDGIng 8+W0yMCuxyFFMuaTqKTb0+X4GSoc+FVodpIEwosBBa7shI1Mj3WwewirGdaI2x/d1IG/ DvrJZ9NXcxsmeKqZDOS5FJhaRP2pcX7fWM1QCuKgXBeN2yfM8GJDSUWA1buRcq1GVbMX Jz0XlgU+9foIzHGURmIL5+FcGSah7aF/TMZmM3GDXtzryoK/DLA5ZH+n4ZwNG1yw2rI3 6F0Q== X-Gm-Message-State: AOAM5331FKf+9OEnHhc5mmvtt1ArDxFGpSDE+gF9wATo5idd1FmZV3Xh wbPb+/e3zpmNXy6gXndv1Xo= X-Google-Smtp-Source: ABdhPJwmvDx62eDbmIAfL5AeTax+2/vdjtBv/diBvtkgm60FDAly3+dkMrD9dNIXOBOkgVaXBkjQbg== X-Received: by 2002:a1c:8015:: with SMTP id b21mr10219610wmd.161.1639760837868; Fri, 17 Dec 2021 09:07:17 -0800 (PST) Received: from localhost ([193.209.96.43]) by smtp.gmail.com with ESMTPSA id l8sm11940149wmc.40.2021.12.17.09.07.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Dec 2021 09:07:16 -0800 (PST) From: Thierry Reding To: Lee Jones , Daniel Thompson , Jingoo Han , Pavel Machek , Rob Herring Cc: Milo Kim , Jacek Anaszewski , dri-devel@lists.freedesktop.org, linux-leds@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH 1/2] dt-bindings: leds: Document rfkill* trigger Date: Fri, 17 Dec 2021 18:07:14 +0100 Message-Id: <20211217170715.2893923-1-thierry.reding@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org From: Thierry Reding LEDs can use rfkill events as a trigger source, so document these in the device tree bindings. Signed-off-by: Thierry Reding Reviewed-by: Rob Herring --- .../devicetree/bindings/leds/common.yaml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Documentation/devicetree/bindings/leds/common.yaml b/Documentation/devicetree/bindings/leds/common.yaml index 697102707703..f686907b4907 100644 --- a/Documentation/devicetree/bindings/leds/common.yaml +++ b/Documentation/devicetree/bindings/leds/common.yaml @@ -79,24 +79,25 @@ properties: the LED. $ref: /schemas/types.yaml#/definitions/string - enum: + oneOf: # LED will act as a back-light, controlled by the framebuffer system - - backlight + - const: backlight # LED will turn on (but for leds-gpio see "default-state" property in # Documentation/devicetree/bindings/leds/leds-gpio.yaml) - - default-on + - const: default-on # LED "double" flashes at a load average based rate - - heartbeat + - const: heartbeat # LED indicates disk activity - - disk-activity + - const: disk-activity # LED indicates IDE disk activity (deprecated), in new implementations # use "disk-activity" - - ide-disk + - const: ide-disk # LED flashes at a fixed, configurable rate - - timer + - const: timer # LED alters the brightness for the specified duration with one software # timer (requires "led-pattern" property) - - pattern + - const: pattern + - pattern: "^rfkill[0-9]+$" led-pattern: description: | From patchwork Fri Dec 17 17:07:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 525363 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F67FC433F5 for ; Fri, 17 Dec 2021 17:07:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236055AbhLQRHY (ORCPT ); Fri, 17 Dec 2021 12:07:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239665AbhLQRHW (ORCPT ); Fri, 17 Dec 2021 12:07:22 -0500 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFBD7C061574; Fri, 17 Dec 2021 09:07:21 -0800 (PST) Received: by mail-wr1-x433.google.com with SMTP id o13so5254021wrs.12; Fri, 17 Dec 2021 09:07:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zoS7CsJ40sO7fBTmwqL9a7mTuTbz2YmZ0X8YJ+KC0Js=; b=oJ7bj0Dw7aVB1n0XibbrBHf+0ij3yhOKuXNzf708V84+FSQTtPpKwXWg/Wrun26i6L IDnFSKkAZjoKNG8mChS8++wUwFIgkPpBeECSMLVR5zaQWw0ic0w4QpSUi2CCs4exxnuz iUPBs1QEZtojh//CbecMoc4MQv2RuAhlOfKlupyIbekyEKeKTsv0Km0Ivz79YRdXxDGy Kps0UBje78UpF9h+BFM7Q8jxch+wr7smICAi4GdqexfQvG1omvnwxBUiUpq3xfN7WT1+ zPTwx3Dayw+oZrwRgP733l5uRDhVFGVZCauZC/gJLykNa521wDNJKABiiP9gwpc+K9Dl wWrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zoS7CsJ40sO7fBTmwqL9a7mTuTbz2YmZ0X8YJ+KC0Js=; b=K3vI1598Iq9pNam3YoqMdUGJd7nNi5+xlaxPLdcT1Nvs55yhOERbF0GPRAhh3l4wzH yOGeCbIjR9VWyl2IWiNn/C611IqiAGKsI5UjFrUgZ1eNTLyKNNvicFlYsbtWqDgC40Ni JrdZaJjTWZEauIlsGub27bbzvJIhafGYFa52nJhMig7RPD1mEqD+nZJPJPQHTCOJajHm 8dhZPxLJgy3QejiB8FxqF1Ulh15EeUH4XOo3ES+wRkVhjjsYLXNfg2/AU4v1i/WawEyM pqznCrFE1o83pDbLJvNfdRVQUo4J6LbeDSJk5mu3Xx3r/gYq4Mhy99pWo6jlXSeAQJuz 8kLg== X-Gm-Message-State: AOAM532KB0Ec/RnCmfbjYZj4Ny1fQTasCj7stGzaquwhXyrrOrgFmrfw 2nT0LUzozJNa9XQRniPjX+4= X-Google-Smtp-Source: ABdhPJzuYn74HEE1+NOvXsw2tw8dxMq2Y9fn64ltymYHN3h8cFS/99urNMIMvX7pnbadu+o8qCta0Q== X-Received: by 2002:a05:6000:2ce:: with SMTP id o14mr1624139wry.70.1639760840241; Fri, 17 Dec 2021 09:07:20 -0800 (PST) Received: from localhost ([193.209.96.43]) by smtp.gmail.com with ESMTPSA id c8sm9122994wmq.34.2021.12.17.09.07.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Dec 2021 09:07:19 -0800 (PST) From: Thierry Reding To: Lee Jones , Daniel Thompson , Jingoo Han , Pavel Machek , Rob Herring Cc: Milo Kim , Jacek Anaszewski , dri-devel@lists.freedesktop.org, linux-leds@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH 2/2] dt-bindings: leds: lp855x: Convert to json-schema Date: Fri, 17 Dec 2021 18:07:15 +0100 Message-Id: <20211217170715.2893923-2-thierry.reding@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211217170715.2893923-1-thierry.reding@gmail.com> References: <20211217170715.2893923-1-thierry.reding@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org From: Thierry Reding Convert the Texas Instruments LP855x backlight device tree bindings from the free-form text format to json-schema. Signed-off-by: Thierry Reding --- .../bindings/leds/backlight/lp855x.txt | 72 --------- .../bindings/leds/backlight/ti,lp8550.yaml | 151 ++++++++++++++++++ 2 files changed, 151 insertions(+), 72 deletions(-) delete mode 100644 Documentation/devicetree/bindings/leds/backlight/lp855x.txt create mode 100644 Documentation/devicetree/bindings/leds/backlight/ti,lp8550.yaml diff --git a/Documentation/devicetree/bindings/leds/backlight/lp855x.txt b/Documentation/devicetree/bindings/leds/backlight/lp855x.txt deleted file mode 100644 index 88f56641fc28..000000000000 --- a/Documentation/devicetree/bindings/leds/backlight/lp855x.txt +++ /dev/null @@ -1,72 +0,0 @@ -lp855x bindings - -Required properties: - - compatible: "ti,lp8550", "ti,lp8551", "ti,lp8552", "ti,lp8553", - "ti,lp8555", "ti,lp8556", "ti,lp8557" - - reg: I2C slave address (u8) - - dev-ctrl: Value of DEVICE CONTROL register (u8). It depends on the device. - -Optional properties: - - bl-name: Backlight device name (string) - - init-brt: Initial value of backlight brightness (u8) - - pwm-period: PWM period value. Set only PWM input mode used (u32) - - rom-addr: Register address of ROM area to be updated (u8) - - rom-val: Register value to be updated (u8) - - power-supply: Regulator which controls the 3V rail - - enable-supply: Regulator which controls the EN/VDDIO input - -Example: - - /* LP8555 */ - backlight@2c { - compatible = "ti,lp8555"; - reg = <0x2c>; - - dev-ctrl = /bits/ 8 <0x00>; - pwm-period = <10000>; - - /* 4V OV, 4 output LED0 string enabled */ - rom_14h { - rom-addr = /bits/ 8 <0x14>; - rom-val = /bits/ 8 <0xcf>; - }; - - /* Heavy smoothing, 24ms ramp time step */ - rom_15h { - rom-addr = /bits/ 8 <0x15>; - rom-val = /bits/ 8 <0xc7>; - }; - - /* 4 output LED1 string enabled */ - rom_19h { - rom-addr = /bits/ 8 <0x19>; - rom-val = /bits/ 8 <0x0f>; - }; - }; - - /* LP8556 */ - backlight@2c { - compatible = "ti,lp8556"; - reg = <0x2c>; - - bl-name = "lcd-bl"; - dev-ctrl = /bits/ 8 <0x85>; - init-brt = /bits/ 8 <0x10>; - }; - - /* LP8557 */ - backlight@2c { - compatible = "ti,lp8557"; - reg = <0x2c>; - enable-supply = <&backlight_vddio>; - power-supply = <&backlight_vdd>; - - dev-ctrl = /bits/ 8 <0x41>; - init-brt = /bits/ 8 <0x0a>; - - /* 4V OV, 4 output LED string enabled */ - rom_14h { - rom-addr = /bits/ 8 <0x14>; - rom-val = /bits/ 8 <0xcf>; - }; - }; diff --git a/Documentation/devicetree/bindings/leds/backlight/ti,lp8550.yaml b/Documentation/devicetree/bindings/leds/backlight/ti,lp8550.yaml new file mode 100644 index 000000000000..412779a5462b --- /dev/null +++ b/Documentation/devicetree/bindings/leds/backlight/ti,lp8550.yaml @@ -0,0 +1,151 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/leds/backlight/ti,lp8550.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Texas Instruments LP855x family devicetree bindings + +maintainers: + - Milo Kim + - Rob Herring + +properties: + compatible: + enum: + - ti,lp8550 + - ti,lp8551 + - ti,lp8552 + - ti,lp8553 + - ti,lp8555 + - ti,lp8556 + - ti,lp8557 + + reg: + maxItems: 1 + + dev-ctrl: + $ref: /schemas/types.yaml#/definitions/uint8 + description: Value of DEVICE CONTROL register. It depends on the device. + + bl-name: + $ref: /schemas/types.yaml#/definitions/string + description: Backlight device name + + init-brt: + $ref: /schemas/types.yaml#/definitions/uint8 + description: Initial value of backlight brightness + + pwm-period: + $ref: /schemas/types.yaml#/definitions/uint32 + description: PWM period value. Set only PWM input mode used + + pwm-names: + maxItems: 1 + + pwms: + maxItems: 1 + + power-supply: + description: Regulator which controls the 3V rail + + enable-supply: + description: Regulator which controls the EN/VDDIO input + +patternProperties: + '^rom_[0-9a-f]{2}h$': + type: object + properties: + rom-addr: + $ref: /schemas/types.yaml#/definitions/uint8 + description: Register address of ROM area to be updated + + rom-val: + $ref: /schemas/types.yaml#/definitions/uint8 + description: Register value to be updated + + additionalProperties: false + + required: + - rom-addr + - rom-val + +additionalProperties: false + +required: + - compatible + - reg + - dev-ctrl + +examples: + # LP8555 + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + backlight@2c { + compatible = "ti,lp8555"; + reg = <0x2c>; + + dev-ctrl = /bits/ 8 <0x00>; + pwm-period = <10000>; + + /* 4V OV, 4 output LED0 string enabled */ + rom_14h { + rom-addr = /bits/ 8 <0x14>; + rom-val = /bits/ 8 <0xcf>; + }; + + /* Heavy smoothing, 24ms ramp time step */ + rom_15h { + rom-addr = /bits/ 8 <0x15>; + rom-val = /bits/ 8 <0xc7>; + }; + + /* 4 output LED1 string enabled */ + rom_19h { + rom-addr = /bits/ 8 <0x19>; + rom-val = /bits/ 8 <0x0f>; + }; + }; + }; + + # LP8556 + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + backlight@2c { + compatible = "ti,lp8556"; + reg = <0x2c>; + + bl-name = "lcd-bl"; + dev-ctrl = /bits/ 8 <0x85>; + init-brt = /bits/ 8 <0x10>; + }; + }; + + # LP8557 + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + backlight@2c { + compatible = "ti,lp8557"; + reg = <0x2c>; + enable-supply = <&backlight_vddio>; + power-supply = <&backlight_vdd>; + + dev-ctrl = /bits/ 8 <0x41>; + init-brt = /bits/ 8 <0x0a>; + + /* 4V OV, 4 output LED string enabled */ + rom_14h { + rom-addr = /bits/ 8 <0x14>; + rom-val = /bits/ 8 <0xcf>; + }; + }; + };