From mboxrd@z Thu Jan 1 00:00:00 1970 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 06B0CC433FE for ; Tue, 31 May 2022 20:46:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343586AbiEaUq0 (ORCPT ); Tue, 31 May 2022 16:46:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237511AbiEaUqZ (ORCPT ); Tue, 31 May 2022 16:46:25 -0400 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 850418CB38 for ; Tue, 31 May 2022 13:46:23 -0700 (PDT) Received: by mail-ej1-x630.google.com with SMTP id f9so29021142ejc.0 for ; Tue, 31 May 2022 13:46:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=KcvmS0RVCH7dS0drP08+taDktOji7A6kv3U7tUCF6Ik=; b=HTr4rtci7pN7h0V00Ch+MPN8QFo2ca3cbuR97hJFCjr/w9xXjQBq2dVHkwu2xOQxuP 1BAcI7MDZnyoPC+UpdTeLBJPlg2PhTf6pVAwFMZWgaAMuCIAkFRoqjReMoODOOjmEMJX IjUtvCCX1SazMLSX9dPPH4ll/fvXY9zNkCpWYWWm6qiRiNScCJ5X+FtKaejGXadsVW5p Lz/guvnDDwLOuKIEGKL0cTmlihLsXks9QmOOfUl3nvKkS4hvGf3sf1rozyplnW3X71yG o2gtsW2bOmKqoFZiVYnKs8AIcYfZFHvPWTEsCleu1N6AOYbrFfsieqmW/d1LzaiWM6l2 +aOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=KcvmS0RVCH7dS0drP08+taDktOji7A6kv3U7tUCF6Ik=; b=1/Zf/KfF/vRoMTHCaYp/KT1QFSFPrs+RJt6Os2vPrDj7sq4eUHWY55yfZUfp9ULO2E BhRQjNMTHcZLF41WNMrYcAb5l53mWsc8xW3+5qhdNuC0zo++xFEbpHfGEZZ4fwH1sHLd DZho1+rD4GhfbjPRxgPsPLPrSwI8oV3Iep2705CrkWcAxR7hiE8xPC8pjFw3mIporHRG 1y7LK+3EVNddJSaDrDNYW8+a48ISfUoADTURLZrC2JpdxVKFGyRu69oR9F/D7OAzw8N4 7IgvkI6DTsZw30LWH9A5Wm9iMYUG/QKfvIUiR6JP7+w+ve8E/wGDXQ0N7MooH7n9wtvg oWXw== X-Gm-Message-State: AOAM533UVw5wrirJtUeR3juCcQZMZ6pVF8nc0jSp6EaZ/4B7Fyv3Jp44 uFU8rN6JUk1nTb8qQeVfeZ7Upw== X-Google-Smtp-Source: ABdhPJxKQIk0np3addOYv0X6i3FNyMcBrbHc8niPiUYWepcaSBJXVhBWS9DiYV743l/82t3zhs6jFw== X-Received: by 2002:a17:906:685:b0:6fa:8e17:e9b5 with SMTP id u5-20020a170906068500b006fa8e17e9b5mr57334212ejb.522.1654029981975; Tue, 31 May 2022 13:46:21 -0700 (PDT) Received: from [192.168.0.179] (xdsl-188-155-176-92.adslplus.ch. [188.155.176.92]) by smtp.gmail.com with ESMTPSA id k2-20020a1709063e0200b006f3ef214e5bsm5182391eji.193.2022.05.31.13.46.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 31 May 2022 13:46:21 -0700 (PDT) Message-ID: <4ac3dc81-98e5-8c94-8dd4-b30ee587eb42@linaro.org> Date: Tue, 31 May 2022 22:46:20 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH 14/14] dt-bindings: mfd: Add Mediatek MT6370 binding documentation Content-Language: en-US To: ChiaEn Wu , lee.jones@linaro.org, daniel.thompson@linaro.org, jingoohan1@gmail.com, pavel@ucw.cz, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, matthias.bgg@gmail.com, sre@kernel.org, chunfeng.yun@mediatek.com, gregkh@linuxfoundation.org, jic23@kernel.org, lars@metafoo.de, lgirdwood@gmail.com, broonie@kernel.org, linux@roeck-us.net, heikki.krogerus@linux.intel.com, deller@gmx.de Cc: cy_huang@richtek.com, alice_chen@richtek.com, chiaen_wu@richtek.com, dri-devel@lists.freedesktop.org, linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-usb@vger.kernel.org, linux-iio@vger.kernel.org, linux-fbdev@vger.kernel.org References: <20220531102809.11976-1-peterwu.pub@gmail.com> <20220531102809.11976-15-peterwu.pub@gmail.com> From: Krzysztof Kozlowski In-Reply-To: <20220531102809.11976-15-peterwu.pub@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org On 31/05/2022 12:28, ChiaEn Wu wrote: > From: ChiYuan Huang > > Add Mediatek MT6370 binding documentation. Subject: same as previous patches. > > Signed-off-by: ChiYuan Huang > --- > .../bindings/mfd/mediatek,mt6370.yaml | 282 ++++++++++++++++++ > .../dt-bindings/iio/adc/mediatek,mt6370_adc.h | 18 ++ > include/dt-bindings/mfd/mediatek,mt6370.h | 83 ++++++ > 3 files changed, 383 insertions(+) > create mode 100644 Documentation/devicetree/bindings/mfd/mediatek,mt6370.yaml > create mode 100644 include/dt-bindings/iio/adc/mediatek,mt6370_adc.h > create mode 100644 include/dt-bindings/mfd/mediatek,mt6370.h > > diff --git a/Documentation/devicetree/bindings/mfd/mediatek,mt6370.yaml b/Documentation/devicetree/bindings/mfd/mediatek,mt6370.yaml > new file mode 100644 > index 000000000000..96a12dce0108 > --- /dev/null > +++ b/Documentation/devicetree/bindings/mfd/mediatek,mt6370.yaml > @@ -0,0 +1,282 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/mfd/mediatek,mt6370.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Mediatek MT6370 SubPMIC > + > +maintainers: > + - ChiYuan Huang > + > +description: | > + MT6370 is a highly-integrated smart power management IC, which includes a > + single cell Li-Ion/Li-Polymer switching battery charger, a USB Type-C & > + Power Delivery (PD) controller, dual flash LED current sources, a RGB LED > + driver, a backlight WLED driver, a display bias driver and a general LDO for > + portable devices. > + > +properties: > + compatible: > + const: mediatek,mt6370 > + > + reg: > + maxItems: 1 > + > + wakeup-source: true > + > + interrupts: > + maxItems: 1 > + > + interrupt-controller: true > + > + '#interrupt-cells': > + const: 1 > + > + adc: > + type: object > + description: | > + List the compatible configurations of MT6370 ADC. This sentence does not make any sense. The "description" field is to describe, explain the meaning behind given property. > + > + properties: > + compatible: > + const: mediatek,mt6370-adc > + > + "#io-channel-cells": > + const: 1 > + > + required: > + - compatible > + - '#io-channel-cells' > + > + backlight: > + type: object > + $ref: /schemas/leds/backlight/mediatek,mt6370-backlight.yaml# > + > + charger: > + type: object > + $ref: /schemas/power/supply/mediatek,mt6370-charger.yaml# > + > + tcpc: > + type: object > + $ref: /schemas/usb/mediatek,mt6370-tcpc.yaml# > + > + indicator: > + type: object > + $ref: /schemas/leds/mediatek,mt6370-indicator.yaml# > + > + flashlight: > + type: object > + $ref: /schemas/leds/mediatek,mt6370-flashlight.yaml# > + > + regulators: > + type: object > + description: | > + List all supported regulators Ditto > + > + patternProperties: > + "^(dsvbst|vibldo)$": > + $ref: /schemas/regulator/regulator.yaml# > + type: object > + unevaluatedProperties: false > + > + "^(dsvpos|dsvneg)$": > + $ref: /schemas/regulator/regulator.yaml# > + type: object > + unevaluatedProperties: false > + > + properties: > + enable-gpio: > + maxItems: 1 > + description: | > + Specify a valid 'enable' gpio for the regulator and it's optional Same comment as your patch #10. > + > +required: > + - compatible > + - reg > + - interrupts > + - interrupt-controller > + - '#interrupt-cells' > + - regulators > + - adc > + - backlight > + - indicator > + - tcpc > + - charger > + - flashlight > + > +additionalProperties: false > + > +examples: > + - | > + #include > + #include > + #include > + #include > + #include > + i2c { > + #address-cells = <1>; > + #size-cells = <0>; > + > + mt6370@34 { Generic node name, so "pmic". > + compatible = "mediatek,mt6370"; > + reg = <0x34>; > + wakeup-source; > + interrupts-extended = <&gpio26 3 IRQ_TYPE_LEVEL_LOW>; > + interrupt-controller; > + #interrupt-cells = <1>; > + > + mt6370_adc: adc { > + compatible = "mediatek,mt6370-adc"; > + #io-channel-cells = <1>; > + }; > + > + backlight { > + compatible = "mediatek,mt6370-backlight"; > + mediatek,bled-channel-use = /bits/ 8 <15>; > + }; > + > + charger { > + compatible = "mediatek,mt6370-charger"; > + interrupts = , , > + ; > + interrupt-names = "attach_i", "uvp_d_evt", "mivr"; > + io-channels = <&mt6370_adc MT6370_CHAN_IBUS>; > + > + mt6370_otg_vbus: usb-otg-vbus { > + regulator-compatible = "mt6370,otg-vbus"; > + regulator-name = "usb-otg-vbus"; > + regulator-min-microvolt = <4350000>; > + regulator-max-microvolt = <5800000>; > + regulator-min-microamp = <500000>; > + regulator-max-microamp = <3000000>; > + }; > + }; > + > + indicator { > + compatible = "mediatek,mt6370-indicator"; > + #address-cells = <1>; > + #size-cells = <0>; > + > + multi-led@0 { > + reg = <0>; > + function = LED_FUNCTION_INDICATOR; > + color = ; > + led-max-microamp = <24000>; > + #address-cells = <1>; > + #size-cells = <0>; > + mediatek,soft-start = <3>; > + led@0 { Messed up indentation. > + reg = <0>; > + color = ; > + }; > + led@1 { > + reg = <1>; > + color = ; > + }; > + led@2 { > + reg = <2>; > + color = ; > + }; > + }; > + led@3 { > + reg = <3>; > + function = LED_FUNCTION_INDICATOR; > + color = ; > + led-max-microamp = <6000>; > + }; > + }; > + > + flashlight { > + compatible = "mediatek,mt6370-flashlight"; > + #address-cells = <1>; > + #size-cells = <0>; > + led@0 { > + reg = <0>; > + led-sources = <0>; > + function = LED_FUNCTION_FLASH; > + color = ; > + function-enumerator = <1>; > + led-max-microamp = <200000>; > + flash-max-microamp = <500000>; > + flash-max-timeout-us = <1248000>; > + }; > + led@1 { > + reg = <1>; > + led-sources = <1>; > + function = LED_FUNCTION_FLASH; > + color = ; > + function-enumerator = <2>; > + led-max-microamp = <200000>; > + flash-max-microamp = <500000>; > + flash-max-timeout-us = <1248000>; > + }; > + }; > + > + tcpc { > + compatible = "mediatek,mt6370-tcpc"; > + interrupts-extended = <&gpio26 4 IRQ_TYPE_LEVEL_LOW>; > + > + connector { > + compatible = "usb-c-connector"; > + label = "USB-C"; > + vbus-supply = <&mt6370_otg_vbus>; > + data-role = "dual"; > + power-role = "dual"; > + try-power-role = "sink"; > + source-pdos = ; > + sink-pdos = ; > + op-sink-microwatt = <10000000>; > + > + ports { > + #address-cells = <1>; > + #size-cells = <0>; > + > + port@0 { > + reg = <0>; > + endpoint { > + remote-endpoint = <&usb_hs>; > + }; > + }; > + port@1 { > + reg = <1>; > + endpoint { > + remote-endpoint = <&usb_ss>; > + }; > + }; > + port@2 { > + reg = <2>; > + endpoint { > + remote-endpoint = <&dp_aux>; > + }; > + }; > + }; > + }; > + }; > + > + regulators { > + dsvbst { > + regulator-name = "mt6370-dsv-vbst"; > + regulator-min-microvolt = <4000000>; > + regulator-max-microvolt = <6200000>; > + }; > + dsvpos { > + regulator-name = "mt6370-dsv-vpos"; > + regulator-min-microvolt = <4000000>; > + regulator-max-microvolt = <6000000>; > + regulator-boot-on; > + }; > + dsvneg { > + regulator-name = "mt6370-dsv-vneg"; > + regulator-min-microvolt = <4000000>; > + regulator-max-microvolt = <6000000>; > + regulator-boot-on; > + }; > + vibldo { > + regulator-name = "mt6370-vib-ldo"; > + regulator-min-microvolt = <1600000>; > + regulator-max-microvolt = <4000000>; > + }; > + }; > + }; > + }; > diff --git a/include/dt-bindings/iio/adc/mediatek,mt6370_adc.h b/include/dt-bindings/iio/adc/mediatek,mt6370_adc.h > new file mode 100644 > index 000000000000..18ce2fef8f9e > --- /dev/null > +++ b/include/dt-bindings/iio/adc/mediatek,mt6370_adc.h > @@ -0,0 +1,18 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ Same license as bindings, please. > + > +#ifndef __DT_BINDINGS_MEDIATEK_MT6370_ADC_H__ > +#define __DT_BINDINGS_MEDIATEK_MT6370_ADC_H__ > + > +/* ADC Channel Index */ > +#define MT6370_CHAN_VBUSDIV5 0 > +#define MT6370_CHAN_VBUSDIV2 1 > +#define MT6370_CHAN_VSYS 2 > +#define MT6370_CHAN_VBAT 3 > +#define MT6370_CHAN_TS_BAT 4 > +#define MT6370_CHAN_IBUS 5 > +#define MT6370_CHAN_IBAT 6 > +#define MT6370_CHAN_CHG_VDDP 7 > +#define MT6370_CHAN_TEMP_JC 8 > +#define MT6370_CHAN_MAX 9 > + > +#endif > diff --git a/include/dt-bindings/mfd/mediatek,mt6370.h b/include/dt-bindings/mfd/mediatek,mt6370.h > new file mode 100644 > index 000000000000..df641e5d651f > --- /dev/null > +++ b/include/dt-bindings/mfd/mediatek,mt6370.h > @@ -0,0 +1,83 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ Same license as bindings, please. > + > +#ifndef __DT_BINDINGS_MEDIATEK_MT6370_H__ > +#define __DT_BINDINGS_MEDIATEK_MT6370_H__ > + > +/* IRQ definitions */ > +#define MT6370_IRQ_DIRCHGON 0 > +#define MT6370_IRQ_CHG_TREG 4 These should be IDs, so numbers incremented by one. Holes are not accepted. There is no point in encoding actual hardware numbers which are directly passed to implementation. Just pass the number, not define. Therefore remove entire file. > +#define MT6370_IRQ_CHG_AICR 5 > +#define MT6370_IRQ_CHG_MIVR 6 > +#define MT6370_IRQ_PWR_RDY 7 > +#define MT6370_IRQ_FL_CHG_VINOVP 11 Best regards, Krzysztof