Skip to contentSkip to conversation

arm: dts: mt8135: Move pinfunc to include/dt-bindings/pinctrl

PATCH Superseded Hsin-Yi Wang 3 participants 6 messages Aug 3, 2021

Subsystems (5)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/3 arm: dts: mt8135: Move pinfunc to include/dt-bindings/pinctrl

Move mt8135-pinfunc.h into include/dt-bindings/pinctrl so that we can include it in yaml examples.

---
 arch/arm/boot/dts/mt8135.dtsi                                   | 2 +-
 .../boot/dts => include/dt-bindings/pinctrl}/mt8135-pinfunc.h   | 0
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename {arch/arm/boot/dts => include/dt-bindings/pinctrl}/mt8135-pinfunc.h (100%)
arch/arm/boot/dts/mt8135.dtsi +1 -1
index 0e4e835026db0..a031b36363187 100644
@@ -9,7 +9,7 @@
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/reset/mt8135-resets.h>
-#include "mt8135-pinfunc.h"
+#include <dt-bindings/pinctrl/mt8135-pinfunc.h>
 
 / {
 	#address-cells = <2>;
include/dt-bindings/pinctrl/mt8135-pinfunc.h renamed from arch/arm/boot/dts/mt8135-pinfunc.h +0 -0
similarity index 100%
rename from arch/arm/boot/dts/mt8135-pinfunc.h
rename to include/dt-bindings/pinctrl/mt8135-pinfunc.h
Signature · 1 line
2.32.0.554.ge1b32706d8-goog
#1 lore raw

PATCH v3 2/3 arm: dts: mt8183: Move pinfunc to include/dt-bindings/pinctrl

Move mt8183-pinfunc.h into include/dt-bindings/pinctrl so that we can include it in yaml examples.

---
 arch/arm64/boot/dts/mediatek/mt8183.dtsi                        | 2 +-
 .../mediatek => include/dt-bindings/pinctrl}/mt8183-pinfunc.h   | 0
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename {arch/arm64/boot/dts/mediatek => include/dt-bindings/pinctrl}/mt8183-pinfunc.h (100%)
arch/arm64/boot/dts/mediatek/mt8183.dtsi +1 -1
index f90df6439c088..1933045da95de 100644
@@ -14,7 +14,7 @@
 #include <dt-bindings/reset-controller/mt8183-resets.h>
 #include <dt-bindings/phy/phy.h>
 #include <dt-bindings/thermal/thermal.h>
-#include "mt8183-pinfunc.h"
+#include <dt-bindings/pinctrl/mt8183-pinfunc.h>
 
 / {
 	compatible = "mediatek,mt8183";
include/dt-bindings/pinctrl/mt8183-pinfunc.h renamed from arch/arm64/boot/dts/mediatek/mt8183-pinfunc.h +0 -0
similarity index 100%
rename from arch/arm64/boot/dts/mediatek/mt8183-pinfunc.h
rename to include/dt-bindings/pinctrl/mt8183-pinfunc.h
Signature · 1 line
2.32.0.554.ge1b32706d8-goog
#2 lore raw

PATCH v3 3/3 dt-bindings: mediatek: convert pinctrl to yaml

In reply to Hsin-Yi Wang

Convert mt65xx, mt6796, mt7622, mt8183 bindings to yaml.

---
v2->v3:
fix comments in v2.

---
 .../pinctrl/mediatek,mt65xx-pinctrl.yaml      | 206 ++++++++
 .../pinctrl/mediatek,mt6797-pinctrl.yaml      | 173 +++++++
 .../pinctrl/mediatek,mt7622-pinctrl.yaml      | 373 +++++++++++++
 .../pinctrl/mediatek,mt8183-pinctrl.yaml      | 228 ++++++++
 .../bindings/pinctrl/pinctrl-mt65xx.txt       | 156 ------
 .../bindings/pinctrl/pinctrl-mt6797.txt       |  83 ---
 .../bindings/pinctrl/pinctrl-mt7622.txt       | 490 ------------------
 .../bindings/pinctrl/pinctrl-mt8183.txt       | 132 -----
 8 files changed, 980 insertions(+), 861 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/mediatek,mt65xx-pinctrl.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/mediatek,mt6797-pinctrl.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/mediatek,mt7622-pinctrl.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/mediatek,mt8183-pinctrl.yaml
 delete mode 100644 Documentation/devicetree/bindings/pinctrl/pinctrl-mt65xx.txt
 delete mode 100644 Documentation/devicetree/bindings/pinctrl/pinctrl-mt6797.txt
 delete mode 100644 Documentation/devicetree/bindings/pinctrl/pinctrl-mt7622.txt
 delete mode 100644 Documentation/devicetree/bindings/pinctrl/pinctrl-mt8183.txt
Documentation/devicetree/bindings/pinctrl/mediatek,mt65xx-pinctrl.yaml new file +206 -0
new file mode 100644
index 0000000000000..b977fbb8cb5e0
@@ -0,0 +1,206 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pinctrl/mediatek,mt65xx-pinctrl.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Mediatek MT65xx Pin Controller Device Tree Bindings
+
+maintainers:
+  - Andy Teng <[email protected]>
+
+description: |+
+  The Mediatek's Pin controller is used to control SoC pins.
+
+properties:
+  compatible:
+    enum:
+      - mediatek,mt2701-pinctrl
+      - mediatek,mt2712-pinctrl
+      - mediatek,mt6397-pinctrl
+      - mediatek,mt7623-pinctrl
+      - mediatek,mt8127-pinctrl
+      - mediatek,mt8135-pinctrl
+      - mediatek,mt8167-pinctrl
+      - mediatek,mt8173-pinctrl
+      - mediatek,mt8516-pinctrl
+
+  reg:
+    maxItems: 1
+
+  pins-are-numbered:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description: |
+      Specify the subnodes are using numbered pinmux to specify pins.
+
+  gpio-controller: true
+
+  "#gpio-cells":
+    const: 2
+    description: |
+      Number of cells in GPIO specifier. Since the generic GPIO
+      binding is used, the amount of cells must be specified as 2. See the below
+      mentioned gpio binding representation for description of particular cells.
+
+  mediatek,pctl-regmap:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    minItems: 1
+    maxItems: 2
+    description: |
+      Should be phandles of the syscfg node.
+
+  interrupt-controller: true
+
+  interrupts:
+    minItems: 1
+    maxItems: 3
+
+  "#interrupt-cells":
+    const: 2
+
+required:
+  - compatible
+  - pins-are-numbered
+  - gpio-controller
+  - "#gpio-cells"
+
+patternProperties:
+  '-[0-9]+$':
+    type: object
+    additionalProperties: false
+    patternProperties:
+      'pins':
+        type: object
+        additionalProperties: false
+        description: |
+          A pinctrl node should contain at least one subnodes representing the
+          pinctrl groups available on the machine. Each subnode will list the
+          pins it needs, and how they should be configured, with regard to muxer
+          configuration, pullups, drive strength, input enable/disable and input
+          schmitt.
+        $ref: "/schemas/pinctrl/pincfg-node.yaml"
+
+        properties:
+          pinmux:
+            description:
+              integer array, represents gpio pin number and mux setting.
+              Supported pin number and mux varies for different SoCs, and are
+              defined as macros in <soc>-pinfunc.h directly.
+
+          bias-disable: true
+
+          bias-pull-up:
+            description: |
+              Besides generic pinconfig options, it can be used as the pull up
+              settings for 2 pull resistors, R0 and R1. User can configure those
+              special pins. Some macros have been defined for this usage, such
+              as MTK_PUPD_SET_R1R0_00. See dt-bindings/pinctrl/mt65xx.h for
+              valid arguments.
+
+          bias-pull-down: true
+
+          input-enable: true
+
+          input-disable: true
+
+          output-low: true
+
+          output-high: true
+
+          input-schmitt-enable: true
+
+          input-schmitt-disable: true
+
+          drive-strength:
+            description: |
+              Can support some arguments, such as MTK_DRIVE_4mA, MTK_DRIVE_6mA,
+              etc. See dt-bindings/pinctrl/mt65xx.h for valid arguments.
+
+        required:
+          - pinmux
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/pinctrl/mt8135-pinfunc.h>
+
+    soc {
+        #address-cells = <2>;
+        #size-cells = <2>;
+
+        syscfg_pctl_a: syscfg-pctl-a@10005000 {
+          compatible = "mediatek,mt8135-pctl-a-syscfg", "syscon";
+          reg = <0 0x10005000 0 0x1000>;
+        };
+
+        syscfg_pctl_b: syscfg-pctl-b@1020c020 {
+          compatible = "mediatek,mt8135-pctl-b-syscfg", "syscon";
+          reg = <0 0x1020C020 0 0x1000>;
+        };
+
+        pinctrl@1c20800 {
+          compatible = "mediatek,mt8135-pinctrl";
+          reg = <0 0x1000B000 0 0x1000>;
+          mediatek,pctl-regmap = <&syscfg_pctl_a>, <&syscfg_pctl_b>;
+          pins-are-numbered;
+          gpio-controller;
+          #gpio-cells = <2>;
+          interrupt-controller;
+          #interrupt-cells = <2>;
+          interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>,
+              <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>,
+              <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>;
+
+          i2c0_pins_a: i2c0-0 {
+            pins1 {
+              pinmux = <MT8135_PIN_100_SDA0__FUNC_SDA0>,
+                <MT8135_PIN_101_SCL0__FUNC_SCL0>;
+              bias-disable;
+            };
+          };
+
+          i2c1_pins_a: i2c1-0 {
+            pins {
+              pinmux = <MT8135_PIN_195_SDA1__FUNC_SDA1>,
+                <MT8135_PIN_196_SCL1__FUNC_SCL1>;
+              bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
+            };
+          };
+
+          i2c2_pins_a: i2c2-0 {
+            pins1 {
+              pinmux = <MT8135_PIN_193_SDA2__FUNC_SDA2>;
+              bias-pull-down;
+            };
+
+            pins2 {
+              pinmux = <MT8135_PIN_49_WATCHDOG__FUNC_GPIO49>;
+              bias-pull-up;
+            };
+          };
+
+          i2c3_pins_a: i2c3-0 {
+            pins1 {
+              pinmux = <MT8135_PIN_40_DAC_CLK__FUNC_GPIO40>,
+                <MT8135_PIN_41_DAC_WS__FUNC_GPIO41>;
+              bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
+            };
+
+            pins2 {
+              pinmux = <MT8135_PIN_35_SCL3__FUNC_SCL3>,
+                <MT8135_PIN_36_SDA3__FUNC_SDA3>;
+              output-low;
+              bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
+            };
+
+            pins3 {
+              pinmux = <MT8135_PIN_57_JTCK__FUNC_GPIO57>,
+                <MT8135_PIN_60_JTDI__FUNC_JTDI>;
+              drive-strength = <32>;
+            };
+          };
+        };
+    };
Documentation/devicetree/bindings/pinctrl/mediatek,mt6797-pinctrl.yaml new file +173 -0

173 lines not on this page · raw message

Documentation/devicetree/bindings/pinctrl/mediatek,mt7622-pinctrl.yaml new file +373 -0

373 lines not on this page · raw message

Documentation/devicetree/bindings/pinctrl/mediatek,mt8183-pinctrl.yaml new file +228 -0

228 lines not on this page · raw message

Documentation/devicetree/bindings/pinctrl/pinctrl-mt65xx.txt deleted +0 -156

156 lines not on this page · raw message

Documentation/devicetree/bindings/pinctrl/pinctrl-mt6797.txt deleted +0 -83

83 lines not on this page · raw message

Documentation/devicetree/bindings/pinctrl/pinctrl-mt7622.txt deleted +0 -490

490 lines not on this page · raw message

Documentation/devicetree/bindings/pinctrl/pinctrl-mt8183.txt deleted +0 -132

132 lines not on this page · raw message

Signature · 1 line
2.32.0.554.ge1b32706d8-goog
maintainer
#3 lore raw

Re: [PATCH v3 3/3] dt-bindings: mediatek: convert pinctrl to yaml

Quoted 16 lines · Hsin-Yi Wang

Convert mt65xx, mt6796, mt7622, mt8183 bindings to yaml.

---
v2->v3:
fix comments in v2.

---
 .../pinctrl/mediatek,mt65xx-pinctrl.yaml      | 206 ++++++++
 .../pinctrl/mediatek,mt6797-pinctrl.yaml      | 173 +++++++
 .../pinctrl/mediatek,mt7622-pinctrl.yaml      | 373 +++++++++++++
 .../pinctrl/mediatek,mt8183-pinctrl.yaml      | 228 ++++++++
 .../bindings/pinctrl/pinctrl-mt65xx.txt       | 156 ------
 .../bindings/pinctrl/pinctrl-mt6797.txt       |  83 ---
 .../bindings/pinctrl/pinctrl-mt7622.txt       | 490 ------------------
 .../bindings/pinctrl/pinctrl-mt8183.txt       | 132 -----
 8 files changed, 980 insertions(+), 861 deletions(-)
Quoted 9 lines
 create mode 100644 Documentation/devicetree/bindings/pinctrl/mediatek,mt65xx-pinctrl.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/mediatek,mt6797-pinctrl.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/mediatek,mt7622-pinctrl.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/mediatek,mt8183-pinctrl.yaml
 delete mode 100644 Documentation/devicetree/bindings/pinctrl/pinctrl-mt65xx.txt
 delete mode 100644 Documentation/devicetree/bindings/pinctrl/pinctrl-mt6797.txt
 delete mode 100644 Documentation/devicetree/bindings/pinctrl/pinctrl-mt7622.txt
 delete mode 100644 Documentation/devicetree/bindings/pinctrl/pinctrl-mt8183.txt

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/pinctrl/mediatek,mt8183-pinctrl.example.dts:21:18: fatal error: dt-bindings/pinctrl/mt8183-pinfunc.h: No such file or directory
21 | #include <dt-bindings/pinctrl/mt8183-pinfunc.h>

      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

compilation terminated.
make[1]: *** [scripts/Makefile.lib:380: Documentation/devicetree/bindings/pinctrl/mediatek,mt8183-pinctrl.example.dt.yaml] Error 1 make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1419: dt_binding_check] Error 2
\ndoc reference errors (make refcheckdocs):
MAINTAINERS: Documentation/devicetree/bindings/pinctrl/pinctrl-mt65xx.txt
MAINTAINERS: Documentation/devicetree/bindings/pinctrl/pinctrl-mt7622.txt

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

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.

#4 lore raw

Re: [PATCH v3 3/3] dt-bindings: mediatek: convert pinctrl to yaml

Quoted 36 lines · Rob Herring
Quoted 16 lines · Hsin-Yi Wang

Convert mt65xx, mt6796, mt7622, mt8183 bindings to yaml.

---
v2->v3:
fix comments in v2.

---
 .../pinctrl/mediatek,mt65xx-pinctrl.yaml      | 206 ++++++++
 .../pinctrl/mediatek,mt6797-pinctrl.yaml      | 173 +++++++
 .../pinctrl/mediatek,mt7622-pinctrl.yaml      | 373 +++++++++++++
 .../pinctrl/mediatek,mt8183-pinctrl.yaml      | 228 ++++++++
 .../bindings/pinctrl/pinctrl-mt65xx.txt       | 156 ------
 .../bindings/pinctrl/pinctrl-mt6797.txt       |  83 ---
 .../bindings/pinctrl/pinctrl-mt7622.txt       | 490 ------------------
 .../bindings/pinctrl/pinctrl-mt8183.txt       | 132 -----
 8 files changed, 980 insertions(+), 861 deletions(-)
Quoted 9 lines
 create mode 100644 Documentation/devicetree/bindings/pinctrl/mediatek,mt65xx-pinctrl.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/mediatek,mt6797-pinctrl.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/mediatek,mt7622-pinctrl.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/mediatek,mt8183-pinctrl.yaml
 delete mode 100644 Documentation/devicetree/bindings/pinctrl/pinctrl-mt65xx.txt
 delete mode 100644 Documentation/devicetree/bindings/pinctrl/pinctrl-mt6797.txt
 delete mode 100644 Documentation/devicetree/bindings/pinctrl/pinctrl-mt7622.txt
 delete mode 100644 Documentation/devicetree/bindings/pinctrl/pinctrl-mt8183.txt

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/pinctrl/mediatek,mt8183-pinctrl.example.dts:21:18: fatal error: dt-bindings/pinctrl/mt8183-pinfunc.h: No such file or directory
21 | #include <dt-bindings/pinctrl/mt8183-pinfunc.h>

