* [PATCH v2] dt-bindings: pinctrl: ti,pinctrl-palmas: Convert to DT schema
@ 2026-08-22 16:09 Bhargav Joshi
2026-08-22 16:17 ` sashiko-bot
0 siblings, 1 reply; 2+ messages in thread
From: Bhargav Joshi @ 2026-08-22 16:09 UTC (permalink / raw)
To: Linus Walleij, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Laxman Dewangan
Cc: linux-gpio, devicetree, linux-kernel, goledhruva, m-chawdhry,
daniel.baluta, simona.toaca, j.bhargav.u
Convert TI Palmas pin control text binding to DT schema. The legacy
binding allowed any subnode name. Restrict them to standard prefixes to
prevent the validator from accidentally evaluating standard integer
properties (like phandle) as child nodes.
Signed-off-by: Bhargav Joshi <j.bhargav.u@gmail.com>
---
Changes in v2:
- Removed legacy text binding which was not removed accidently in v1
- Link to v1: https://lore.kernel.org/r/20260822-ti-pinctrl-palmas-v1-1-a4d49e7f2dab@gmail.com
---
.../devicetree/bindings/pinctrl/pinctrl-palmas.txt | 105 -------------
.../bindings/pinctrl/ti,palmas-pinctrl.yaml | 175 +++++++++++++++++++++
2 files changed, 175 insertions(+), 105 deletions(-)
diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-palmas.txt b/Documentation/devicetree/bindings/pinctrl/pinctrl-palmas.txt
deleted file mode 100644
index c28d4eb83b76..000000000000
--- a/Documentation/devicetree/bindings/pinctrl/pinctrl-palmas.txt
+++ /dev/null
@@ -1,105 +0,0 @@
-Palmas Pincontrol bindings
-
-The pins of Palmas device can be set on different option and provides
-the configuration for Pull UP/DOWN, open drain etc.
-
-Required properties:
-- compatible: It must be one of following:
- - "ti,palmas-pinctrl" for Palma series of the pincontrol.
- - "ti,tps65913-pinctrl" for Palma series device TPS65913.
- - "ti,tps80036-pinctrl" for Palma series device TPS80036.
-
-Please refer to pinctrl-bindings.txt in this directory for details of the
-common pinctrl bindings used by client devices, including the meaning of the
-phrase "pin configuration node".
-
-Palmas's pin configuration nodes act as a container for an arbitrary number of
-subnodes. Each of these subnodes represents some desired configuration for a
-list of pins. This configuration can include the mux function to select on
-those pin(s), and various pin configuration parameters, such as pull-up,
-open drain.
-
-The name of each subnode is not important; all subnodes should be enumerated
-and processed purely based on their content.
-
-Each subnode only affects those parameters that are explicitly listed. In
-other words, a subnode that lists a mux function but no pin configuration
-parameters implies no information about any pin configuration parameters.
-Similarly, a pin subnode that describes a pullup parameter implies no
-information about e.g. the mux function.
-
-Optional properties:
-- ti,palmas-enable-dvfs1: Enable DVFS1. Configure pins for DVFS1 mode.
- Selection primary or secondary function associated to I2C2_SCL_SCE,
- I2C2_SDA_SDO pin/pad for DVFS1 interface
-- ti,palmas-enable-dvfs2: Enable DVFS2. Configure pins for DVFS2 mode.
- Selection primary or secondary function associated to GPADC_START
- and SYSEN2 pin/pad for DVFS2 interface
-- ti,palmas-override-powerhold: This is applicable for PMICs for which
- GPIO7 is configured in POWERHOLD mode which has higher priority
- over DEV_ON bit and keeps the PMIC supplies on even after the DEV_ON
- bit is turned off. This property enables driver to over ride the
- POWERHOLD value to GPIO7 so as to turn off the PMIC in power off
- scenarios. So for GPIO7 if ti,palmas-override-powerhold is set
- then the GPIO_7 field should never be muxed to anything else.
- It should be set to POWERHOLD by default and only in case of
- power off scenarios the driver will over ride the mux value.
-
-This binding uses the following generic properties as defined in
-pinctrl-bindings.txt:
-
-Required: pins
-Options: function, bias-disable, bias-pull-up, bias-pull-down,
- drive-open-drain.
-
-Note that many of these properties are only valid for certain specific pins.
-See the Palmas device datasheet for complete details regarding which pins
-support which functionality.
-
-Valid values for pin names are:
- gpio0, gpio1, gpio2, gpio3, gpio4, gpio5, gpio6, gpio7, gpio8, gpio9,
- gpio10, gpio11, gpio12, gpio13, gpio14, gpio15, vac, powergood,
- nreswarm, pwrdown, gpadc_start, reset_in, nsleep, enable1, enable2,
- int.
-
-Valid value of function names are:
- gpio, led, pwm, regen, sysen, clk32kgaudio, id, vbus_det, chrg_det,
- vac, vacok, powergood, usb_psel, msecure, pwrhold, int, nreswarm,
- simrsto, simrsti, low_vbat, wireless_chrg1, rcm, pwrdown, gpadc_start,
- reset_in, nsleep, enable.
-
-There are 4 special functions: opt0, opt1, opt2 and opt3. If any of these
-functions is selected then directly pins register will be written with 0, 1, 2
-or 3 respectively if it is valid for that pins or list of pins.
-
-Example:
- palmas: tps65913 {
- ....
- pinctrl {
- compatible = "ti,tps65913-pinctrl";
- ti,palmas-enable-dvfs1;
- pinctrl-names = "default";
- pinctrl-0 = <&palmas_pins_state>;
-
- palmas_pins_state: pinmux {
- gpio0 {
- pins = "gpio0";
- function = "id";
- bias-pull-up;
- };
-
- vac {
- pins = "vac";
- function = "vacok";
- bias-pull-down;
- };
-
- gpio5 {
- pins = "gpio5";
- function = "opt0";
- drive-open-drain = <1>;
- };
- };
- };
- ....
- };
diff --git a/Documentation/devicetree/bindings/pinctrl/ti,palmas-pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/ti,palmas-pinctrl.yaml
new file mode 100644
index 000000000000..c07e3a782ef0
--- /dev/null
+++ b/Documentation/devicetree/bindings/pinctrl/ti,palmas-pinctrl.yaml
@@ -0,0 +1,175 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pinctrl/ti,palmas-pinctrl.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: TI Palmas Pincontrol
+
+maintainers:
+ - Laxman Dewangan <ldewangan@nvidia.com>
+
+description:
+ The pins of Palmas device can be set on different option and provides
+ the configuration for Pull UP/DOWN, open drain etc.
+
+allOf:
+ - $ref: pinctrl.yaml#
+
+properties:
+ compatible:
+ enum:
+ - ti,palmas-pinctrl
+ - ti,tps65913-pinctrl
+ - ti,tps80036-pinctrl
+
+ ti,palmas-enable-dvfs1:
+ type: boolean
+ description:
+ Enable DVFS1. Configure pins for DVFS1 mode.
+ Selection primary or secondary function associated to I2C2_SCL_SCE,
+ I2C2_SDA_SDO pin/pad for DVFS1 interface.
+
+ ti,palmas-enable-dvfs2:
+ type: boolean
+ description:
+ Enable DVFS2. Configure pins for DVFS2 mode.
+ Selection primary or secondary function associated to GPADC_START
+ and SYSEN2 pin/pad for DVFS2 interface.
+
+ ti,palmas-override-powerhold:
+ type: boolean
+ description:
+ This is applicable for PMICs for which GPIO7 is configured in POWERHOLD
+ mode which has higher priority over DEV_ON bit and keeps the PMIC
+ supplies on even after the DEV_ON bit is turned off. This property enables
+ driver to over ride the POWERHOLD value to GPIO7 so as to turn off the PMIC
+ in power off scenarios. So for GPIO7 if ti,palmas-override-powerhold is set
+ then the GPIO_7 field should never be muxed to anything else.
+ It should be set to POWERHOLD by default and only in case of
+ power off scenarios the driver will over ride the mux value.
+
+patternProperties:
+ '^(pinmux|pins?-[a-z0-9-]+)$':
+ type: object
+ additionalProperties: false
+ patternProperties:
+ '^(pin.*|gpio[0-9]+|vac|powergood|nreswarm|pwrdown|gpadc_start|reset_in|nsleep|enable[12]|int)$':
+ type: object
+ allOf:
+ - $ref: /schemas/pinctrl/pinmux-node.yaml
+ - $ref: /schemas/pinctrl/pincfg-node.yaml
+ additionalProperties: false
+ properties:
+ pins:
+ items:
+ enum:
+ - gpio0
+ - gpio1
+ - gpio2
+ - gpio3
+ - gpio4
+ - gpio5
+ - gpio6
+ - gpio7
+ - gpio8
+ - gpio9
+ - gpio10
+ - gpio11
+ - gpio12
+ - gpio13
+ - gpio14
+ - gpio15
+ - vac
+ - powergood
+ - nreswarm
+ - pwrdown
+ - gpadc_start
+ - reset_in
+ - nsleep
+ - enable1
+ - enable2
+ - int
+
+ function:
+ description:
+ Selects the mux function. There are 4 special functions opt0,
+ opt1, opt2 and opt3. If any of these functions is selected then
+ directly pins register will be written with 0, 1, 2 or 3
+ respectively if it is valid for that pin or list of pins.
+ enum:
+ - gpio
+ - led
+ - pwm
+ - regen
+ - sysen
+ - clk32kgaudio
+ - id
+ - vbus_det
+ - chrg_det
+ - vac
+ - vacok
+ - powergood
+ - usb_psel
+ - msecure
+ - pwrhold
+ - int
+ - nreswarm
+ - simrsto
+ - simrsti
+ - low_vbat
+ - wireless_chrg1
+ - rcm
+ - pwrdown
+ - gpadc_start
+ - reset_in
+ - nsleep
+ - enable
+ - opt0
+ - opt1
+ - opt2
+ - opt3
+
+ bias-disable: true
+ bias-pull-up: true
+ bias-pull-down: true
+ drive-open-drain: true
+
+ required:
+ - pins
+
+required:
+ - compatible
+
+additionalProperties: false
+
+examples:
+ - |
+ pmic {
+ pinctrl {
+ compatible = "ti,tps65913-pinctrl";
+ ti,palmas-enable-dvfs1;
+ pinctrl-names = "default";
+ pinctrl-0 = <&palmas_pins_state>;
+
+ pinmux {
+ gpio0 {
+ pins = "gpio0";
+ function = "id";
+ bias-pull-up;
+ };
+
+ vac {
+ pins = "vac";
+ function = "vacok";
+ bias-pull-down;
+ };
+
+ gpio5 {
+ pins = "gpio5";
+ function = "opt0";
+ drive-open-drain = <1>;
+ };
+ };
+ };
+ };
---
base-commit: 818bebeb63dd6bf5f4e07e145f6cdbace520a34c
change-id: 20260822-ti-pinctrl-palmas-ee56e29a3d43
Best regards,
--
Bhargav
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] dt-bindings: pinctrl: ti,pinctrl-palmas: Convert to DT schema
2026-08-22 16:09 [PATCH v2] dt-bindings: pinctrl: ti,pinctrl-palmas: Convert to DT schema Bhargav Joshi
@ 2026-08-22 16:17 ` sashiko-bot
0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-08-22 16:17 UTC (permalink / raw)
To: Bhargav Joshi; +Cc: conor+dt, robh, devicetree
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] Top-level `additionalProperties: false` incorrectly rejects properties from `$ref`.
- [Low] The dt-schema example fails to compile with dtc due to a missing node label referenced by a phandle.
--
--- Patch [1]: [PATCH v2] dt-bindings: pinctrl: ti,pinctrl-palmas: Convert to DT schema ---
commit c7d2f1369b4c397f6cd83791ed0ce6eb90fe3adf
Author: Bhargav Joshi <j.bhargav.u@gmail.com>
dt-bindings: pinctrl: ti,pinctrl-palmas: Convert to DT schema
Convert TI Palmas pin control text binding to DT schema. The legacy
binding allowed any subnode name. Restrict them to standard prefixes to
prevent the validator from accidentally evaluating standard integer
properties (like phandle) as child nodes.
Link: https://lore.kernel.org/r/20260822-ti-pinctrl-palmas-v1-1-a4d49e7f2dab@gmail.com
> diff --git a/Documentation/devicetree/bindings/pinctrl/ti,palmas-pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/ti,palmas-pinctrl.yaml
> new file mode 100644
> index 0000000000000..c07e3a782ef07
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/pinctrl/ti,palmas-pinctrl.yaml
[ ... ]
> +required:
> + - compatible
> +
> +additionalProperties: false
[Severity: Medium]
Since this binding includes allOf: - $ref: pinctrl.yaml#, won't
additionalProperties: false incorrectly reject standard pinctrl properties?
Should this be unevaluatedProperties: false instead so that the schema
properly accounts for the inherited $ref properties?
> +
> +examples:
> + - |
> + pmic {
> + pinctrl {
> + compatible = "ti,tps65913-pinctrl";
> + ti,palmas-enable-dvfs1;
> + pinctrl-names = "default";
> + pinctrl-0 = <&palmas_pins_state>;
> +
> + pinmux {
[Severity: Low]
The phandle <&palmas_pins_state> is referenced here, but the corresponding
label palmas_pins_state: appears to have been omitted from the pinmux node
during the text-to-yaml conversion.
Will this cause the dt-schema example to fail compilation with dtc due to
the unresolvable phandle?
> + gpio0 {
> + pins = "gpio0";
> + function = "id";
> + bias-pull-up;
> + };
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260822-ti-pinctrl-palmas-v2-1-501c9c670e4f@gmail.com?part=1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-08-22 16:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-22 16:09 [PATCH v2] dt-bindings: pinctrl: ti,pinctrl-palmas: Convert to DT schema Bhargav Joshi
2026-08-22 16:17 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox