- Convert Atmel's PIO4 pin controller Device Tree bindings to a
YAML-based DT schema.
- Move sama5d2-pinfunc.h and sama7g5-pinfunc.h files to the
include/dt-bindings/pinctrl directory to enable their inclusion in YAML
DT-binding examples.
- The bindings are tested with make dt_binding_check dtbs_check
Note:
- The patch "[PATCH 3/3] dt-bindings: pinctrl: at91-pio4: convert
Atmel's PIO4 bindings to json-schema" has dependency on "[PATCH 1/3]
ARM: dts: microchip: sama5d2: Move pinfunc.h headers [PATCH 2/3] ARM:
dts: microchip: sama7g5: Move pinfunc.h headers"
Signed-off-by: Balakrishnan Sambath <[email protected]>
---
Balakrishnan Sambath (3):
ARM: dts: microchip: sama5d2: Move pinfunc.h headers
ARM: dts: microchip: sama7g5: Move pinfunc.h headers
dt-bindings: pinctrl: at91-pio4: convert Atmel's PIO4 bindings to json-schema
.../bindings/pinctrl/atmel,at91-pio4-pinctrl.txt | 98 ---------------
.../bindings/pinctrl/atmel,sama5d2-pinctrl.yaml | 140 +++++++++++++++++++++
.../boot/dts/microchip/at91-kizbox3_common.dtsi | 2 +-
.../arm/boot/dts/microchip/at91-sama5d27_som1.dtsi | 2 +-
.../boot/dts/microchip/at91-sama5d27_wlsom1.dtsi | 2 +-
.../boot/dts/microchip/at91-sama5d29_curiosity.dts | 2 +-
arch/arm/boot/dts/microchip/at91-sama5d2_icp.dts | 2 +-
.../arm/boot/dts/microchip/at91-sama5d2_ptc_ek.dts | 2 +-
.../boot/dts/microchip/at91-sama5d2_xplained.dts | 2 +-
arch/arm/boot/dts/microchip/at91-sama7g5ek.dts | 2 +-
.../dt-bindings/pinctrl}/sama5d2-pinfunc.h | 0
.../dt-bindings/pinctrl}/sama7g5-pinfunc.h | 0
12 files changed, 148 insertions(+), 106 deletions(-)
---
base-commit: 805d849d7c3cc1f38efefd48b2480d62b7b5dcb7
change-id: 20240223-pio4-pinctrl-yaml-c06c10200395
Best regards,
--
Balakrishnan Sambath <[email protected]>
Move sama5d2-pinfunc.h into include/dt-bindings/pinctrl so that we can
include it in yaml dt-binding examples.
Signed-off-by: Balakrishnan Sambath <[email protected]>
---
arch/arm/boot/dts/microchip/at91-kizbox3_common.dtsi | 2 +-
arch/arm/boot/dts/microchip/at91-sama5d27_som1.dtsi | 2 +-
arch/arm/boot/dts/microchip/at91-sama5d27_wlsom1.dtsi | 2 +-
arch/arm/boot/dts/microchip/at91-sama5d29_curiosity.dts | 2 +-
arch/arm/boot/dts/microchip/at91-sama5d2_icp.dts | 2 +-
arch/arm/boot/dts/microchip/at91-sama5d2_ptc_ek.dts | 2 +-
arch/arm/boot/dts/microchip/at91-sama5d2_xplained.dts | 2 +-
.../dts/microchip => include/dt-bindings/pinctrl}/sama5d2-pinfunc.h | 0
8 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/arch/arm/boot/dts/microchip/at91-kizbox3_common.dtsi b/arch/arm/boot/dts/microchip/at91-kizbox3_common.dtsi
index 465664628419..30a0119d260e 100644
--- a/arch/arm/boot/dts/microchip/at91-kizbox3_common.dtsi
+++ b/arch/arm/boot/dts/microchip/at91-kizbox3_common.dtsi
@@ -11,7 +11,7 @@
*/
/dts-v1/;
#include "sama5d2.dtsi"
-#include "sama5d2-pinfunc.h"
+#include <dt-bindings/pinctrl/sama5d2-pinfunc.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/mfd/atmel-flexcom.h>
#include <dt-bindings/pinctrl/at91.h>
diff --git a/arch/arm/boot/dts/microchip/at91-sama5d27_som1.dtsi b/arch/arm/boot/dts/microchip/at91-sama5d27_som1.dtsi
index 95ecb7d040a8..6c8f658ec51c 100644
--- a/arch/arm/boot/dts/microchip/at91-sama5d27_som1.dtsi
+++ b/arch/arm/boot/dts/microchip/at91-sama5d27_som1.dtsi
@@ -7,7 +7,7 @@
* 2017 Claudiu Beznea <[email protected]>
*/
#include "sama5d2.dtsi"
-#include "sama5d2-pinfunc.h"
+#include <dt-bindings/pinctrl/sama5d2-pinfunc.h>
#include <dt-bindings/gpio/gpio.h>
/ {
diff --git a/arch/arm/boot/dts/microchip/at91-sama5d27_wlsom1.dtsi b/arch/arm/boot/dts/microchip/at91-sama5d27_wlsom1.dtsi
index 4617805c7748..6b8e688bb98a 100644
--- a/arch/arm/boot/dts/microchip/at91-sama5d27_wlsom1.dtsi
+++ b/arch/arm/boot/dts/microchip/at91-sama5d27_wlsom1.dtsi
@@ -8,7 +8,7 @@
* Author: Eugen Hristev <[email protected]>
*/
#include "sama5d2.dtsi"
-#include "sama5d2-pinfunc.h"
+#include <dt-bindings/pinctrl/sama5d2-pinfunc.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/mfd/atmel-flexcom.h>
#include <dt-bindings/pinctrl/at91.h>
diff --git a/arch/arm/boot/dts/microchip/at91-sama5d29_curiosity.dts b/arch/arm/boot/dts/microchip/at91-sama5d29_curiosity.dts
index 6b02b7bcfd49..944cc68784a4 100644
--- a/arch/arm/boot/dts/microchip/at91-sama5d29_curiosity.dts
+++ b/arch/arm/boot/dts/microchip/at91-sama5d29_curiosity.dts
@@ -9,7 +9,7 @@
*/
/dts-v1/;
#include "sama5d29.dtsi"
-#include "sama5d2-pinfunc.h"
+#include <dt-bindings/pinctrl/sama5d2-pinfunc.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/mfd/atmel-flexcom.h>
diff --git a/arch/arm/boot/dts/microchip/at91-sama5d2_icp.dts b/arch/arm/boot/dts/microchip/at91-sama5d2_icp.dts
index 999adeca6f33..62d331db8dd5 100644
--- a/arch/arm/boot/dts/microchip/at91-sama5d2_icp.dts
+++ b/arch/arm/boot/dts/microchip/at91-sama5d2_icp.dts
@@ -10,7 +10,7 @@
*/
/dts-v1/;
#include "sama5d2.dtsi"
-#include "sama5d2-pinfunc.h"
+#include <dt-bindings/pinctrl/sama5d2-pinfunc.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/mfd/atmel-flexcom.h>
diff --git a/arch/arm/boot/dts/microchip/at91-sama5d2_ptc_ek.dts b/arch/arm/boot/dts/microchip/at91-sama5d2_ptc_ek.dts
index 200b20515ab1..28df6bc7b28f 100644
--- a/arch/arm/boot/dts/microchip/at91-sama5d2_ptc_ek.dts
+++ b/arch/arm/boot/dts/microchip/at91-sama5d2_ptc_ek.dts
@@ -8,7 +8,7 @@
*/
/dts-v1/;
#include "sama5d2.dtsi"
-#include "sama5d2-pinfunc.h"
+#include <dt-bindings/pinctrl/sama5d2-pinfunc.h>
#include <dt-bindings/mfd/atmel-flexcom.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
diff --git a/arch/arm/boot/dts/microchip/at91-sama5d2_xplained.dts b/arch/arm/boot/dts/microchip/at91-sama5d2_xplained.dts
index 6680031387e8..60adaae39c83 100644
--- a/arch/arm/boot/dts/microchip/at91-sama5d2_xplained.dts
+++ b/arch/arm/boot/dts/microchip/at91-sama5d2_xplained.dts
@@ -7,7 +7,7 @@
*/
/dts-v1/;
#include "sama5d2.dtsi"
-#include "sama5d2-pinfunc.h"
+#include <dt-bindings/pinctrl/sama5d2-pinfunc.h>
#include <dt-bindings/mfd/atmel-flexcom.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
diff --git a/arch/arm/boot/dts/microchip/sama5d2-pinfunc.h b/include/dt-bindings/pinctrl/sama5d2-pinfunc.h
similarity index 100%
rename from arch/arm/boot/dts/microchip/sama5d2-pinfunc.h
rename to include/dt-bindings/pinctrl/sama5d2-pinfunc.h
--
2.25.1
Convert the existing text DT bindings of Atmel's PIO4 pincontroller to
yaml based DT schema.
Signed-off-by: Balakrishnan Sambath <[email protected]>
---
.../bindings/pinctrl/atmel,at91-pio4-pinctrl.txt | 98 ---------------
.../bindings/pinctrl/atmel,sama5d2-pinctrl.yaml | 140 +++++++++++++++++++++
2 files changed, 140 insertions(+), 98 deletions(-)
diff --git a/Documentation/devicetree/bindings/pinctrl/atmel,at91-pio4-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/atmel,at91-pio4-pinctrl.txt
deleted file mode 100644
index 774c3c269c40..000000000000
--- a/Documentation/devicetree/bindings/pinctrl/atmel,at91-pio4-pinctrl.txt
+++ /dev/null
@@ -1,98 +0,0 @@
-* Atmel PIO4 Controller
-
-The Atmel PIO4 controller is used to select the function of a pin and to
-configure it.
-
-Required properties:
-- compatible:
- "atmel,sama5d2-pinctrl"
- "microchip,sama7g5-pinctrl"
-- reg: base address and length of the PIO controller.
-- interrupts: interrupt outputs from the controller, one for each bank.
-- interrupt-controller: mark the device node as an interrupt controller.
-- #interrupt-cells: should be two.
-- gpio-controller: mark the device node as a gpio controller.
-- #gpio-cells: should be two.
-
-Please refer to ../gpio/gpio.txt and ../interrupt-controller/interrupts.txt for
-a general description of GPIO and interrupt bindings.
-
-Please refer to pinctrl-bindings.txt in this directory for details of the
-common pinctrl bindings used by client devices.
-
-Subnode format
-Each node (or subnode) will list the pins it needs and how to configured these
-pins.
-
- node {
- pinmux = <PIN_NUMBER_PINMUX>;
- GENERIC_PINCONFIG;
- };
-
-Required properties:
-- pinmux: integer array. Each integer represents a pin number plus mux and
-ioset settings. Use the macros from boot/dts/<soc>-pinfunc.h file to get the
-right representation of the pin.
-
-Optional properties:
-- GENERIC_PINCONFIG: generic pinconfig options to use:
- - bias-disable, bias-pull-down, bias-pull-up, drive-open-drain,
- drive-push-pull input-schmitt-enable, input-debounce, output-low,
- output-high.
- - for microchip,sama7g5-pinctrl only:
- - slew-rate: 0 - disabled, 1 - enabled (default)
-- atmel,drive-strength: 0 or 1 for low drive, 2 for medium drive and 3 for
-high drive. The default value is low drive.
-
-Example:
-
-#include <sama5d2-pinfunc.h>
-
-...
-{
- pioA: pinctrl@fc038000 {
- compatible = "atmel,sama5d2-pinctrl";
- reg = <0xfc038000 0x600>;
- interrupts = <18 IRQ_TYPE_LEVEL_HIGH 7>,
- <68 IRQ_TYPE_LEVEL_HIGH 7>,
- <69 IRQ_TYPE_LEVEL_HIGH 7>,
- <70 IRQ_TYPE_LEVEL_HIGH 7>;
- interrupt-controller;
- #interrupt-cells = <2>;
- gpio-controller;
- #gpio-cells = <2>;
- clocks = <&pioA_clk>;
-
- pinctrl_i2c0_default: i2c0_default {
- pinmux = <PIN_PD21__TWD0>,
- <PIN_PD22__TWCK0>;
- bias-disable;
- };
-
- pinctrl_led_gpio_default: led_gpio_default {
- pinmux = <PIN_PB0>,
- <PIN_PB5>;
- bias-pull-up;
- atmel,drive-strength = <ATMEL_PIO_DRVSTR_ME>;
- };
-
- pinctrl_sdmmc1_default: sdmmc1_default {
- cmd_data {
- pinmux = <PIN_PA28__SDMMC1_CMD>,
- <PIN_PA18__SDMMC1_DAT0>,
- <PIN_PA19__SDMMC1_DAT1>,
- <PIN_PA20__SDMMC1_DAT2>,
- <PIN_PA21__SDMMC1_DAT3>;
- bias-pull-up;
- };
-
- ck_cd {
- pinmux = <PIN_PA22__SDMMC1_CK>,
- <PIN_PA30__SDMMC1_CD>;
- bias-disable;
- };
- };
- ...
- };
-};
-...
diff --git a/Documentation/devicetree/bindings/pinctrl/atmel,sama5d2-pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/atmel,sama5d2-pinctrl.yaml
new file mode 100644
index 000000000000..8a2dee1d6dd3
--- /dev/null
+++ b/Documentation/devicetree/bindings/pinctrl/atmel,sama5d2-pinctrl.yaml
@@ -0,0 +1,140 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pinctrl/atmel,sama5d2-pinctrl.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Microchip PIO4 Controller
+
+maintainers:
+ - Balakrishnan Sambath <[email protected]>
+
+description:
+ The Microchip PIO4 controller is used to select the function of a pin and to
+ configure it.
+
+
+properties:
+ compatible:
+ enum:
+ - microchip,sama7g5-pinctrl
+ - atmel,sama5d2-pinctrl
+
+ reg:
+ minItems: 1
+ maxItems: 2
+
+ interrupts:
+ description:
+ Interrupt outputs from the controller, one for each bank.
+
+ interrupt-controller: true
+
+ '#interrupt-cells':
+ const: 2
+
+ gpio-controller: true
+
+ '#gpio-cells':
+ const: 2
+
+ clocks:
+ maxItems: 1
+if:
+ properties:
+ compatible:
+ contains:
+ const: microchip,sama7g5-pinctrl
+then:
+ patternProperties:
+ '^.*([-_]default)?$':
+ anyOf:
+ - $ref: "#/$defs/mchp-pio4-pincfg-node-1"
+ - patternProperties:
+ '^[a-z_-][a-z_-]*$':
+ $ref: "#/$defs/mchp-pio4-pincfg-node-1"
+else:
+ patternProperties:
+ '^.*([-_]default)?$':
+ anyOf:
+ - $ref: "#/$defs/mchp-pio4-pincfg-node-2"
+ - patternProperties:
+ '^[a-z_-][a-z_-]*$':
+ $ref: "#/$defs/mchp-pio4-pincfg-node-2"
+
+$defs:
+ mchp-pio4-pincfg-node-1:
+ $ref: pincfg-node.yaml#properties
+ properties:
+ pinmux:
+ $ref: pinmux-node.yaml#/properties/pinmux
+ atmel,drive-strength:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ enum: [0, 1, 2, 3]
+ default: 0
+ required:
+ - pinmux
+
+ mchp-pio4-pincfg-node-2:
+ $ref: pincfg-node.yaml#properties
+ properties:
+ pinmux:
+ $ref: pinmux-node.yaml#/properties/pinmux
+ required:
+ - pinmux
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - interrupt-controller
+ - '#interrupt-cells'
+ - gpio-controller
+ - '#gpio-cells'
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/gpio/gpio.h>
+ #include <dt-bindings/clock/at91.h>
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+ #include <dt-bindings/pinctrl/sama5d2-pinfunc.h>
+
+ pinctrl@fc038000 {
+ compatible = "atmel,sama5d2-pinctrl";
+ reg = <0xfc038000 0x600>;
+ interrupts = <18 IRQ_TYPE_LEVEL_HIGH 7>,
+ <68 IRQ_TYPE_LEVEL_HIGH 7>,
+ <69 IRQ_TYPE_LEVEL_HIGH 7>,
+ <70 IRQ_TYPE_LEVEL_HIGH 7>;
+ interrupt-controller;
+ #interrupt-cells = <2>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ clocks = <&pioA_clk>;
+
+ pinctrl_i2c0_default: i2c0_default {
+ pinmux = <PIN_PD21__TWD0>,
+ <PIN_PD22__TWCK0>;
+ bias-disable;
+ };
+
+ pinctrl_sdmmc1_default: sdmmc1_default {
+ cmd_data {
+ pinmux = <PIN_PA28__SDMMC1_CMD>,
+ <PIN_PA18__SDMMC1_DAT0>,
+ <PIN_PA19__SDMMC1_DAT1>,
+ <PIN_PA20__SDMMC1_DAT2>,
+ <PIN_PA21__SDMMC1_DAT3>;
+ bias-pull-up;
+ };
+
+ ck_cd {
+ pinmux = <PIN_PA22__SDMMC1_CK>,
+ <PIN_PA30__SDMMC1_CD>;
+ bias-disable;
+ };
+ };
+ };
+...
--
2.25.1
Move sama7g5-pinfunc.h into include/dt-bindings/pinctrl so that we can
include it in yaml dt-binding examples.
Signed-off-by: Balakrishnan Sambath <[email protected]>
---
arch/arm/boot/dts/microchip/at91-sama7g5ek.dts | 2 +-
.../dts/microchip => include/dt-bindings/pinctrl}/sama7g5-pinfunc.h | 0
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/microchip/at91-sama7g5ek.dts b/arch/arm/boot/dts/microchip/at91-sama7g5ek.dts
index 217e9b96c61e..a92c37e57aaf 100644
--- a/arch/arm/boot/dts/microchip/at91-sama7g5ek.dts
+++ b/arch/arm/boot/dts/microchip/at91-sama7g5ek.dts
@@ -9,7 +9,7 @@
*
*/
/dts-v1/;
-#include "sama7g5-pinfunc.h"
+#include <dt-bindings/pinctrl/sama7g5-pinfunc.h>
#include "sama7g5.dtsi"
#include <dt-bindings/mfd/atmel-flexcom.h>
#include <dt-bindings/input/input.h>
diff --git a/arch/arm/boot/dts/microchip/sama7g5-pinfunc.h b/include/dt-bindings/pinctrl/sama7g5-pinfunc.h
similarity index 100%
rename from arch/arm/boot/dts/microchip/sama7g5-pinfunc.h
rename to include/dt-bindings/pinctrl/sama7g5-pinfunc.h
--
2.25.1
On Thu, 29 Feb 2024 17:09:32 +0530, Balakrishnan Sambath wrote:
> Convert the existing text DT bindings of Atmel's PIO4 pincontroller to
> yaml based DT schema.
>
> Signed-off-by: Balakrishnan Sambath <[email protected]>
> ---
> .../bindings/pinctrl/atmel,at91-pio4-pinctrl.txt | 98 ---------------
> .../bindings/pinctrl/atmel,sama5d2-pinctrl.yaml | 140 +++++++++++++++++++++
> 2 files changed, 140 insertions(+), 98 deletions(-)
>
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/atmel,sama5d2-pinctrl.example.dts:27:18: fatal error: dt-bindings/pinctrl/sama5d2-pinfunc.h: No such file or directory
27 | #include <dt-bindings/pinctrl/sama5d2-pinfunc.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.lib:419: Documentation/devicetree/bindings/pinctrl/atmel,sama5d2-pinctrl.example.dtb] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [/builds/robherring/dt-review-ci/linux/Makefile:1428: dt_binding_check] Error 2
make: *** [Makefile:240: __sub-make] Error 2
doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]
The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.
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 after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.
On 29/02/2024 12:39, Balakrishnan Sambath wrote:
> Convert the existing text DT bindings of Atmel's PIO4 pincontroller to
> yaml based DT schema.
>
> Signed-off-by: Balakrishnan Sambath <[email protected]>
> ---
Dependency shall be noted here, with lore link.
> .../bindings/pinctrl/atmel,at91-pio4-pinctrl.txt | 98 ---------------
> .../bindings/pinctrl/atmel,sama5d2-pinctrl.yaml | 140 +++++++++++++++++++++
> 2 files changed, 140 insertions(+), 98 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/pinctrl/atmel,at91-pio4-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/atmel,at91-pio4-pinctrl.txt
> deleted file mode 100644
> index 774c3c269c40..000000000000
> --- a/Documentation/devicetree/bindings/pinctrl/atmel,at91-pio4-pinctrl.txt
> +++ /dev/null
> @@ -1,98 +0,0 @@
> -* Atmel PIO4 Controller
..
> -...
> diff --git a/Documentation/devicetree/bindings/pinctrl/atmel,sama5d2-pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/atmel,sama5d2-pinctrl.yaml
> new file mode 100644
> index 000000000000..8a2dee1d6dd3
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/pinctrl/atmel,sama5d2-pinctrl.yaml
> @@ -0,0 +1,140 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/pinctrl/atmel,sama5d2-pinctrl.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Microchip PIO4 Controller
> +
> +maintainers:
> + - Balakrishnan Sambath <[email protected]>
> +
> +description:
> + The Microchip PIO4 controller is used to select the function of a pin and to
> + configure it.
> +
> +
One blank line only.
> +properties:
> + compatible:
> + enum:
> + - microchip,sama7g5-pinctrl
> + - atmel,sama5d2-pinctrl
Keep them alphabetically ordered.
> +
> + reg:
> + minItems: 1
> + maxItems: 2
You need to describe items instead. And why is this flexible?
> +
> + interrupts:
> + description:
> + Interrupt outputs from the controller, one for each bank.
maxItems
> +
> + interrupt-controller: true
> +
> + '#interrupt-cells':
> + const: 2
> +
> + gpio-controller: true
> +
> + '#gpio-cells':
> + const: 2
> +
> + clocks:
> + maxItems: 1
Missing blank line.
> +if:
Missing allOf: and then put it how it is in example schema.
> + properties:
> + compatible:
> + contains:
> + const: microchip,sama7g5-pinctrl
> +then:
> + patternProperties:
> + '^.*([-_]default)?$':
No, properties must be defined in top level, not in if:then:. Also
underscore should not be allowed.
> + anyOf:
> + - $ref: "#/$defs/mchp-pio4-pincfg-node-1"
> + - patternProperties:
> + '^[a-z_-][a-z_-]*$':
Both regexes are way too permissive. Look how other bindings do it.
Usually these are -pins or -group.
> + $ref: "#/$defs/mchp-pio4-pincfg-node-1"
> +else:
> + patternProperties:
> + '^.*([-_]default)?$':
> + anyOf:
> + - $ref: "#/$defs/mchp-pio4-pincfg-node-2"
> + - patternProperties:
> + '^[a-z_-][a-z_-]*$':
> + $ref: "#/$defs/mchp-pio4-pincfg-node-2"
> +
> +$defs:
> + mchp-pio4-pincfg-node-1:
> + $ref: pincfg-node.yaml#properties
> + properties:
> + pinmux:
> + $ref: pinmux-node.yaml#/properties/pinmux
> + atmel,drive-strength:
> + $ref: /schemas/types.yaml#/definitions/uint32
> + enum: [0, 1, 2, 3]
> + default: 0
> + required:
> + - pinmux
> +
> + mchp-pio4-pincfg-node-2:
> + $ref: pincfg-node.yaml#properties
> + properties:
> + pinmux:
> + $ref: pinmux-node.yaml#/properties/pinmux
> + required:
> + - pinmux
> +
> +required:
> + - compatible
> + - reg
> + - interrupts
> + - interrupt-controller
> + - '#interrupt-cells'
> + - gpio-controller
> + - '#gpio-cells'
> +
> +unevaluatedProperties: false
Nope, this must be additionalProperties: false. If you put here
unevaluated, it's a sign you define properties not in correct spot.
> +
> +examples:
> + - |
> + #include <dt-bindings/gpio/gpio.h>
> + #include <dt-bindings/clock/at91.h>
> + #include <dt-bindings/interrupt-controller/arm-gic.h>
> + #include <dt-bindings/pinctrl/sama5d2-pinfunc.h>
> +
> + pinctrl@fc038000 {
> + compatible = "atmel,sama5d2-pinctrl";
> + reg = <0xfc038000 0x600>;
> + interrupts = <18 IRQ_TYPE_LEVEL_HIGH 7>,
> + <68 IRQ_TYPE_LEVEL_HIGH 7>,
> + <69 IRQ_TYPE_LEVEL_HIGH 7>,
> + <70 IRQ_TYPE_LEVEL_HIGH 7>;
> + interrupt-controller;
> + #interrupt-cells = <2>;
> + gpio-controller;
> + #gpio-cells = <2>;
> + clocks = <&pioA_clk>;
> +
> + pinctrl_i2c0_default: i2c0_default {
Underscores are not allowed. Please open DTS coding style. Or test your
DTS with W=2.
Best regards,
Krzysztof
On 29/02/2024 12:39, Balakrishnan Sambath wrote:
> Move sama5d2-pinfunc.h into include/dt-bindings/pinctrl so that we can
> include it in yaml dt-binding examples.
That is not a the reason to make something a binding. Please provide
rationale why this is supposed to be binding. Because it does not look
like at all and it is kind of contradictory to what we recently were
doing - moving from bindings to DTS.
>
Best regards,
Krzysztof
On 29/02/2024 12:39, Balakrishnan Sambath wrote:
> Move sama7g5-pinfunc.h into include/dt-bindings/pinctrl so that we can
> include it in yaml dt-binding examples.
>
Nope, that's not a reason to make a binding. Provide rationale why this
is supposed to be a binding.
Best regards,
Krzysztof