[v2,03/11] dt-bindings: pinctrl: sun4i-a10: add Allwinner B288
Commit Message
The B288 driver takes its mux values from the DT, so allwinner,pinmux
becomes an allowed property here, required for this compatible only.
Signed-off-by: Pablo Mazzini <pmazzini@gmail.com>
---
.../pinctrl/allwinner,sun4i-a10-pinctrl.yaml | 23 +++++++++++++++++++
1 file changed, 23 insertions(+)
Comments
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] dt-bindings: pinctrl: sunxi: missing b288 interrupts constraint validation
--
commit 5d0ff1f67ca22e7e0aeb81a6bb9183820225e5b3
Author: Pablo Mazzini <pmazzini@gmail.com>
dt-bindings: pinctrl: sun4i-a10: add Allwinner B288
The B288 driver takes its mux values from the DT, so allwinner,pinmux
becomes an allowed property here, required for this compatible only.
> diff --git a/Documentation/devicetree/bindings/pinctrl/allwinner,sun4i-a10-pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/allwinner,sun4i-a10-pinctrl.yaml
> index 45b7a0b6c626d..6fe3b64107349 100644
> --- a/Documentation/devicetree/bindings/pinctrl/allwinner,sun4i-a10-pinctrl.yaml
> +++ b/Documentation/devicetree/bindings/pinctrl/allwinner,sun4i-a10-pinctrl.yaml
> @@ -39,6 +39,7 @@ properties:
> - allwinner,sun8i-a33-pinctrl
> - allwinner,sun8i-a83t-pinctrl
> - allwinner,sun8i-a83t-r-pinctrl
> + - allwinner,sun8i-b288-pinctrl
[Severity: Medium]
Since this compatible is for hardware with exactly 4 interrupt banks, shouldn't
it also be added to the later allOf constraints block in this file that
enforces exact hardware limits for interrupts?
For example:
- if:
properties:
compatible:
enum:
- allwinner,sun6i-a31-pinctrl
- allwinner,sun6i-a31s-pinctrl
- allwinner,sun50i-h6-pinctrl
- allwinner,sun8i-b288-pinctrl
then:
properties:
interrupts:
minItems: 4
maxItems: 4
Without this, validation for this variant falls back to the broad global default
of 1 to 8 interrupts.
Does this allow a device tree with an incorrect number of interrupts for the
B288 to silently pass validation?
> - allwinner,sun8i-h3-pinctrl
> - allwinner,sun8i-h3-r-pinctrl
> - allwinner,sun8i-r40-pinctrl
@@ -39,6 +39,7 @@ properties:
- allwinner,sun8i-a33-pinctrl
- allwinner,sun8i-a83t-pinctrl
- allwinner,sun8i-a83t-r-pinctrl
+ - allwinner,sun8i-b288-pinctrl
- allwinner,sun8i-h3-pinctrl
- allwinner,sun8i-h3-r-pinctrl
- allwinner,sun8i-r40-pinctrl
@@ -120,6 +121,15 @@ patternProperties:
$ref: /schemas/types.yaml#/definitions/uint32
enum: [10, 20, 30, 40]
+ allwinner,pinmux:
+ $ref: /schemas/types.yaml#/definitions/uint32-array
+ description:
+ Pinmux selector value, for each pin. Only used by SoCs whose
+ driver takes the mux values from the DT instead of an in-driver
+ table. Almost every time this value is the same for all pins, so
+ any array shorter than the number of pins will repeat the last
+ value, to allow just specifying a single cell, for all cells.
+
required:
- pins
- function
@@ -144,6 +154,19 @@ allOf:
# warnings.
- $ref: pinctrl.yaml#
+
+ # The B288 driver has no in-driver pin table, so the mux values have to
+ # come from the DT.
+ - if:
+ properties:
+ compatible:
+ const: allwinner,sun8i-b288-pinctrl
+
+ then:
+ patternProperties:
+ "^([rs]-)?(([a-z0-9]{3,}|[a-oq-z0-9][a-z0-9]*?)?-)+?(p[a-ilm][0-9]*?-)??pins?$":
+ required:
+ - allwinner,pinmux
- if:
not:
properties: