Devicetree
 help / color / mirror / Atom feed
* [PATCH v2] dt-bindings: mfd: convert rk805 pinctrl to DT schema
@ 2026-09-23  3:42 Quchaosheng
  2026-09-23  3:51 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Quchaosheng @ 2026-09-23  3:42 UTC (permalink / raw)
  To: Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Heiko Stuebner
  Cc: Chris Zhong, Zhang Qing, mfd, devicetree, linux-arm-kernel,
	linux-rockchip, linux-kernel, quchaosheng000406

pinctrl-rk805.txt describes the pinmux controller that is part of the
Rockchip RK805 PMIC. The PMIC itself is already described by
rockchip,rk805.yaml, so the pinmux part belongs there as well: the
pinctrl node is a child of the PMIC node, not a separate device.

Fold the pinmux description into rockchip,rk805.yaml and drop the
standalone text binding.

While doing so, add the missing '-pins$' child node schema. The
rockchip,rk805.yaml schema ends with 'additionalProperties: false' but did
not describe the pin configuration child nodes at all, so a valid pinmux
node like the one shown in pinctrl-rk805.txt was rejected:

    pmic@18 (rockchip,rk805): 'rk805-default-pins' does not match any of
    the regexes: '^pinctrl-[0-9]+$'

The pin configuration nodes require 'pins'; without it a node that names
no pin is accepted silently, while the text binding it replaces listed
'pins' as required. The RK805 exposes two output-only GPIOs, so 'pins' is
an enum of gpio0 and gpio1 and a typo such as "gpio2" is caught.

Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://sashiko.dev/#/patchset/20260923025302.374919-1-quchaosheng000406@163.com?part=1
Assisted-by: LLM
Signed-off-by: Quchaosheng <quchaosheng000406@163.com>
---
 .../bindings/mfd/rockchip,rk805.yaml          | 36 ++++++++++-
 .../bindings/pinctrl/pinctrl-rk805.txt        | 63 -------------------
 2 files changed, 35 insertions(+), 64 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/pinctrl/pinctrl-rk805.txt

diff --git a/Documentation/devicetree/bindings/mfd/rockchip,rk805.yaml b/Documentation/devicetree/bindings/mfd/rockchip,rk805.yaml
index da2391530c16..6353aef3ebe7 100644
--- a/Documentation/devicetree/bindings/mfd/rockchip,rk805.yaml
+++ b/Documentation/devicetree/bindings/mfd/rockchip,rk805.yaml
@@ -86,6 +86,34 @@ properties:
         unevaluatedProperties: false
     unevaluatedProperties: false
 
+patternProperties:
+  '-pins$':
+    type: object
+    description:
+      The RK805 has two output-only GPIOs which can be muxed to the GPIO
+      function and driven low or high at boot.
+    additionalProperties: false
+
+    properties:
+      pins:
+        description:
+          List of GPIO pins to configure.
+        items:
+          enum: [gpio0, gpio1]
+        minItems: 1
+        maxItems: 2
+
+      function:
+        description:
+          The RK805 only supports the GPIO function.
+        enum: [gpio]
+
+      output-low: true
+      output-high: true
+
+    required:
+      - pins
+
 allOf:
   - if:
       properties:
@@ -125,7 +153,7 @@ examples:
             interrupt-parent = <&gpio2>;
             interrupts = <RK_PA6 IRQ_TYPE_LEVEL_LOW>;
             pinctrl-names = "default";
-            pinctrl-0 = <&pmic_int_l>;
+            pinctrl-0 = <&pmic_int_l>, <&rk805_default>;
             rockchip,system-power-controller;
             wakeup-source;
             #clock-cells = <0>;
@@ -137,6 +165,12 @@ examples:
             vcc5-supply = <&vcc_io>;
             vcc6-supply = <&vcc_io>;
 
+            rk805_default: rk805-default-pins {
+                pins = "gpio0", "gpio1";
+                function = "gpio";
+                output-high;
+            };
+
             regulators {
                 vdd_logic: DCDC_REG1 {
                     regulator-name = "vdd_logic";
diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-rk805.txt b/Documentation/devicetree/bindings/pinctrl/pinctrl-rk805.txt
deleted file mode 100644
index 6ad49e51c72e..000000000000
--- a/Documentation/devicetree/bindings/pinctrl/pinctrl-rk805.txt
+++ /dev/null
@@ -1,63 +0,0 @@
-Pincontrol driver for RK805 Power management IC.
-
-RK805 has 2 pins which can be configured as GPIO output only.
-
-Please refer file <devicetree/bindings/pinctrl/pinctrl-bindings.txt>
-for details of the common pinctrl bindings used by client devices,
-including the meaning of the phrase "pin configuration node".
-
-Optional Pinmux properties:
---------------------------
-Following properties are required if default setting of pins are required
-at boot.
-- pinctrl-names: A pinctrl state named per <pinctrl-bindings.txt>.
-- pinctrl[0...n]: Properties to contain the phandle for pinctrl states per
-		<pinctrl-bindings.txt>.
-
-The pin configurations are defined as child of the pinctrl states node. Each
-sub-node have following properties:
-
-Required properties:
-------------------
-- #gpio-cells: Should be two. The first cell is the pin number and the
-  second is the GPIO flags.
-
-- gpio-controller: Marks the device node as a GPIO controller.
-
-- pins: List of pins. Valid values of pins properties are: gpio0, gpio1.
-
-First 2 properties must be added in the RK805 PMIC node, documented in
-Documentation/devicetree/bindings/mfd/rockchip,rk808.yaml
-
-Optional properties:
--------------------
-Following are optional properties defined as pinmux DT binding document
-<pinctrl-bindings.txt>. Absence of properties will leave the configuration
-on default.
-	function,
-	output-low,
-	output-high.
-
-Valid values for function properties are: gpio.
-
-There are also not customised properties for any GPIO.
-
-Example:
---------
-rk805: rk805@18 {
-	compatible = "rockchip,rk805";
-	...
-	gpio-controller;
-	#gpio-cells = <2>;
-
-	pinctrl-names = "default";
-	pinctrl-0 = <&pmic_int_l>, <&rk805_default>;
-
-	rk805_default: pinmux {
-		gpio01 {
-			pins = "gpio0", "gpio1";
-			function = "gpio";
-			output-high;
-		};
-	};
-};
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] dt-bindings: mfd: convert rk805 pinctrl to DT schema
  2026-09-23  3:42 [PATCH v2] dt-bindings: mfd: convert rk805 pinctrl to DT schema Quchaosheng
@ 2026-09-23  3:51 ` sashiko-bot
  0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-09-23  3:51 UTC (permalink / raw)
  To: Quchaosheng; +Cc: conor+dt, lee, mfd, devicetree, robh

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] dt-bindings: mfd: missing gpio-controller in required and examples
- [Low] mfd: commit message description is not capitalized
--

commit e55b5757962f2de0568f1d27e4b5f113a8f4aaad
Author: Quchaosheng <quchaosheng000406@163.com>

dt-bindings: mfd: convert rk805 pinctrl to DT schema

This commit folds the RK805 pinmux text binding into the existing
rockchip,rk805.yaml MFD schema and adds the missing -pins$ child
node schema. It then removes the standalone text binding.

Link: https://sashiko.dev/#/patchset/20260923025302.374919-1-quchaosheng000406@163.com?part=1

> dt-bindings: mfd: convert rk805 pinctrl to DT schema

[Severity: Low]
The MFD subsystem guidelines require that the description after the subsystem
prefix be capitalized. Should the word convert be capitalized to Convert here
to align with the standard MFD naming conventions?

> diff --git a/Documentation/devicetree/bindings/mfd/rockchip,rk805.yaml b/Documentation/devicetree/bindings/mfd/rockchip,rk805.yaml
> index da2391530c16c..6353aef3ebe7c 100644
> --- a/Documentation/devicetree/bindings/mfd/rockchip,rk805.yaml
> +++ b/Documentation/devicetree/bindings/mfd/rockchip,rk805.yaml

[ ... ]

> @@ -86,6 +86,34 @@ properties:
>          unevaluatedProperties: false
>      unevaluatedProperties: false
>  
> +patternProperties:
> +  '-pins$':
> +    type: object
> +    description:
> +      The RK805 has two output-only GPIOs which can be muxed to the GPIO
> +      function and driven low or high at boot.

[Severity: Medium]
Since the RK805 PMIC provides GPIO controller capabilities, the device tree
binding guidelines state that the corresponding properties (gpio-controller
and #gpio-cells) must be added to the global required list. 

The deleted text binding explicitly enforced this requirement. Should
gpio-controller and #gpio-cells be appended to the required list in this
schema to prevent incomplete device tree nodes from silently passing validation?

[ ... ]

> @@ -137,6 +165,12 @@ examples:
>              vcc5-supply = <&vcc_io>;
>              vcc6-supply = <&vcc_io>;
>  
> +            rk805_default: rk805-default-pins {
> +                pins = "gpio0", "gpio1";
> +                function = "gpio";
> +                output-high;
> +            };

[Severity: Medium]
Does the example PMIC node also need to be updated to include
gpio-controller; and #gpio-cells = <2>; to demonstrate a valid and complete
configuration?

Device tree binding guidelines mandate that the examples section must include
all required properties for hardware capabilities like GPIO controllers.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260923034245.396417-1-quchaosheng000406@163.com?part=1

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-23  3:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-23  3:42 [PATCH v2] dt-bindings: mfd: convert rk805 pinctrl to DT schema Quchaosheng
2026-09-23  3:51 ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox