From patchwork Wed May 12 15:21:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ChiYuan Huang X-Patchwork-Id: 1477679 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=lsGoymji; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4FgKW36JDXz9t10 for ; Thu, 13 May 2021 02:09:51 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232439AbhELQIe (ORCPT ); Wed, 12 May 2021 12:08:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235116AbhELPte (ORCPT ); Wed, 12 May 2021 11:49:34 -0400 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 713AAC061233; Wed, 12 May 2021 08:21:53 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id h16so5994248pfk.0; Wed, 12 May 2021 08:21:53 -0700 (PDT) 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=c+foEbP8Ys0eNzGlzMVThZeYcnahn6T/Ka4KBWcvRdQ=; b=lsGoymjiuS8L1lqR1iF+HwlhNFwKfefBsVn5YYo4Ajpr5LNOpOQecnoI6X/UmpoSPN ryQ7BaDlF/YV7tR6x+8dddCNmG19qGAbm6fyFd1CVFAWNI5Otxkrl7X5bW3FfD9XWTu/ gppA3716+TvDZGW3TGbRl6FDsrzMZmwIFxFOwwZhB++mRR+K1pD0//bCdq7TkfiLCCVs D15i/yHywgOW3IKqTS0rh5AfMTZ/5bm8wDhLexxa0gtsh+XAxmKFucweRW5zg2oHBQQ9 EitiBMJEhcUG5hlwWYslgIeILK8EPO8KtN+XftNTAMwgp907Az18o2UloRCaLsQYgFx9 XNsg== 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=c+foEbP8Ys0eNzGlzMVThZeYcnahn6T/Ka4KBWcvRdQ=; b=gjKUsDjaJwMYDt1kZ6w9IeMCSzlwqE0XeKk8yaf6ABTmpk4Ki1WsLDTF1Q0RdfgJpy nArmn7L1Gi31V4F+J5BRKgIvXO6agNIMYhc7vHi240a3gvnugRosZ0xmaPcAS2YLG8Y5 Rsh6T9CRRL+Mzy1iggMuEAthuLPjJ6Z+jr5Pe6EjV4zI6WZrRtcC6zvYqSXlrxey2dCE xWQk1G7flAEte4AEU/MRGx1bBbmPXvVkV1I5c+plpAj6K9NFfF9VvW3kxnLUKUQzVRcJ IRBkdJ7UslaQ1RgWRelpdt+bxizhIbyJeCfSOzzfCwH7ut2mPuiDZ6zhjvlE/gB1iL/7 bK8A== X-Gm-Message-State: AOAM532kugw+XDeSfB7I2Gf+gAkS34tdvTxFZcBpk9nGWcD6mrzx9Obj ytYipd9XZDiA37+BtJu1wao= X-Google-Smtp-Source: ABdhPJwDM/0Ps4RrzDCgoAHI13EfSPQv6Gm/TNn1RsA5CmIs2+S9UMN/Dli8avYcOmXuHBEur9/K5Q== X-Received: by 2002:a62:4e96:0:b029:2c5:3067:90ab with SMTP id c144-20020a624e960000b02902c5306790abmr13036928pfb.38.1620832912885; Wed, 12 May 2021 08:21:52 -0700 (PDT) Received: from localhost.localdomain (1-171-3-209.dynamic-ip.hinet.net. [1.171.3.209]) by smtp.gmail.com with ESMTPSA id t133sm228633pgb.0.2021.05.12.08.21.49 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 May 2021 08:21:52 -0700 (PDT) From: cy_huang To: lee.jones@linaro.org, lgirdwood@gmail.com, broonie@kernel.org, daniel.thompson@linaro.org, jingoohan1@gmail.com, b.zolnierkie@samsung.com, pavel@ucw.cz, robh+dt@kernel.org Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org, devicetree@vger.kernel.org, cy_huang@richtek.com Subject: [PATCH v7 2/4] backlight: rt4831: Adds DT binding document for Richtek RT4831 backlight Date: Wed, 12 May 2021 23:21:38 +0800 Message-Id: <1620832900-8347-2-git-send-email-u0084500@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1620832900-8347-1-git-send-email-u0084500@gmail.com> References: <1620832900-8347-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 Reviewed-by: Daniel Thompson --- since v7 - Add allOf property refer to common.yaml. - Remove default-brightness/max-brightness description and refer string. --- .../leds/backlight/richtek,rt4831-backlight.yaml | 62 ++++++++++++++++++++++ include/dt-bindings/leds/rt4831-backlight.h | 23 ++++++++ 2 files changed, 85 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..e0ac686 --- /dev/null +++ b/Documentation/devicetree/bindings/leds/backlight/richtek,rt4831-backlight.yaml @@ -0,0 +1,62 @@ +# 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 + +allOf: + - $ref: common.yaml# + +properties: + compatible: + const: richtek,rt4831-backlight + + default-brightness: + minimum: 0 + maximum: 2048 + + max-brightness: + 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 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 Wed May 12 15:21:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ChiYuan Huang X-Patchwork-Id: 1477678 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=FiOiW1/5; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4FgKW23cwGz9t0p for ; Thu, 13 May 2021 02:09:50 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231190AbhELQIc (ORCPT ); Wed, 12 May 2021 12:08:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235594AbhELPt3 (ORCPT ); Wed, 12 May 2021 11:49:29 -0400 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86849C08E9B5; Wed, 12 May 2021 08:21:57 -0700 (PDT) Received: by mail-pj1-x102c.google.com with SMTP id ep16-20020a17090ae650b029015d00f578a8so568434pjb.2; Wed, 12 May 2021 08:21:57 -0700 (PDT) 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=tVgAkGBFVimZZBUracvErIwvpUEHqs66nyqdBflm5/U=; b=FiOiW1/5F8Tv5RnGj+rHwDk1+p20TPFSFAehCRyPxI9/81bRBgMUBOmlvJxKZNRm6n c9ID7I9wp7I/x6bwwBYIh/PT5Fcij5Zoue9Shqd1CfPzQWFtbXHvLla2LC05+p1EfSr1 10i24Isemv4n3WVD5h7YEqZ+NZIYTfjHImdp+BHFhG/rT3pCa6XV0e5KLO5BbUMnQbGd k69CRcGIdn2hfpMcMBqUrqZJVzk/gvBi/CC6SsAtyPYX18AUj4lprOXN+vS3rEC+erRC VRAO8V8/Cmbi8qRMzkJ1dtzap37PjezpXylVIFbx4rMD/cwcV9dEoA5G/5mzygJjVJVd HpZA== 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=tVgAkGBFVimZZBUracvErIwvpUEHqs66nyqdBflm5/U=; b=YeUiPH3JNEj0tJNLKIcDYgY5VpD+tm4iahP1KzUViGnB6i+3BSJsJRQoJTPYKKz4+k c2xLrzaU0ZKVu+I5OprjbVjc82k//W36E6cyiNvF9H46IpRlo88XFKMSXHLUdMECsn80 gM6oAaFEc7yn+4PXjF7NWYqkPa7Lge6Anzvc3Z01IQCq3OvD443iK2DLfn1X6gIWLwZS B9PsQbenlhC2Sc0vyzpxqQl9pgHc/XCDZqxGJJVh7JkMAtzb7qxMdul8hkZkIn4WIDBK jtqsFiGFNbQu8SjA1HFY9vFrawUPIC42GsXcMKntYRPoCRnwHM+VRdEGQvCGEJ+CXIE3 DzEA== X-Gm-Message-State: AOAM531cO1iAbASqFvkG6MIPVSkduhBlkc8il/NIzyBoQhfwKvojSWcp 1XA71/0ARLeMXNys3LdliQI= X-Google-Smtp-Source: ABdhPJwQh6KTizOSzT5reuY78FXiWUzhLhyiRGLcw/LjHS0z/CiqoR9yKJ7MtEWrp7ToClkc+3TX3w== X-Received: by 2002:a17:90b:300e:: with SMTP id hg14mr39484848pjb.149.1620832917021; Wed, 12 May 2021 08:21:57 -0700 (PDT) Received: from localhost.localdomain (1-171-3-209.dynamic-ip.hinet.net. [1.171.3.209]) by smtp.gmail.com with ESMTPSA id t133sm228633pgb.0.2021.05.12.08.21.53 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 May 2021 08:21:56 -0700 (PDT) From: cy_huang To: lee.jones@linaro.org, lgirdwood@gmail.com, broonie@kernel.org, daniel.thompson@linaro.org, jingoohan1@gmail.com, b.zolnierkie@samsung.com, pavel@ucw.cz, robh+dt@kernel.org Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org, devicetree@vger.kernel.org, cy_huang@richtek.com Subject: [PATCH v7 3/4] mfd: rt4831: Adds DT binding document for Richtek RT4831 Date: Wed, 12 May 2021 23:21:39 +0800 Message-Id: <1620832900-8347-3-git-send-email-u0084500@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1620832900-8347-1-git-send-email-u0084500@gmail.com> References: <1620832900-8347-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. Signed-off-by: ChiYuan Huang Reviewed-by: Rob Herring --- .../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 ; + }; + }; + };