Re: [PATCH v5 06/13] dt-bindings: mfd: Add MediaTek MT6370

2022-07-16 Thread Rob Herring
On Fri, 15 Jul 2022 19:26:00 +0800, ChiaEn Wu wrote:
> From: ChiYuan Huang 
> 
> Add MediaTek MT6370 binding documentation.
> 
> Signed-off-by: ChiYuan Huang 
> Reviewed-by: Krzysztof Kozlowski 
> ---
>  .../devicetree/bindings/mfd/mediatek,mt6370.yaml   | 280 
> +
>  include/dt-bindings/iio/adc/mediatek,mt6370_adc.h  |  18 ++
>  2 files changed, 298 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/mfd/mediatek,mt6370.yaml
>  create mode 100644 include/dt-bindings/iio/adc/mediatek,mt6370_adc.h
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/mfd/mediatek,mt6370.example.dtb:
 pmic@34: indicator:multi-led@0:led@0: Unevaluated properties are not allowed 
('reg' was unexpected)
From schema: 
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/mfd/mediatek,mt6370.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/mfd/mediatek,mt6370.example.dtb:
 pmic@34: indicator:multi-led@0:led@1: Unevaluated properties are not allowed 
('reg' was unexpected)
From schema: 
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/mfd/mediatek,mt6370.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/mfd/mediatek,mt6370.example.dtb:
 pmic@34: indicator:multi-led@0:led@2: Unevaluated properties are not allowed 
('reg' was unexpected)
From schema: 
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/mfd/mediatek,mt6370.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/mfd/mediatek,mt6370.example.dtb:
 indicator: multi-led@0:led@0: Unevaluated properties are not allowed ('reg' 
was unexpected)
From schema: 
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/leds/mediatek,mt6370-indicator.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/mfd/mediatek,mt6370.example.dtb:
 indicator: multi-led@0:led@1: Unevaluated properties are not allowed ('reg' 
was unexpected)
From schema: 
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/leds/mediatek,mt6370-indicator.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/mfd/mediatek,mt6370.example.dtb:
 indicator: multi-led@0:led@2: Unevaluated properties are not allowed ('reg' 
was unexpected)
From schema: 
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/leds/mediatek,mt6370-indicator.yaml

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit.



[PATCH v5 06/13] dt-bindings: mfd: Add MediaTek MT6370

2022-07-15 Thread ChiaEn Wu
From: ChiYuan Huang 

Add MediaTek MT6370 binding documentation.

Signed-off-by: ChiYuan Huang 
Reviewed-by: Krzysztof Kozlowski 
---
 .../devicetree/bindings/mfd/mediatek,mt6370.yaml   | 280 +
 include/dt-bindings/iio/adc/mediatek,mt6370_adc.h  |  18 ++
 2 files changed, 298 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/mediatek,mt6370.yaml
 create mode 100644 include/dt-bindings/iio/adc/mediatek,mt6370_adc.h

diff --git a/Documentation/devicetree/bindings/mfd/mediatek,mt6370.yaml 
b/Documentation/devicetree/bindings/mfd/mediatek,mt6370.yaml
new file mode 100644
index 000..410e2d4
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/mediatek,mt6370.yaml
@@ -0,0 +1,280 @@
+# 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: |
+  Provides 9 channels for system monitoring, including VBUSDIV5 (lower
+  accuracy, higher measure range), VBUSDIV2 (higher accuracy, lower
+  measure range), VBAT, VSYS, CHG_VDDP, TS_BAT, IBUS, IBAT, and TEMP_JC.
+
+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, which support the control for DisplayBias
+  voltages and one general purpose LDO which commonly used to drive the
+  vibrator.
+
+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-gpios:
+maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - interrupt-controller
+  - "#interrupt-cells"
+  - regulators
+  - adc
+  - backlight
+  - indicator
+  - tcpc
+  - charger
+  - flashlight
+
+additionalProperties: false
+
+examples:
+  - |
+#include 
+#include 
+#include 
+#include 
+i2c {
+  #address-cells = <1>;
+  #size-cells = <0>;
+
+pmic@34 {
+compatible = "mediatek,mt6370";
+reg = <0x34>;
+wakeup-source;
+interrupts-extended = < 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 = <48>, <68>, <6>;
+  interrupt-names = "attach_i", "uvp_d_evt", "mivr";
+  io-channels = <_adc MT6370_CHAN_IBUS>;
+
+  mt6370_otg_vbus: usb-otg-vbus-regulator {
+regulator-name = "mt6370-usb-otg-vbus";
+regulator-min-microvolt = <435>;
+regulator-max-microvolt = <580>;
+regulator-min-microamp = <50>;
+regulator-max-microamp = <300>;
+  };
+};
+
+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>;
+led@0 {
+  reg = <0>;
+  color = ;
+};
+led@1 {
+