From patchwork Tue Dec 8 15:54:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: cy_huang X-Patchwork-Id: 339860 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3776C4167B for ; Tue, 8 Dec 2020 15:56:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AA87423AC0 for ; Tue, 8 Dec 2020 15:56:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729679AbgLHPzr (ORCPT ); Tue, 8 Dec 2020 10:55:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730208AbgLHPzr (ORCPT ); Tue, 8 Dec 2020 10:55:47 -0500 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B6D6C0613D6; Tue, 8 Dec 2020 07:55:01 -0800 (PST) Received: by mail-pf1-x443.google.com with SMTP id c12so7175866pfo.10; Tue, 08 Dec 2020 07:55:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=SippBiPvnRnapzXhq7fOVJkKRsVVBzMZERi+BPHUIs4=; b=ch+eqqGXD00JXvr/ff7iqUJaF80VHgnLYOiJoJnCmwT/2wTaJnx8t/aBPfAIXbaTqy EYiTM/jBU3NomitdB7PoZIrn4FNJzxBRDPwUYcTrvWmqrHfc+sMGrU6POoqZ4f+ZNfmw WNFsw5vvW7BjjAXMzmHfJSHdYkU3NqJyUVC0gW/mLCo3WIEJcAf5vbHeVUoD0pCU5T+F hXbWs2MGef3i6z/74dRa3mmLA8myS3QF7AM8F/wEes/1bIPyBcYtXOybkZ57WHZOEGvx nGD1R1+r1L8TgN9YsFw5GKatJdmz13xDA/tO1N35QCiBsou+csEnZKCqPpBhraKzIA1m p/AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=SippBiPvnRnapzXhq7fOVJkKRsVVBzMZERi+BPHUIs4=; b=XpihKC2l2GkgPc4YlWmK28EafiD4RGkFxs9OdJQO/PiefEtrs56aU61Q/+wsp+XKlw ALMrdGCUZRfIoMuDmO0dANzidkNGGFR29VwCs23xo0VE9WVwfhhRRNGYqMbW8MQfpvtL x1bZnqowO942czZY50bCfFosm0iBEJWS3uohPvEME+vXgNF1v6wgbFji3kk/8LjDgyyk P78Aq7zZKRv2QjyNHOEDi70L+0r4it+MYXT3zisJILOq60YWwyQvSczUpLeVU5Bq641C JeiSck/5OdaSaiLL/H4ZOMjZR2LDwag8qOEvNMUokxlpzpRBzUD6R5YnP6nYbsJifwBk MiWA== X-Gm-Message-State: AOAM530hi5KmH5g2Zrdi+5bjE4By/dc3AX7xATrCkwBsstX+EAUMdd/h 0ORGRXYKlztXs8Qhx2mw+Y4= X-Google-Smtp-Source: ABdhPJz929CIOM6Ow03Xr+astPusY0L5CX7z4IgaGOOHbPXSzlHZ8Fr6WalYqAMyfpLlLMX/Zyqeow== X-Received: by 2002:aa7:8298:0:b029:19c:1564:7b0c with SMTP id s24-20020aa782980000b029019c15647b0cmr20643481pfm.6.1607442900401; Tue, 08 Dec 2020 07:55:00 -0800 (PST) Received: from localhost.localdomain (1-171-4-151.dynamic-ip.hinet.net. [1.171.4.151]) by smtp.gmail.com with ESMTPSA id a17sm6700725pgw.80.2020.12.08.07.54.58 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Dec 2020 07:54:59 -0800 (PST) From: cy_huang To: lee.jones@linaro.org, robh+dt@kernel.org Cc: cy_huang@richtek.com, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v3 2/4] backlight: rt4831: Adds DT binding document for Richtek RT4831 backlight Date: Tue, 8 Dec 2020 23:54:44 +0800 Message-Id: <1607442886-13046-2-git-send-email-u0084500@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1607442886-13046-1-git-send-email-u0084500@gmail.com> References: <1607442886-13046-1-git-send-email-u0084500@gmail.com> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: ChiYuan Huang Adds DT binding document for Richtek RT4831 backlight. Signed-off-by: ChiYuan Huang --- since v3 - Move inlcude/dt-bindings/leds/rt4831-backlight.h from patch 0004 to here. - Add dual license tag in header and backlight binding document. - Left backlight dt-binding example only. --- .../leds/backlight/richtek,rt4831-backlight.yaml | 76 ++++++++++++++++++++++ include/dt-bindings/leds/rt4831-backlight.h | 23 +++++++ 2 files changed, 99 insertions(+) create mode 100644 Documentation/devicetree/bindings/leds/backlight/richtek,rt4831-backlight.yaml create mode 100644 include/dt-bindings/leds/rt4831-backlight.h diff --git a/Documentation/devicetree/bindings/leds/backlight/richtek,rt4831-backlight.yaml b/Documentation/devicetree/bindings/leds/backlight/richtek,rt4831-backlight.yaml new file mode 100644 index 00000000..f24c8d1 --- /dev/null +++ b/Documentation/devicetree/bindings/leds/backlight/richtek,rt4831-backlight.yaml @@ -0,0 +1,76 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/leds/backlight/richtek,rt4831-backlight.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Richtek RT4831 Backlight + +maintainers: + - ChiYuan Huang + +description: | + RT4831 is a mutifunctional device that can provide power to the LCD display + and LCD backlight. + + For the LCD backlight, it can provide four channel WLED driving capability. + Each channel driving current is up to 30mA + + Datasheet is available at + https://www.richtek.com/assets/product_file/RT4831A/DS4831A-05.pdf + +properties: + compatible: + const: richtek,rt4831-backlight + + default-brightness: + description: | + The default brightness that applied to the system on start-up. + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 0 + maximum: 2048 + + max-brightness: + description: | + The max brightness for the H/W limit + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 0 + maximum: 2048 + + richtek,pwm-enable: + description: | + Specify the backlight dimming following by PWM duty or by SW control. + type: boolean + + richtek,bled-ovp-sel: + description: | + Backlight OVP level selection, currently support 17V/21V/25V/29V. + $ref: /schemas/types.yaml#/definitions/uint8 + default: 1 + minimum: 0 + maximum: 3 + + richtek,channel-use: + description: | + Backlight LED channel to be used. + BIT 0/1/2/3 is used to indicate led channel 1/2/3/4 enable or disable. + $ref: /schemas/types.yaml#/definitions/uint8 + minimum: 1 + maximum: 15 + +required: + - compatible + - richtek,channel-use + +additionalProperties: false + +examples: + - | + #include + backlight { + compatible = "richtek,rt4831-backlight"; + default-brightness = <1024>; + max-brightness = <2048>; + richtek,bled-ovp-sel = /bits/ 8 ; + richtek,channel-use = /bits/ 8 ; + }; diff --git a/include/dt-bindings/leds/rt4831-backlight.h b/include/dt-bindings/leds/rt4831-backlight.h new file mode 100644 index 00000000..125c635 --- /dev/null +++ b/include/dt-bindings/leds/rt4831-backlight.h @@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ +/* + * This header provides constants for rt4831 backlight bindings. + * + * Copyright (C) 2020, Richtek Technology Corp. + * Author: ChiYuan Huang + */ + +#ifndef _DT_BINDINGS_RT4831_BACKLIGHT_H +#define _DT_BINDINGS_RT4831_BACKLIGHT_H + +#define RT4831_BLOVPLVL_17V 0 +#define RT4831_BLOVPLVL_21V 1 +#define RT4831_BLOVPLVL_25V 2 +#define RT4831_BLOVPLVL_29V 3 + +#define RT4831_BLED_CH1EN (1 << 0) +#define RT4831_BLED_CH2EN (1 << 1) +#define RT4831_BLED_CH3EN (1 << 2) +#define RT4831_BLED_CH4EN (1 << 3) +#define RT4831_BLED_ALLCHEN ((1 << 4) - 1) + +#endif /* _DT_BINDINGS_RT4831_BACKLIGHT_H */ From patchwork Tue Dec 8 15:54:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: cy_huang X-Patchwork-Id: 339861 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BBF9CC4361B for ; Tue, 8 Dec 2020 15:56:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8F9BF23AAA for ; Tue, 8 Dec 2020 15:56:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730002AbgLHPzq (ORCPT ); Tue, 8 Dec 2020 10:55:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729679AbgLHPzq (ORCPT ); Tue, 8 Dec 2020 10:55:46 -0500 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EA34C061794; Tue, 8 Dec 2020 07:55:06 -0800 (PST) Received: by mail-pg1-x541.google.com with SMTP id w4so12498470pgg.13; Tue, 08 Dec 2020 07:55:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=v4mKs5tFyRcSvuMMjNgZiEEAHEkdSYJjuCntwnlpFXk=; b=ejPfFD8ipXJBShbHw4spY9uezm7jdpfDf3fEEhYRrS90wCx1STmlMH5q+ckv6Xd1h7 kwOt6Ik2YFoyqkVQFFa/E8bklf9XVob1wRpwcOOVS7ZkUkgQPQcKnRLq9zzFbYZ0j9BS JRqnwEtGv8jSyy719lj/LEagEwGqc8cvdB25zKbo38dfqyl2qV4GC8iQv4M72vIb3WZJ vpm2zFt080PNjJUIIdvwhKcFrh254JUJzozlfTo+moQXbBdXFGPSRo9P5xYFfS6RSr3y warXfWvl276NvwWlpvmIBZpTyObvrCSGnsqgGHAvgErK2uNSn0JLNiyLes3cdPfOqMLx /B4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=v4mKs5tFyRcSvuMMjNgZiEEAHEkdSYJjuCntwnlpFXk=; b=ruPxgbn20rDMdvB4Vnu6nTnyxNfyorylpLHhF6ki327IlvaIuR0sXE+QbtyPyanUc6 HPTwAExA69syGdgvpNgZ4gCrYWExnVRb4VjXvhjv8mUnbaecvoYfmfUzp2UmzM2+j8z7 WIFq4cYFtxQMHXCErDB9OoUKQWHVtuco2dU+tm20G5stNraPjqcwC/wBDnrR7bvJS7yn tBenFZ9HnYAT8Hmz0K4fyzMftCijzulUO8FEXZUoAmXqyhg6RfNVaoMPCYpEqTWzJ8RW DCKslAExZtc6nbY+E7ZkDMC5ucgk97jU/pAjDX7yiwhlqIlTIjt4m9sb0BSxiC3cxdMb sELw== X-Gm-Message-State: AOAM530gXzughfMYZ5zHV5xsVJIjtsAEGwAsUdaNah9JFh/t1+q5/sFw Ff8lyBT5kZenPrz7ctCUd6c= X-Google-Smtp-Source: ABdhPJyJzvS5Z7MyKEuSLYEhire5zQP+BWhdeDklf1FUI7jlZqX1mJkX87EAZItP5nBU0W0B7SYNmQ== X-Received: by 2002:a17:90a:510e:: with SMTP id t14mr4908437pjh.159.1607442905547; Tue, 08 Dec 2020 07:55:05 -0800 (PST) Received: from localhost.localdomain (1-171-4-151.dynamic-ip.hinet.net. [1.171.4.151]) by smtp.gmail.com with ESMTPSA id a17sm6700725pgw.80.2020.12.08.07.55.03 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Dec 2020 07:55:04 -0800 (PST) From: cy_huang To: lee.jones@linaro.org, robh+dt@kernel.org Cc: cy_huang@richtek.com, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v3 4/4] mfd: rt4831: Adds DT binding document for Richtek RT4831 MFD core Date: Tue, 8 Dec 2020 23:54:46 +0800 Message-Id: <1607442886-13046-4-git-send-email-u0084500@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1607442886-13046-1-git-send-email-u0084500@gmail.com> References: <1607442886-13046-1-git-send-email-u0084500@gmail.com> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: ChiYuan Huang Adds DT binding document for Richtek RT4831 MFD core. Signed-off-by: ChiYuan Huang --- This patch depends on "backlight: rt4831: Adds DT binding document for Richtek RT4831 backlight". "regulator: rt4831: Adds DT binding document for Richtek RT4831 DSV regulator". since v3 - Move include/dt-bindings/leds/rt4831-backlight.h to patch 0002. - Add dual license tag in mfd binding document. since v2 - Add regulator-allow-bypass flag in DSVLCM. --- .../devicetree/bindings/mfd/richtek,rt4831.yaml | 90 ++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/richtek,rt4831.yaml diff --git a/Documentation/devicetree/bindings/mfd/richtek,rt4831.yaml b/Documentation/devicetree/bindings/mfd/richtek,rt4831.yaml new file mode 100644 index 00000000..4762eb1 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/richtek,rt4831.yaml @@ -0,0 +1,90 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mfd/richtek,rt4831.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Richtek RT4831 DSV and Backlight Integrated IC + +maintainers: + - ChiYuan Huang + +description: | + RT4831 is a multifunctional device that can provide power to the LCD display + and LCD backlight. + + For Display Bias Voltage DSVP and DSVN, the output range is about 4V to 6.5V. + It's sufficient to meet the current LCD power requirement. + + For the LCD backlight, it can provide four channel WLED driving capability. + Each channel driving current is up to 30mA + + Datasheet is available at + https://www.richtek.com/assets/product_file/RT4831A/DS4831A-05.pdf + +properties: + compatible: + const: richtek,rt4831 + + reg: + description: I2C device address. + maxItems: 1 + + enable-gpios: + description: | + GPIO to enable/disable the chip. It is optional. + Some usage directly tied this pin to follow VIO 1.8V power on sequence. + maxItems: 1 + + regulators: + $ref: ../regulator/richtek,rt4831-regulator.yaml + + backlight: + $ref: ../leds/backlight/richtek,rt4831-backlight.yaml + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + #include + i2c { + #address-cells = <1>; + #size-cells = <0>; + + rt4831@11 { + compatible = "richtek,rt4831"; + reg = <0x11>; + + regulators { + DSVLCM { + regulator-min-microvolt = <4000000>; + regulator-max-microvolt = <7150000>; + regulator-allow-bypass; + }; + DSVP { + regulator-name = "rt4831-dsvp"; + regulator-min-microvolt = <4000000>; + regulator-max-microvolt = <6500000>; + regulator-boot-on; + }; + DSVN { + regulator-name = "rt4831-dsvn"; + regulator-min-microvolt = <4000000>; + regulator-max-microvolt = <6500000>; + regulator-boot-on; + }; + }; + + backlight { + compatible = "richtek,rt4831-backlight"; + default-brightness = <1024>; + max-brightness = <2048>; + richtek,bled-ovp-sel = /bits/ 8 ; + richtek,channel-use = /bits/ 8 ; + }; + }; + };