Skip to contentSkip to conversation

dt-bindings: mfd: rockchip: drop redundant wakeup-source definitions

PATCH In review [email protected] 3 participants 9 messages Apr 23 – May 11

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 dt-bindings: mfd: rockchip: drop redundant wakeup-source definitions

From: bui duc phuc <[email protected]>

The 'wakeup-source' property already has its type defined in the core schema. The Rockchip MFD bindings redundantly specify 'type: boolean' and provide descriptions which only repeat the generic meaning of the property. Drop these redundant definitions and descriptions to clean up the binding files and rely on the core schema instead. No functional change intended.

---
 Documentation/devicetree/bindings/mfd/rockchip,rk801.yaml | 5 +----
 Documentation/devicetree/bindings/mfd/rockchip,rk805.yaml | 5 +----
 Documentation/devicetree/bindings/mfd/rockchip,rk808.yaml | 5 +----
 Documentation/devicetree/bindings/mfd/rockchip,rk817.yaml | 5 +----
 Documentation/devicetree/bindings/mfd/rockchip,rk818.yaml | 5 +----
 5 files changed, 5 insertions(+), 20 deletions(-)
Documentation/devicetree/bindings/mfd/rockchip,rk801.yaml +1 -4
index 7c71447200ba..8e394ab6879b 100644
@@ -29,10 +29,7 @@ properties:
     description:
       Telling whether or not this PMIC is controlling the system power.
 
-  wakeup-source:
-    type: boolean
-    description:
-      Device can be used as a wakeup source.
+  wakeup-source: true
 
   vcc1-supply:
     description:
Documentation/devicetree/bindings/mfd/rockchip,rk805.yaml +1 -4
index da2391530c16..548ba1f30712 100644
@@ -48,10 +48,7 @@ properties:
 
   system-power-controller: true
 
-  wakeup-source:
-    type: boolean
-    description:
-      Device can be used as a wakeup source.
+  wakeup-source: true
 
   vcc1-supply:
     description:
Documentation/devicetree/bindings/mfd/rockchip,rk808.yaml +1 -4
index 50dfffac8fbf..40f8f23afad3 100644
@@ -43,10 +43,7 @@ properties:
 
   system-power-controller: true
 
-  wakeup-source:
-    type: boolean
-    description:
-      Device can be used as a wakeup source.
+  wakeup-source: true
 
   vcc1-supply:
     description:
Documentation/devicetree/bindings/mfd/rockchip,rk817.yaml +1 -4
index 2cb6d176a84c..b99aaff100fb 100644
@@ -55,10 +55,7 @@ properties:
 
   system-power-controller: true
 
-  wakeup-source:
-    type: boolean
-    description:
-      Device can be used as a wakeup source.
+  wakeup-source: true
 
   vcc1-supply:
     description:
Documentation/devicetree/bindings/mfd/rockchip,rk818.yaml +1 -4
index 90d944c27ba1..b7af774b1395 100644
@@ -43,10 +43,7 @@ properties:
 
   system-power-controller: true
 
-  wakeup-source:
-    type: boolean
-    description:
-      Device can be used as a wakeup source.
+  wakeup-source: true
 
   vcc1-supply:
     description:
Signature · 1 line
2.43.0
#1 lore raw

PATCH 2/2 ASoC: dt-bindings: drop redundant wakeup-source definitions

From: bui duc phuc <[email protected]>

The 'wakeup-source' property already has its type defined in the core schema. A number of sound binding files redundantly specify the 'type: boolean' and provide descriptions which only repeat the generic meaning of the property.
Drop these redundant definitions and descriptions to clean up the binding files and rely on the core schema instead.
No functional change intended.

---
 Documentation/devicetree/bindings/sound/dialog,da7219.yaml  | 5 +----
 Documentation/devicetree/bindings/sound/realtek,rt5514.yaml | 4 +---
 2 files changed, 2 insertions(+), 7 deletions(-)
Documentation/devicetree/bindings/sound/dialog,da7219.yaml +1 -4
index 19137abdba3e..fab37cd92e0d 100644
@@ -45,10 +45,7 @@ properties:
       - wakeup
       - irq
 
-  wakeup-source:
-    type: boolean
-    description:
-      Flag to indicate this device can wake system (suspend/resume).
+  wakeup-source: true
 
   "#clock-cells":
     const: 1
Documentation/devicetree/bindings/sound/realtek,rt5514.yaml +1 -3
index 7fbf7739c371..57e5c09c05c0 100644
@@ -48,9 +48,7 @@ properties:
 
   spi-max-frequency: true
 
-  wakeup-source:
-    type: boolean
-    description: Flag to indicate this device can wake system (suspend/resume).
+  wakeup-source: true
 
 required:
   - compatible