Quoted 8 lines
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

compilation terminated.
make[1]: *** [scripts/Makefile.lib:380: Documentation/devicetree/bindings/pinctrl/mediatek,mt8183-pinctrl.example.dt.yaml] Error 1 make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1419: dt_binding_check] Error 2
\ndoc reference errors (make refcheckdocs):
MAINTAINERS: Documentation/devicetree/bindings/pinctrl/pinctrl-mt65xx.txt
MAINTAINERS: Documentation/devicetree/bindings/pinctrl/pinctrl-mt7622.txt

Not sure why the header patch is not getting applied, so ignore that. But these MAINTAINERS references need to be fixed.

Rob

maintainer Reviewed-by on v3 3/3
#5 lore raw

Re: [PATCH v3 3/3] dt-bindings: mediatek: convert pinctrl to yaml

In reply to Hsin-Yi Wang
Quoted 6 lines · Hsin-Yi Wang

Convert mt65xx, mt6796, mt7622, mt8183 bindings to yaml.

---
v2->v3:
fix comments in v2.

That's assumed... A good revision history will list out what changed to remind reviewers what they said. (I kind of remember since it was just yesterday, more more than that assume I've forgotten.) This is different than the commit msg which should tell us 'why' and not 'what' as there we have the diff and can read what changed.

Quoted 10 lines
---
 .../pinctrl/mediatek,mt65xx-pinctrl.yaml      | 206 ++++++++
 .../pinctrl/mediatek,mt6797-pinctrl.yaml      | 173 +++++++
 .../pinctrl/mediatek,mt7622-pinctrl.yaml      | 373 +++++++++++++
 .../pinctrl/mediatek,mt8183-pinctrl.yaml      | 228 ++++++++
 .../bindings/pinctrl/pinctrl-mt65xx.txt       | 156 ------
 .../bindings/pinctrl/pinctrl-mt6797.txt       |  83 ---
 .../bindings/pinctrl/pinctrl-mt7622.txt       | 490 ------------------
 .../bindings/pinctrl/pinctrl-mt8183.txt       | 132 -----
 8 files changed, 980 insertions(+), 861 deletions(-)
Quoted 8 lines
 create mode 100644 Documentation/devicetree/bindings/pinctrl/mediatek,mt65xx-pinctrl.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/mediatek,mt6797-pinctrl.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/mediatek,mt7622-pinctrl.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/mediatek,mt8183-pinctrl.yaml
 delete mode 100644 Documentation/devicetree/bindings/pinctrl/pinctrl-mt65xx.txt
 delete mode 100644 Documentation/devicetree/bindings/pinctrl/pinctrl-mt6797.txt
 delete mode 100644 Documentation/devicetree/bindings/pinctrl/pinctrl-mt7622.txt
 delete mode 100644 Documentation/devicetree/bindings/pinctrl/pinctrl-mt8183.txt

With the MAINTAINERS references fixed,