dt-bindings: mfd: rockchip,rk805: Convert pinctrl to DT schema

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 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.

The nodes may be direct children of the PMIC, or sit one level deeper
inside a "pinmux" grouping node, which is the layout the example of the
text binding used. pinctrl-bindings.txt allows the configuration nodes to
be grandchildren of the pin controller, and the driver reaches both
layouts: pinconf_generic_dt_node_to_map() parses the referenced node and
then walks its children. The example shows both.

The example also regains the gpio-controller and #gpio-cells lines that the
example of the text binding had.

Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://sashiko.dev/#/patchset/20260923034245.396417-1-quchaosheng000406@163.com?part=1
Link: https://sashiko.dev/#/patchset/20260923062746.516666-1-quchaosheng000406@163.com?part=1
Link: https://sashiko.dev/#/patchset/20260923074337.575122-1-quchaosheng000406@163.com?part=1
Assisted-by: LLM
Signed-off-by: Quchaosheng <quchaosheng000406@163.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20260923083001.606935-1-quchaosheng000406@163.com
Signed-off-by: Lee Jones <lee@kernel.org>
This commit is contained in:
Quchaosheng 2026-09-23 16:30:01 +08:00 committed by Lee Jones
parent 495d5f41a6
commit c2f8288a58
2 changed files with 59 additions and 64 deletions

View File

@ -77,6 +77,16 @@ properties:
description:
The input supply for LDO_REG3.
# pinctrl-bindings.txt allows the pin configuration nodes to be grandchildren
# of the pin controller, and the text binding this replaces used that layout:
# a "pinmux" node holding the nodes that carry "pins". The driver reaches both
# layouts, because pinconf_generic_dt_node_to_map() parses the referenced node
# and then walks its children.
pinmux:
type: object
additionalProperties:
$ref: '#/$defs/rk805-pin-config'
regulators:
type: object
patternProperties:
@ -86,6 +96,38 @@ properties:
unevaluatedProperties: false
unevaluatedProperties: false
$defs:
rk805-pin-config:
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
patternProperties:
'-pins$':
$ref: '#/$defs/rk805-pin-config'
allOf:
- if:
properties:
@ -125,9 +167,11 @@ 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>, <&rk805_grouped>;
rockchip,system-power-controller;
wakeup-source;
gpio-controller;
#gpio-cells = <2>;
#clock-cells = <0>;
vcc1-supply = <&vcc_sys>;
@ -137,6 +181,20 @@ examples:
vcc5-supply = <&vcc_io>;
vcc6-supply = <&vcc_io>;
rk805_default: rk805-default-pins {
pins = "gpio0";
function = "gpio";
output-high;
};
rk805_grouped: pinmux {
gpio01 {
pins = "gpio1";
function = "gpio";
output-low;
};
};
regulators {
vdd_logic: DCDC_REG1 {
regulator-name = "vdd_logic";

View File

@ -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;
};
};
};