Signature · 1 line
2.43.0
#8 lore raw
In reply to [email protected]
Quoted 4 lines · On Thu, Apr 23, 2026 at 11:28:30AM +0700, [email protected] wrote:

From: bui duc phuc <[email protected]>

The 'wakeup-source' property already has its type defined in the core schema. The Rockchip MFD bindings redundantly specify 'type: boolean'

No, core schema has TWO types.

Defining it as type boolean is not redundant, because of_property_read_bool() on non-bool is deprecated.

This must be explained somehow - are these device drivers expecting bool or not?

Best regards,
Krzysztof

#2 lore raw

Re: [PATCH 2/2] ASoC: dt-bindings: drop redundant wakeup-source definitions

In reply to [email protected]
Quoted 3 lines · On Thu, Apr 23, 2026 at 11:28:31AM +0700, [email protected] wrote:

From: bui duc phuc <[email protected]>

The 'wakeup-source' property already has its type defined in the core

TYPES. It is plural.

Quoted 18 lines

schema. A number of sound binding files redundantly specify the 'type: boolean' and provide descriptions which only repeat the generic meaning of the property.
Drop these redundant definitions and descriptions to clean up the binding files and rely on the core schema instead.
No functional change intended.

---
 Documentation/devicetree/bindings/sound/dialog,da7219.yaml  | 5 +----
 Documentation/devicetree/bindings/sound/realtek,rt5514.yaml | 4 +---
 2 files changed, 2 insertions(+), 7 deletions(-)
Documentation/devicetree/bindings/sound/dialog,da7219.yaml +0 -0
index 19137abdba3e..fab37cd92e0d 100644

Documentation/devicetree/bindings/sound/dialog,da7219.yaml properties: · line 48

Quoted 8 lines
Documentation/devicetree/bindings/sound/dialog,da7219.yaml +1 -4
@@ -45,10 +45,7 @@ properties:
       - wakeup
       - irq
 
-  wakeup-source:
-    type: boolean
-    description:
-      Flag to indicate this device can wake system (suspend/resume).
+  wakeup-source: true

That's wrong. Commit msg is making here false statements that it is redundant. I checked (and you should too!) and driver does clearly device_property_read_bool() thus the property CANNOT be the second type.

Best regards,
Krzysztof

#3 lore raw

Re: [PATCH 2/2] ASoC: dt-bindings: drop redundant wakeup-source definitions

Hi,

Quoted 4 lines
Quoted 1 line

The 'wakeup-source' property already has its type defined in the core

TYPES. It is plural.

Thank you for pointing that out. That was a mistake in my wording. Regarding the two data types, I’m already aware of this and have discussed it in a previous patch.

https://lore.kernel.org/all/CAABR9nH3hr+Y5ksD0cn3Gd9XUvmb07X7zJw0b4k_yVbnAuz9=w@mail.gmail.com/

Quoted 12 lines

Review

Quoted 9 lines
(quoted diff) +1 -4
-  wakeup-source:
 
-    type: boolean
 
-    description:
 
-      Flag to indicate this device can wake system (suspend/resume).
 
+  wakeup-source: true
Quoted 5 lines

That's wrong. Commit msg is making here false statements that it is

redundant. I checked (and you should too!) and driver does clearly

device_property_read_bool() thus the property CANNOT be the second type.

I think Device Tree bindings should describe the hardware capability. If the hardware supports wakeup functionality,
referencing the core schema is sufficient. Hardware description should not be constrained by the current driver implementation
( e.g. the use of device_property_read_bool() ).
Bindings should remain stable and generic, while drivers can evolve over time.

Re-defining the type locally duplicates the core definition. If the core schema evolves,
this approach would require touching many bindings instead of updating one central place.

This follows the recent cleanups suggested by Rob

https://lore.kernel.org/all/[email protected]/
https://lore.kernel.org/all/[email protected]/

Best regards,
Phuc

#4 lore raw

Re: [PATCH 2/2] ASoC: dt-bindings: drop redundant wakeup-source definitions

Quoted 26 lines · Bui Duc Phuc

Hi,

Quoted 4 lines
Quoted 1 line

The 'wakeup-source' property already has its type defined in the core

TYPES. It is plural.

Thank you for pointing that out. That was a mistake in my wording. Regarding the two data types, I’m already aware of this and have discussed it in a previous patch.

https://lore.kernel.org/all/CAABR9nH3hr+Y5ksD0cn3Gd9XUvmb07X7zJw0b4k_yVbnAuz9=w@mail.gmail.com/

Quoted 11 lines
Quoted 9 lines
(quoted diff) +1 -4
-  wakeup-source:
 
-    type: boolean
 
-    description:
 
