Re: [RESEND 06/14] dt-bindings: mfd: Add Mediatek MT6370 binding

2022-05-31 Thread Rob Herring
On Tue, 31 May 2022 19:18:52 +0800, ChiaEn Wu wrote:
> From: ChiYuan Huang 
> 
> Add Mediatek MT6370 binding documentation.
> 
> 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
> 

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:
./Documentation/devicetree/bindings/mfd/mediatek,mt6370.yaml: Unable to find 
schema file matching $id: 
http://devicetree.org/schemas/power/supply/mediatek,mt6370-charger.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/mfd/mediatek,mt6370.example.dtb:
 mt6370@34: charger: False schema does not allow {'compatible': 
['mediatek,mt6370-charger'], 'interrupts': [[48], [68], [6]], 
'interrupt-names': ['attach_i', 'uvp_d_evt', 'mivr'], 'io-channels': [[1, 5]], 
'usb-otg-vbus': {'regulator-compatible': ['mt6370,otg-vbus'], 'regulator-name': 
['usb-otg-vbus'], 'regulator-min-microvolt': [[435]], 
'regulator-max-microvolt': [[580]], 'regulator-min-microamp': [[50]], 
'regulator-max-microamp': [[300]], 'phandle': [[2]]}}
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:
 mt6370@34: tcpc: False schema does not allow {'compatible': 
['mediatek,mt6370-tcpc'], 'interrupts-extended': [[4294967295, 4, 8]], 
'connector': {'compatible': ['usb-c-connector'], 'label': ['USB-C'], 
'vbus-supply': [[2]], 'data-role': ['dual'], 'power-role': ['dual'], 
'try-power-role': ['sink'], 'source-pdos': [[570527844]], 'sink-pdos': 
[[570527944]], 'op-sink-microwatt': [[1000]], 'ports': {'#address-cells': 
[[1]], '#size-cells': [[0]], 'port@0': {'reg': [[0]], 'endpoint': 
{'remote-endpoint': [[4294967295]]}}, 'port@1': {'reg': [[1]], 'endpoint': 
{'remote-endpoint': [[4294967295]]}}, 'port@2': {'reg': [[2]], 'endpoint': 
{'remote-endpoint': [[4294967295]]}
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:
 mt6370@34: indicator: False schema does not allow {'compatible': 
['mediatek,mt6370-indicator'], '#address-cells': [[1]], '#size-cells': [[0]], 
'multi-led@0': {'reg': [[0]], 'function': ['indicator'], 'color': [[9]], 
'led-max-microamp': [[24000]], '#address-cells': [[1]], '#size-cells': [[0]], 
'mediatek,soft-start': [[3]], 'led@0': {'reg': [[0]], 'color': [[1]]}, 'led@1': 
{'reg': [[1]], 'color': [[2]]}, 'led@2': {'reg': [[2]], 'color': [[3]]}}, 
'led@3': {'reg': [[3]], 'function': ['indicator'], 'color': [[0]], 
'led-max-microamp': [[6000]]}}
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:
 mt6370@34: flashlight: False schema does not allow {'compatible': 
['mediatek,mt6370-flashlight'], '#address-cells': [[1]], '#size-cells': [[0]], 
'led@0': {'reg': [[0]], 'led-sources': [[0]], 'function': ['flash'], 'color': 
[[0]], 'function-enumerator': [[1]], 'led-max-microamp': [[20]], 
'flash-max-microamp': [[50]], 'flash-max-timeout-us': [[1248000]]}, 
'led@1': {'reg': [[1]], 'led-sources': [[1]], 'function': ['flash'], 'color': 
[[0]], 'function-enumerator': [[2]], 'led-max-microamp': [[20]], 
'flash-max-microamp': [[50]], 'flash-max-timeout-us': [[1248000]]}}
From schema: 
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/mfd/mediatek,mt6370.yaml
Documentation/devicetree/bindings/mfd/mediatek,mt6370.example.dtb:0:0: 
/example-0/i2c/mt6370@34/charger: failed to match any schema with compatible: 
['mediatek,mt6370-charger']
Documentation/devicetree/bindings/mfd/mediatek,mt6370.example.dtb:0:0: 
/example-0/i2c/mt6370@34/indicator: failed to match any schema with compatible: 
['mediatek,mt6370-indicator']
Documentation/devicetree/bindings/mfd/mediatek,mt6370.example.dtb:0:0: 
/example-0/i2c/mt6370@34/flashlight: failed to match any schema with 
compatible: ['mediatek,mt6370-flashlight']
Documentation/devicetree/bindings/mfd/mediatek,mt6370.example.dtb:0:0: 
/example-0/i2c/mt6370@34/tcpc: failed to match any schema with compatible: 
['mediatek,mt6370-tcpc']

doc reference errors (make refcheckdocs):

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

This check can fail if there are 

[RESEND 06/14] dt-bindings: mfd: Add Mediatek MT6370 binding

2022-05-31 Thread ChiaEn Wu
From: ChiYuan Huang 

Add Mediatek MT6370 binding documentation.

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 ..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.
+
+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
+
+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
+
+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 {
+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 = , ,
+   ;
+  interrupt-names = "attach_i", "uvp_d_evt", "mivr";
+  io-channels = <_adc MT6370_CHAN_IBUS>;
+
+  mt6370_otg_vbus: usb-otg-vbus {
+regulator-compatible = "mt6370,otg-vbus";
+regulator-name = "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>;
+mediatek,soft-start = <3>;
+  led@0 {
+reg = <0>;
+color = ;
+  };
+  led@1 {
+