dt-bindings: pinctrl: microchip,pic32mzda-pinctrl: Convert to DT schema
Subsystems (3)
PATCH 1/1 dt-bindings: pinctrl: microchip,pic32mzda-pinctrl: Convert to DT schema
Convert Microchip PIC32 Pin Controller devicetree binding from legacy text format to DT schema.
--- .../pinctrl/microchip,pic32-pinctrl.txt | 60 -------- .../pinctrl/microchip,pic32mzda-pinctrl.yaml | 141 ++++++++++++++++++ 2 files changed, 141 insertions(+), 60 deletions(-) delete mode 100644 Documentation/devicetree/bindings/pinctrl/microchip,pic32-pinctrl.txt create mode 100644 Documentation/devicetree/bindings/pinctrl/microchip,pic32mzda-pinctrl.yaml
Documentation/devicetree/bindings/pinctrl/microchip,pic32-pinctrl.txt deleted +0 -60
@@ -1,60 +0,0 @@ -* Microchip PIC32 Pin Controller - -Please refer to pinctrl-bindings.txt, ../gpio/gpio.txt, and -../interrupt-controller/interrupts.txt for generic information regarding -pin controller, GPIO, and interrupt bindings. - -PIC32 'pin configuration node' is a node of a group of pins which can be -used for a specific device or function. This node represents configurations of -pins, optional function, and optional mux related configuration. - -Required properties for pin controller node: - - compatible: "microchip,pic32mada-pinctrl" - - reg: Address range of the pinctrl registers. - - clocks: Clock specifier (see clock bindings for details) - -Required properties for pin configuration sub-nodes: - - pins: List of pins to which the configuration applies. - -Optional properties for pin configuration sub-nodes: ----------------------------------------------------- - - function: Mux function for the specified pins. - - bias-pull-up: Enable weak pull-up. - - bias-pull-down: Enable weak pull-down. - - input-enable: Set the pin as an input. - - output-low: Set the pin as an output level low. - - output-high: Set the pin as an output level high. - - microchip,digital: Enable digital I/O. - - microchip,analog: Enable analog I/O. - -Example: - -pic32_pinctrl: pinctrl@1f801400{ - #address-cells = <1>; - #size-cells = <1>; - compatible = "microchip,pic32mzda-pinctrl"; - reg = <0x1f801400 0x400>; - clocks = <&rootclk PB1CLK>; - - pinctrl_uart2: pinctrl_uart2 { - uart2-tx { - pins = "G9"; - function = "U2TX"; - microchip,digital; - output-low; - }; - uart2-rx { - pins = "B0"; - function = "U2RX"; - microchip,digital; - input-enable; - }; - }; -}; - -uart2: serial@1f822200 { - compatible = "microchip,pic32mzda-uart"; - reg = <0x1f822200 0x50>; - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_uart2>; -};
Documentation/devicetree/bindings/pinctrl/microchip,pic32mzda-pinctrl.yaml new file +141 -0
141 lines not on this page · raw message
Signature · 1 line
2.34.1
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider: - [High] The `function` property enum restricts the allowed mux functions to only four UART-related values…
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] The function property enum restricts the allowed mux functions to only four UART-related values (U2TX, U2RX, U4TX, U4RX), breaking validation for all other hardware peripherals.
- [High] The function property is missing from the top-level pin configuration node's properties, preventing its use on direct, single-level configuration nodes.
- [High] The regular expressions used in patternProperties enforce non-standard, brittle naming conventions and will incorrectly reject valid device tree node names. --
commit bc456fcb7e299ea733020d3953dfb0867baf36ff
Author: Udaya Kiran Challa <[email protected]>
dt-bindings: pinctrl: microchip,pic32mzda-pinctrl: Convert to DT schema
Convert Microchip PIC32 Pin Controller devicetree binding from legacy text format to DT schema.
Quoted 6 lines
Documentation/devicetree/bindings/pinctrl/microchip,pic32mzda-pinctrl.yaml new file +0
-0@@ -0,0 +1,141 @@
[ ... ]
Documentation/devicetree/bindings/pinctrl/microchip,pic32mzda-pinctrl.yaml line 34
Quoted 2 lines
Documentation/devicetree/bindings/pinctrl/microchip,pic32mzda-pinctrl.yaml new file +2
-0+patternProperties: + '^[a-z0-9]+[_-].*$':
[Severity: High]
Does this regular expression inappropriately reject valid and standard device tree node names?
By requiring an underscore or hyphen, this outer regex prevents generic single-word node names like "spi0" for a pin group container.
Quoted 9 lines
Documentation/devicetree/bindings/pinctrl/microchip,pic32mzda-pinctrl.yaml new file +9
-0+ type: object + description: | + Pin configuration node with pin muxing and configuration properties. + Can be either a direct pin configuration node or a container node + with child pin configuration nodes. + + properties: + pins: + description: |
Documentation/devicetree/bindings/pinctrl/microchip,pic32mzda-pinctrl.yaml line 53
Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/microchip,pic32mzda-pinctrl.yaml new file +10
-0+ List of pins to which the configuration applies. + items: + type: string + minItems: 1 + + bias-pull-up: true + bias-pull-down: true + input-enable: true + output-low: true + output-high: true
[Severity: High]
Is the "function" property missing from this properties block?
Because the patternProperties node defines additionalProperties: false later on, omitting "function" here forces all users to use a nested container structure. This seems to contradict the description which states the node can be a direct pin configuration node.
Documentation/devicetree/bindings/pinctrl/microchip,pic32mzda-pinctrl.yaml line 64
Quoted 11 lines
Documentation/devicetree/bindings/pinctrl/microchip,pic32mzda-pinctrl.yaml new file +11
-0+ + microchip,digital: + description: Enable digital I/O. + type: boolean + + microchip,analog: + description: Enable analog I/O. + type: boolean + + patternProperties: + '^[a-z]+[0-9]+-[a-z]+$':
[Severity: High]
Could this inner regular expression impose a brittle naming structure?
Because it requires a strict "<alpha><num>-<alpha>" pattern, it will reject valid node names like "i2c-sda" (no number) or "tx" (no hyphen).
Quoted 4 lines
Documentation/devicetree/bindings/pinctrl/microchip,pic32mzda-pinctrl.yaml new file +4
-0+ type: object + description: | + Child pin configuration node. +
Documentation/devicetree/bindings/pinctrl/microchip,pic32mzda-pinctrl.yaml line 78
Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/microchip,pic32mzda-pinctrl.yaml new file +10
-0+ properties: + pins: + items: + type: string + minItems: 1 + + function: + description: | + A string containing the name of the function to mux pin. + enum: [ U2TX, U2RX, U4TX, U4RX ]
[Severity: High]
Is it intentional to restrict the allowed mux functions to only these four UART-related values?
This enum arbitrarily limits the allowed strings and will break validation for other hardware peripherals like IC3, SDI1, and OC3 which are supported by the driver.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Rob Herring (Arm)
maintainerQuoted 11 lines · Udaya Kiran Challa
Convert Microchip PIC32 Pin Controller devicetree binding from legacy text format to DT schema.
Signed-off-by Udaya Kiran Challa <[email protected]>--- .../pinctrl/microchip,pic32-pinctrl.txt | 60 -------- .../pinctrl/microchip,pic32mzda-pinctrl.yaml | 141 ++++++++++++++++++ 2 files changed, 141 insertions(+), 60 deletions(-) delete mode 100644 Documentation/devicetree/bindings/pinctrl/microchip,pic32-pinctrl.txt create mode 100644 Documentation/devicetree/bindings/pinctrl/microchip,pic32mzda-pinctrl.yaml
My bot found errors running 'make dt_binding_check' on your patch:
yamllint warnings/errors:
dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/pinctrl/microchip,pic32mzda-pinctrl.example.dtb: serial@1f822200 (microchip,pic32mzda-uart): 'oneOf' conditional failed, one must be fixed:
'interrupts' is a required property
'interrupts-extended' is a required property
from schema $id: http://devicetree.org/schemas/serial/microchip,pic32mzda-uart.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/pinctrl/microchip,pic32mzda-pinctrl.example.dtb: serial@1f822200 (microchip,pic32mzda-uart): 'clocks' is a required property
from schema $id: http://devicetree.org/schemas/serial/microchip,pic32mzda-uart.yaml
doc reference errors (make refcheckdocs):
See https://patchwork.kernel.org/project/devicetree/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.