-      Flag to indicate this device can wake system (suspend/resume).
 
+  wakeup-source: true
Quoted 7 lines
Quoted 5 lines

That's wrong. Commit msg is making here false statements that it is

redundant. I checked (and you should too!) and driver does clearly

device_property_read_bool() thus the property CANNOT be the second type.

I think Device Tree bindings should describe the hardware capability.

Yes. And the ABI. You cannot have ABI which has an incompatible implementation. IOW, when implementation contradicts the ABI, something is wrong.

The question of course if read_bool() is here incompatible. From the actual code point of view, it is compatible, but how it is documented and how it is intended to use: it is not compatible.

Also if future schema-kernel-ABI checker gets implemented, the tool might report here a mistake for that reason. read_bool() means property is bool.

Quoted 5 lines

If the hardware supports wakeup functionality,
referencing the core schema is sufficient. Hardware description should not be constrained by the current driver implementation
( e.g. the use of device_property_read_bool() ).
Bindings should remain stable and generic, while drivers can evolve over time.

So you claim that bindings can define property as integer, but drivers can evolve and for example read it as string?

Quoted 3 lines

Re-defining the type locally duplicates the core definition. If the core schema evolves,

There is no re-definition here. This is choice of subset of types.

Quoted 7 lines

this approach would require touching many bindings instead of updating one central place.

This follows the recent cleanups suggested by Rob

https://lore.kernel.org/all/[email protected]/
https://lore.kernel.org/all/[email protected]/

Where is Rob's suggestion to do such cleanups for EXISTING code? I only see that new code should come like that.

Anyway, your commit msg is for me incorrect because it misses all this points I made. Whether the schema code is correct, I'll defer to Rob, although I still claim the same I claimed before at v2 or v3 of your previous work - this should have defined type.

Best regards,
Krzysztof

#5 lore raw

Re: [PATCH 2/2] ASoC: dt-bindings: drop redundant wakeup-source definitions

Hi,

Quoted 13 lines

Yes. And the ABI. You cannot have ABI which has an incompatible implementation. IOW, when implementation contradicts the ABI, something is wrong.

The question of course if read_bool() is here incompatible. From the actual code point of view, it is compatible, but how it is documented and how it is intended to use: it is not compatible.

Also if future schema-kernel-ABI checker gets implemented, the tool might report here a mistake for that reason. read_bool() means property is bool.

Quoted 7 lines
Quoted 5 lines

If the hardware supports wakeup functionality,
referencing the core schema is sufficient. Hardware description should not be constrained by the current driver implementation
( e.g. the use of device_property_read_bool() ).
Bindings should remain stable and generic, while drivers can evolve over time.

So you claim that bindings can define property as integer, but drivers can evolve and for example read it as string?

I see your point regarding the ABI semantics and the intended use of read_bool().
My understanding is that the I2C core currently uses of_property_read_bool() for wakeup-source as a presence check, even though it has no way to determine in advance whether a specific device will define the property as a boolean or a phandle-array in its DTS.

From a behavioral point of view, switching to of_property_present() would not change anything, but it would better reflect that the driver only checks for the existence of the property without assuming its type.

If the expectation is to strictly follow the binding types, then of_property_present()
seems more appropriate here.
I can prepare a patch accordingly and send it to the I2C maintainers for review and feedback.

Quoted 5 lines
Quoted 3 lines

Re-defining the type locally duplicates the core definition. If the core schema evolves,

There is no re-definition here. This is choice of subset of types.

The flow is: core schema → YAML binding (ABI) → DTS (actual usage). From a high-level perspective, the binding may appear to redefine the property type by narrowing its scope, while the DTS selects one valid representation from the permitted set.

Quoted 7 lines

Where is Rob's suggestion to do such cleanups for EXISTING code? I only see that new code should come like that.

Anyway, your commit msg is for me incorrect because it misses all this points I made. Whether the schema code is correct, I'll defer to Rob, although I still claim the same I claimed before at v2 or v3 of your previous work - this should have defined type.

You are right that Rob did not explicitly request cleanups to existing code. I included them to improve consistency while working on the new parts, but for now, I will stop modifying the existing code and wait for Rob's feedback.
Since there are differing perspectives, I would appreciate a consensus on the preferred
approach before I send out the next version to avoid redundant rework.

Best regards,
Phuc

maintainer
#6 lore raw

Re: [PATCH 2/2] ASoC: dt-bindings: drop redundant wakeup-source definitions

Quoted 13 lines · Bui Duc Phuc

Hi,

Quoted 11 lines

Yes. And the ABI. You cannot have ABI which has an incompatible implementation. IOW, when implementation contradicts the ABI, something is wrong.

The question of course if read_bool() is here incompatible. From the actual code point of view, it is compatible, but how it is documented and how it is intended to use: it is not compatible.

Also if future schema-kernel-ABI checker gets implemented, the tool might report here a mistake for that reason. read_bool() means property is bool.

It is doubtful such a tool would do per binding type checking given types are global and we've avoided making types per binding so far.

Quoted 9 lines
Quoted 8 lines
Quoted 6 lines

If the hardware supports wakeup functionality,
referencing the core schema is sufficient. Hardware description should not be constrained by the current driver implementation
( e.g. the use of device_property_read_bool() ).
Bindings should remain stable and generic, while drivers can evolve over time.

So you claim that bindings can define property as integer, but drivers can evolve and for example read it as string?

Quoted 6 lines

I see your point regarding the ABI semantics and the intended use of read_bool().
My understanding is that the I2C core currently uses of_property_read_bool() for wakeup-source as a presence check, even though it has no way to determine in advance whether a specific device will define the property as a boolean or a phandle-array in its DTS.

If this was a problem, then it probably would have been fixed already because it generates a warning. An I2C device probably isn't all that coupled to SoC power states, so boolean is probably always going to be used here. But maybe not.

If we do any cleanup here, I think that should have exactly 1 location that reads this property instead of 77. Perhaps the driver core can just handle everything and drivers don't have to deal with it.

Quoted 29 lines
Quoted 1 line

From a behavioral point of view, switching to of_property_present() would

not change anything, but it would better reflect that the driver only checks for the existence of the property without assuming its type.

If the expectation is to strictly follow the binding types, then of_property_present()
seems more appropriate here.
I can prepare a patch accordingly and send it to the I2C maintainers for review and feedback.

Quoted 5 lines
Quoted 3 lines

Re-defining the type locally duplicates the core definition. If the core schema evolves,

There is no re-definition here. This is choice of subset of types.

The flow is: core schema → YAML binding (ABI) → DTS (actual usage).

Quoted 1 line

From a high-level perspective, the binding may appear to redefine the

property type by narrowing its scope, while the DTS selects one valid representation from the permitted set.

Quoted 7 lines

Where is Rob's suggestion to do such cleanups for EXISTING code? I only see that new code should come like that.

Anyway, your commit msg is for me incorrect because it misses all this points I made. Whether the schema code is correct, I'll defer to Rob, although I still claim the same I claimed before at v2 or v3 of your previous work - this should have defined type.

Quoted 7 lines

You are right that Rob did not explicitly request cleanups to existing code. I included them to improve consistency while working on the new parts, but for now, I will stop modifying the existing code and wait for Rob's feedback.
Since there are differing perspectives, I would appreciate a consensus on the preferred
approach before I send out the next version to avoid redundant rework.

It's really outside the scope of a device binding what is used for wakeup-source as that depends on the platform. So I think just 'wakeup-source: true' in device bindings is fine. I don't think we have to change all the existing cases either, but the patches are already written so I don't have an issue applying them.

Rob

#7 lore raw

Re: [PATCH 2/2] ASoC: dt-bindings: drop redundant wakeup-source definitions

Hi Rob, Krzysztof,

Quoted 10 lines · Rob Herring

If this was a problem, then it probably would have been fixed already because it generates a warning. An I2C device probably isn't all that coupled to SoC power states, so boolean is probably always going to be used here. But maybe not.

If we do any cleanup here, I think that should have exactly 1 location that reads this property instead of 77. Perhaps the driver core can just handle everything and drivers don't have to deal with it.

Yes, the I2C core already handles the 'wakeup-source' property centrally; therefore, individual device drivers do not need to implement their own handling.

While no I2C devices currently utilize the 'phandle-array' type for this property,
we should ensure the infrastructure is future-proof. In cases where a phandle is used,
additional firmware-level handling might be required depending on the SoC architecture,
similar to how the m_can driver operates on TI SoCs.

References for that implementation can be found here:
Firmware: https://elixir.bootlin.com/linux/v7.1-rc2/source/drivers/firmware/ti_sci.c
DTS: https://elixir.bootlin.com/linux/v7.1-rc2/source/arch/arm64/boot/dts/ti/k3-am62a7-sk.dts

To address this and align the code with the core schema, I have previously submitted patches
to transition the I2C core and clean up the m_can driver:

I2C core patch:
https://lore.kernel.org/all/[email protected]/
m_can patch: https://lore.kernel.org/all/[email protected]/

Quoted 5 lines

It's really outside the scope of a device binding what is used for wakeup-source as that depends on the platform. So I think just 'wakeup-source: true' in device bindings is fine. I don't think we have to change all the existing cases either, but the patches are already written so I don't have an issue applying them.

Understood. I will update the commit message wording in the next version.

Best regards,
Phuc