Skip to contentSkip to conversation

poweroff-source DT property renaming

PATCH Superseded Auto Configured 5 participants 17 messages Nov 13, 2014 – Nov 24, 2014

Subsystems (5)

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v4 cover poweroff-source DT property renaming

The goal of this serie is to rename the property "poweroff-source" to "system-power-controller". After discussions, it makes more sense to rename back to the old established property name. This patches serie reverts commit a4b4e0461ec5 ("of: Add standard property for poweroff capability").

Changes since v3:
- Move backward compatibility from of_is_system_power_controller to tps65910, as it was only required for this driver.

Changes since v2:
- of_is_system_power_controller is inline in of.h and only supports backward compatibility with device drivers which used this helper (which is tps65910)
- Quashed all changes into a single patch (except documentation)
- Add a separated commit to fix typos and mispellings in documentation

Changes since v1:

- The first patch defines "of_is_system_power_controller" which is compatible with both "vendor,system-power-controller" and "system-power-controller" properties. Also, It keeps the old helper function of_system_has_poweroff_source for source compatibility until everything is renamed (in this way, bisections are not broken and change is made "atomically" between each commit)

Note: the property "poweroff-source" itself is not used in dts files yet. Before this patch tps65910 was broken due to missing backward compatibility with "vendor,system-power-controller". As the old helper uses the new one, it works again.

- act8865 and tps65910 are ported to the new helper function
- The last commit removes the olf helper which was only used for source compatibility

Romain Perier (2):
of: Rename "poweroff-source" property to "system-power-controller"
dt-bindings: Update documentation for "system-power-controller" and
fix misspellings

 .../devicetree/bindings/power/power-controller.txt     | 18 ++++++++++++++++++
 Documentation/devicetree/bindings/power/poweroff.txt   | 18 ------------------
 .../bindings/regulator/act8865-regulator.txt           |  4 ++--
 drivers/mfd/tps65910.c                                 |  9 ++++++++-
 drivers/regulator/act8865-regulator.c                  |  2 +-
 include/linux/of.h                                     |  6 +++---
 6 files changed, 32 insertions(+), 25 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/power/power-controller.txt
 delete mode 100644 Documentation/devicetree/bindings/power/poweroff.txt
Signature · 1 line
1.9.1
#1 lore raw

PATCH v4 1/2 of: Rename "poweroff-source" property to "system-power-controller"

From: Romain Perier <[email protected]>

It reverts commit a4b4e0461ec5 ("of: Add standard property for poweroff capability"). As discussed on the mailing list, it makes more sense to rename back to the old established property name, without the vendor prefix. Problem being that the word "source" usually tends to be used for inputs and that is out of control of the OS. The poweroff capability is an output which simply turns the system-power off. Also, this property might be used by drivers which power-off the system and power back on subsequent RTC alarms. This seems to suggest to remove "poweroff" from the property name and to choose "system-power-controller" as the more generic name. This patchs adds the required renaming changes and defines an helper function which is compatible with both properties, the old one which was only used by tps65910 and the new one without vendor-prefix.

---
 .../bindings/power/{poweroff.txt => power-controller.txt}        | 0
 .../devicetree/bindings/regulator/act8865-regulator.txt          | 4 ++--
 drivers/mfd/tps65910.c                                           | 9 ++++++++-
 drivers/regulator/act8865-regulator.c                            | 2 +-
 include/linux/of.h                                               | 6 +++---
 5 files changed, 14 insertions(+), 7 deletions(-)
 rename Documentation/devicetree/bindings/power/{poweroff.txt => power-controller.txt} (100%)
Documentation/devicetree/bindings/power/power-controller.txt renamed from Documentation/devicetree/bindings/power/poweroff.txt +0 -0
similarity index 100%
rename from Documentation/devicetree/bindings/power/poweroff.txt
rename to Documentation/devicetree/bindings/power/power-controller.txt
Documentation/devicetree/bindings/regulator/act8865-regulator.txt +2 -2
index 01a5b07..dad6358 100644
@@ -6,8 +6,8 @@ Required properties:
 - reg: I2C slave address
 
 Optional properties:
-- poweroff-source: Telling whether or not this pmic is controlling
-  the system power. See Documentation/devicetree/bindings/power/poweroff.txt .
+- system-power-controller: Telling whether or not this pmic is controlling
+  the system power. See Documentation/devicetree/bindings/power/power-controller.txt .
 
 Any standard regulator properties can be used to configure the single regulator.
 
drivers/mfd/tps65910.c +8 -1
index b8dca8a..3a796a5 100644
@@ -386,6 +386,13 @@ static const struct of_device_id tps65910_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, tps65910_of_match);
 
+static inline bool tps65910_is_pm_off_found(struct device_node *np)
+{
+	if (of_property_read_bool(np, "ti,system-power-controller"))
+		return true;
+	return of_is_system_power_controller(np);
+}
+
 static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client,
 						unsigned long *chip_id)
 {
@@ -423,7 +430,7 @@ static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client,
 
 	board_info->irq = client->irq;
 	board_info->irq_base = -1;
-	board_info->pm_off = of_system_has_poweroff_source(np);
+	board_info->pm_off = tps65910_is_pm_off_found(np);
 
 	return board_info;
 }
drivers/regulator/act8865-regulator.c +1 -1
index 76301ed..435aba1 100644
@@ -365,7 +365,7 @@ static int act8865_pmic_probe(struct i2c_client *client,
 		return ret;
 	}
 
-	if (of_system_has_poweroff_source(dev->of_node)) {
+	if (of_is_system_power_controller(dev->of_node)) {
 		if (!pm_power_off) {
 			act8865_i2c_client = client;
 			act8865->off_reg = off_reg;
include/linux/of.h +3 -3
index d933717..f9541bc 100644
@@ -965,14 +965,14 @@ static inline int of_changeset_update_property(struct of_changeset *ocs,
 extern int of_resolve_phandles(struct device_node *tree);
 
 /**
- * of_system_has_poweroff_source - Tells if poweroff-source is found for device_node
+ * of_is_system_power_controller - Tells if system-power-controller is found for device_node
  * @np: Pointer to the given device_node
  *
  * return true if present false otherwise
  */
-static inline bool of_system_has_poweroff_source(const struct device_node *np)
+static inline bool of_is_system_power_controller(const struct device_node *np)
 {
-	return of_property_read_bool(np, "poweroff-source");
+	return of_property_read_bool(np, "system-power-controller");
 }
 
 #endif /* _LINUX_OF_H */
Signature · 1 line
1.9.1
Acked-by on v4 1/2
#2 lore raw

Re: [PATCH v4 1/2] of: Rename "poweroff-source" property to "system-power-controller"

Quoted 14 lines · Auto Configured

From: Romain Perier <[email protected]>

It reverts commit a4b4e0461ec5 ("of: Add standard property for poweroff capability"). As discussed on the mailing list, it makes more sense to rename back to the old established property name, without the vendor prefix. Problem being that the word "source" usually tends to be used for inputs and that is out of control of the OS. The poweroff capability is an output which simply turns the system-power off. Also, this property might be used by drivers which power-off the system and power back on subsequent RTC alarms. This seems to suggest to remove "poweroff" from the property name and to choose "system-power-controller" as the more generic name. This patchs adds the required renaming changes and defines an helper function which is compatible with both properties, the old one which was only used by tps65910 and the new one without vendor-prefix.

Quoted 1 line

Please merge via whichever tree needs this change.

g.

Quoted 93 lines
---
 .../bindings/power/{poweroff.txt => power-controller.txt}        | 0
 .../devicetree/bindings/regulator/act8865-regulator.txt          | 4 ++--
 drivers/mfd/tps65910.c                                           | 9 ++++++++-
 drivers/regulator/act8865-regulator.c                            | 2 +-
 include/linux/of.h                                               | 6 +++---
 5 files changed, 14 insertions(+), 7 deletions(-)
 rename Documentation/devicetree/bindings/power/{poweroff.txt => power-controller.txt} (100%)
Documentation/devicetree/bindings/power/power-controller.txt renamed from Documentation/devicetree/bindings/power/poweroff.txt +0 -0
similarity index 100%
rename from Documentation/devicetree/bindings/power/poweroff.txt
rename to Documentation/devicetree/bindings/power/power-controller.txt
Documentation/devicetree/bindings/regulator/act8865-regulator.txt +2 -2
index 01a5b07..dad6358 100644
@@ -6,8 +6,8 @@ Required properties:
 - reg: I2C slave address
 
 Optional properties:
-- poweroff-source: Telling whether or not this pmic is controlling
-  the system power. See Documentation/devicetree/bindings/power/poweroff.txt .
+- system-power-controller: Telling whether or not this pmic is controlling
+  the system power. See Documentation/devicetree/bindings/power/power-controller.txt .
 
 Any standard regulator properties can be used to configure the single regulator.
 
drivers/mfd/tps65910.c +8 -1
index b8dca8a..3a796a5 100644
@@ -386,6 +386,13 @@ static const struct of_device_id tps65910_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, tps65910_of_match);
 
+static inline bool tps65910_is_pm_off_found(struct device_node *np)
+{
+	if (of_property_read_bool(np, "ti,system-power-controller"))
+		return true;
+	return of_is_system_power_controller(np);
+}
+
 static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client,
 						unsigned long *chip_id)
 {
@@ -423,7 +430,7 @@ static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client,
 
 	board_info->irq = client->irq;
 	board_info->irq_base = -1;
-	board_info->pm_off = of_system_has_poweroff_source(np);
+	board_info->pm_off = tps65910_is_pm_off_found(np);
 
 	return board_info;
 }
drivers/regulator/act8865-regulator.c +1 -1
index 76301ed..435aba1 100644
@@ -365,7 +365,7 @@ static int act8865_pmic_probe(struct i2c_client *client,
 		return ret;
 	}
 
-	if (of_system_has_poweroff_source(dev->of_node)) {
+	if (of_is_system_power_controller(dev->of_node)) {
 		if (!pm_power_off) {
 			act8865_i2c_client = client;
 			act8865->off_reg = off_reg;
include/linux/of.h +3 -3
index d933717..f9541bc 100644
@@ -965,14 +965,14 @@ static inline int of_changeset_update_property(struct of_changeset *ocs,
 extern int of_resolve_phandles(struct device_node *tree);
 
 /**
- * of_system_has_poweroff_source - Tells if poweroff-source is found for device_node
+ * of_is_system_power_controller - Tells if system-power-controller is found for device_node
  * @np: Pointer to the given device_node
  *
  * return true if present false otherwise
  */
-static inline bool of_system_has_poweroff_source(const struct device_node *np)
+static inline bool of_is_system_power_controller(const struct device_node *np)
 {
-	return of_property_read_bool(np, "poweroff-source");
+	return of_property_read_bool(np, "system-power-controller");
 }
 
 #endif /* _LINUX_OF_H */
Signature · 1 line
1.9.1
#3 lore raw

Re: [PATCH v4 1/2] of: Rename "poweroff-source" property to "system-power-controller"

Hi,

Who should merge this serie ? as Mark merged the previous one it would probably make sense to do the same here (at least, in my opinion)

Thanks for your feedbacks.

Have a nice day,
Romain

2014-11-13 21:55 GMT+01:00 Grant Likely <[email protected]>:

Quoted 6 lines

Please merge via whichever tree needs this change.

g.

#4 lore raw

Re: [PATCH v4 1/2] of: Rename "poweroff-source" property to "system-power-controller"

@Most of the people who were ranting about this serie: could you send feedbacks please ?

2014-11-14 8:22 GMT+01:00 Romain Perier <[email protected]>:

Quoted 18 lines

Hi,

Who should merge this serie ? as Mark merged the previous one it would probably make sense to do the same here (at least, in my opinion)

Thanks for your feedbacks.

Have a nice day,
Romain

2014-11-13 21:55 GMT+01:00 Grant Likely <[email protected]>:

Quoted 6 lines

Please merge via whichever tree needs this change.

g.

#5 lore raw

Re: [PATCH v4 1/2] of: Rename "poweroff-source" property to "system-power-controller"

ping

2014-11-17 11:51 GMT+01:00 Romain Perier <[email protected]>:

Quoted 22 lines

@Most of the people who were ranting about this serie: could you send feedbacks please ?

2014-11-14 8:22 GMT+01:00 Romain Perier <[email protected]>:

Quoted 18 lines

Hi,

Who should merge this serie ? as Mark merged the previous one it would probably make sense to do the same here (at least, in my opinion)

Thanks for your feedbacks.

Have a nice day,
Romain

2014-11-13 21:55 GMT+01:00 Grant Likely <[email protected]>:

Quoted 6 lines

Please merge via whichever tree needs this change.

g.

#6 lore raw

Re: [PATCH v4 1/2] of: Rename "poweroff-source" property to "system-power-controller"

In reply to Auto Configured
Quoted 13 lines · Auto Configured

From: Romain Perier <[email protected]>

It reverts commit a4b4e0461ec5 ("of: Add standard property for poweroff capability"). As discussed on the mailing list, it makes more sense to rename back to the old established property name, without the vendor prefix. Problem being that the word "source" usually tends to be used for inputs and that is out of control of the OS. The poweroff capability is an output which simply turns the system-power off. Also, this property might be used by drivers which power-off the system and power back on subsequent RTC alarms. This seems to suggest to remove "poweroff" from the property name and to choose "system-power-controller" as the more generic name. This patchs adds the required renaming changes and defines an helper function which is compatible with both properties, the old one which was only used by tps65910 and the new one without vendor-prefix.

Now this is a bit of a mess.

There's a commit in the mfd tree, 25f833c1171d ("mfd: tps65910: Convert ti,system-power-controller DT property to poweroff-source"), which breaks all dts using tps65910 since these are never updated to the now retracted property name ("poweroff-source").

This one should simply be reverted ASAP.

Quoted 8 lines
---
 .../bindings/power/{poweroff.txt => power-controller.txt}        | 0
 .../devicetree/bindings/regulator/act8865-regulator.txt          | 4 ++--
 drivers/mfd/tps65910.c                                           | 9 ++++++++-
 drivers/regulator/act8865-regulator.c                            | 2 +-
 include/linux/of.h                                               | 6 +++---
 5 files changed, 14 insertions(+), 7 deletions(-)

Romain, what tree is this patch against? The changes to the tps65910 driver appears not to even be in the regulator tree, yet you asked Mark to merge this. And the MFD maintainer is not even on CC.

Let's fix the breakage by reverting the offending commit in mfd. Then the new standard name can be introduced in regulator alone (e.g. this patch without the tps65910 bits) as nothing outside of regulator should be using the new power-off feature (or binding) for act8865. Then other drivers and dts can be converted to use the new property name (while retaining backwards compatibility) for 3.20.

[ We should probably also consider adding an "of_device_is_" prefix to the helper name for consistency. ]

Johan

#7 lore raw

PATCH 1/1 Revert "mfd: tps65910: Convert ti,system-power-controller DT property to poweroff-source"

This reverts commit 25f833c1171d ("mfd: tps65910: Convert ti,system-power-controller DT property to poweroff-source"), which switched to a new device-tree property name for configuring the device as a power-off controller, but failed to update the affected device-tree sources and neither provided backward compatibility with the old property name.

This fixes broken power-off functionality for all boards relying on tps65910 to power off the system.

---
 drivers/mfd/tps65910.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mfd/tps65910.c +2 -1
index b8dca8a0db41..7612d89850dd 100644
@@ -423,7 +423,8 @@ static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client,
 
 	board_info->irq = client->irq;
 	board_info->irq_base = -1;
-	board_info->pm_off = of_system_has_poweroff_source(np);
+	board_info->pm_off = of_property_read_bool(np,
+			"ti,system-power-controller");
 
 	return board_info;
 }
Signature · 1 line
2.0.4
#8 lore raw

Re: [PATCH v4 1/2] of: Rename "poweroff-source" property to "system-power-controller"

In reply to Johan Hovold

2014-11-21 11:59 GMT+01:00 Johan Hovold <[email protected]>:

Quoted 15 lines · Auto Configured
Quoted 13 lines

From: Romain Perier <[email protected]>

It reverts commit a4b4e0461ec5 ("of: Add standard property for poweroff capability"). As discussed on the mailing list, it makes more sense to rename back to the old established property name, without the vendor prefix. Problem being that the word "source" usually tends to be used for inputs and that is out of control of the OS. The poweroff capability is an output which simply turns the system-power off. Also, this property might be used by drivers which power-off the system and power back on subsequent RTC alarms. This seems to suggest to remove "poweroff" from the property name and to choose "system-power-controller" as the more generic name. This patchs adds the required renaming changes and defines an helper function which is compatible with both properties, the old one which was only used by tps65910 and the new one without vendor-prefix.

Quoted 6 lines

Now this is a bit of a mess.

There's a commit in the mfd tree, 25f833c1171d ("mfd: tps65910: Convert ti,system-power-controller DT property to poweroff-source"), which breaks all dts using tps65910 since these are never updated to the now retracted property name ("poweroff-source").

No seriously ? yes, this is why I ask for feedbacks since 3 weeks... ^^

Quoted 12 lines

This one should simply be reverted ASAP.

Quoted 8 lines
---
 .../bindings/power/{poweroff.txt => power-controller.txt}        | 0
 .../devicetree/bindings/regulator/act8865-regulator.txt          | 4 ++--
 drivers/mfd/tps65910.c                                           | 9 ++++++++-
 drivers/regulator/act8865-regulator.c                            | 2 +-
 include/linux/of.h                                               | 6 +++---
 5 files changed, 14 insertions(+), 7 deletions(-)
Quoted 3 lines

Romain, what tree is this patch against? The changes to the tps65910 driver appears not to even be in the regulator tree, yet you asked Mark to merge this. And the MFD maintainer is not even on CC.

I work with linux-next, this patch is present in that tree. If I remember correctly, it was merged by Lee Jones (so it was merged onto the mfd tree)

Quoted 8 lines

Let's fix the breakage by reverting the offending commit in mfd. Then the new standard name can be introduced in regulator alone (e.g. this patch without the tps65910 bits) as nothing outside of regulator should be using the new power-off feature (or binding) for act8865. Then other drivers and dts can be converted to use the new property name (while retaining backwards compatibility) for 3.20.

Quoted 4 lines

[ We should probably also consider adding an "of_device_is_" prefix to the helper name for consistency. ]

Johan

Maintainers, Mark, Grant, Lee, what do you think ?

Thanks,
Romain

#9 lore raw

Re: [PATCH v4 1/2] of: Rename "poweroff-source" property to "system-power-controller"

2014-11-21 14:18 GMT+01:00 Romain Perier <[email protected]>:

Quoted 2 lines

it was merged by Lee Jones (so it was merged onto
the mfd tree)

It was done, for a previous serie, not this one . This is when I proposed to update the dts too (for all boards using the custom property) until the discussion turned into a troll.

Romain

#10 lore raw

Re: [PATCH v4 1/2] of: Rename "poweroff-source" property to "system-power-controller"

In reply to Johan Hovold
Quoted 15 lines · Johan Hovold
Quoted 13 lines · Auto Configured

From: Romain Perier <[email protected]>

It reverts commit a4b4e0461ec5 ("of: Add standard property for poweroff capability"). As discussed on the mailing list, it makes more sense to rename back to the old established property name, without the vendor prefix. Problem being that the word "source" usually tends to be used for inputs and that is out of control of the OS. The poweroff capability is an output which simply turns the system-power off. Also, this property might be used by drivers which power-off the system and power back on subsequent RTC alarms. This seems to suggest to remove "poweroff" from the property name and to choose "system-power-controller" as the more generic name. This patchs adds the required renaming changes and defines an helper function which is compatible with both properties, the old one which was only used by tps65910 and the new one without vendor-prefix.

Quoted 6 lines

Now this is a bit of a mess.

There's a commit in the mfd tree, 25f833c1171d ("mfd: tps65910: Convert ti,system-power-controller DT property to poweroff-source"), which breaks all dts using tps65910 since these are never updated to the now retracted property name ("poweroff-source").

My word!

Romain, what conversation on the MLs are you talking about?

Quoted 1 line

This one should simply be reverted ASAP.

No need to revert, I can just remove the patch from the MFD tree.

Quoted 24 lines
Quoted 8 lines
---
 .../bindings/power/{poweroff.txt => power-controller.txt}        | 0
 .../devicetree/bindings/regulator/act8865-regulator.txt          | 4 ++--
 drivers/mfd/tps65910.c                                           | 9 ++++++++-
 drivers/regulator/act8865-regulator.c                            | 2 +-
 include/linux/of.h                                               | 6 +++---
 5 files changed, 14 insertions(+), 7 deletions(-)

Romain, what tree is this patch against? The changes to the tps65910 driver appears not to even be in the regulator tree, yet you asked Mark to merge this. And the MFD maintainer is not even on CC.

Let's fix the breakage by reverting the offending commit in mfd. Then the new standard name can be introduced in regulator alone (e.g. this patch without the tps65910 bits) as nothing outside of regulator should be using the new power-off feature (or binding) for act8865. Then other drivers and dts can be converted to use the new property name (while retaining backwards compatibility) for 3.20.

[ We should probably also consider adding an "of_device_is_" prefix to the helper name for consistency. ]

Johan

Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#11 lore raw

Re: [PATCH v4 1/2] of: Rename "poweroff-source" property to "system-power-controller"

Quoted 18 lines · Lee Jones
Quoted 17 lines · Johan Hovold
Quoted 13 lines · Auto Configured

From: Romain Perier <[email protected]>

It reverts commit a4b4e0461ec5 ("of: Add standard property for poweroff capability"). As discussed on the mailing list, it makes more sense to rename back to the old established property name, without the vendor prefix. Problem being that the word "source" usually tends to be used for inputs and that is out of control of the OS. The poweroff capability is an output which simply turns the system-power off. Also, this property might be used by drivers which power-off the system and power back on subsequent RTC alarms. This seems to suggest to remove "poweroff" from the property name and to choose "system-power-controller" as the more generic name. This patchs adds the required renaming changes and defines an helper function which is compatible with both properties, the old one which was only used by tps65910 and the new one without vendor-prefix.

Now this is a bit of a mess.

Quoted 8 lines
Quoted 4 lines

There's a commit in the mfd tree, 25f833c1171d ("mfd: tps65910: Convert ti,system-power-controller DT property to poweroff-source"), which breaks all dts using tps65910 since these are never updated to the now retracted property name ("poweroff-source").

My word!

Romain, what conversation on the MLs are you talking about?

I think Romain is referring to this thread:

	https://lkml.org/lkml/2014/10/23/161
Quoted 3 lines
Quoted 1 line

This one should simply be reverted ASAP.

No need to revert, I can just remove the patch from the MFD tree.

Ok, good. Then this is limited to the regulator tree, and we could proceed as I outlined below.

Quoted 20 lines
Quoted 20 lines
Quoted 8 lines
---
 .../bindings/power/{poweroff.txt => power-controller.txt}        | 0
 .../devicetree/bindings/regulator/act8865-regulator.txt          | 4 ++--
 drivers/mfd/tps65910.c                                           | 9 ++++++++-
 drivers/regulator/act8865-regulator.c                            | 2 +-
 include/linux/of.h                                               | 6 +++---
 5 files changed, 14 insertions(+), 7 deletions(-)

Romain, what tree is this patch against? The changes to the tps65910 driver appears not to even be in the regulator tree, yet you asked Mark to merge this. And the MFD maintainer is not even on CC.

Let's fix the breakage by reverting the offending commit in mfd. Then the new standard name can be introduced in regulator alone (e.g. this patch without the tps65910 bits) as nothing outside of regulator should be using the new power-off feature (or binding) for act8865. Then other drivers and dts can be converted to use the new property name (while retaining backwards compatibility) for 3.20.

Quoted 2 lines
Quoted 2 lines

[ We should probably also consider adding an "of_device_is_" prefix to the helper name for consistency. ]

Romain, care to resend this patch without the tps65910 chunks?

You should also fix the commit message, which claims to define a "helper function which is compatible with both properties", something which was no longer the case.

Thanks,
Johan

#12 lore raw

Re: [PATCH v4 1/2] of: Rename "poweroff-source" property to "system-power-controller"

2014-11-24 12:35 GMT+01:00 Johan Hovold <[email protected]>:

Quoted 24 lines · Lee Jones
Quoted 23 lines · Johan Hovold
Quoted 21 lines · Auto Configured
Quoted 13 lines

From: Romain Perier <[email protected]>

It reverts commit a4b4e0461ec5 ("of: Add standard property for poweroff capability"). As discussed on the mailing list, it makes more sense to rename back to the old established property name, without the vendor prefix. Problem being that the word "source" usually tends to be used for inputs and that is out of control of the OS. The poweroff capability is an output which simply turns the system-power off. Also, this property might be used by drivers which power-off the system and power back on subsequent RTC alarms. This seems to suggest to remove "poweroff" from the property name and to choose "system-power-controller" as the more generic name. This patchs adds the required renaming changes and defines an helper function which is compatible with both properties, the old one which was only used by tps65910 and the new one without vendor-prefix.

Now this is a bit of a mess.

There's a commit in the mfd tree, 25f833c1171d ("mfd: tps65910: Convert ti,system-power-controller DT property to poweroff-source"), which breaks all dts using tps65910 since these are never updated to the now retracted property name ("poweroff-source").

Quoted 7 lines
Quoted 3 lines

My word!

Romain, what conversation on the MLs are you talking about?

I think Romain is referring to this thread:

        https://lkml.org/lkml/2014/10/23/161

Yes, this is this one.

Quoted 10 lines
Quoted 4 lines
Quoted 2 lines

This one should simply be reverted ASAP.

No need to revert, I can just remove the patch from the MFD tree.

Ok, good. Then this is limited to the regulator tree, and we could proceed as I outlined below.

Romain, care to resend this patch without the tps65910 chunks?

If you can just drop the patch from mfd tree Lee, please do. Yes Johan, np, what I want is that we find a smart solution, nothing more.

Quoted 7 lines

You should also fix the commit message, which claims to define a "helper function which is compatible with both properties", something which was no longer the case.

Thanks,
Johan

So I need to resend this patch which would only introduce an helper function which checks for "system-power-controller" property (it would also have a new commit message).
As you suggested, this helper might be named "of_device_is_system_power_controller" ?

Everything is okay ?

Romain

#13 lore raw

Re: [PATCH v4 1/2] of: Rename "poweroff-source" property to "system-power-controller"

2014-11-24 13:58 GMT+01:00 Romain Perier <[email protected]>:

Quoted 54 lines

2014-11-24 12:35 GMT+01:00 Johan Hovold <[email protected]>:

Quoted 24 lines · Lee Jones
Quoted 23 lines · Johan Hovold
Quoted 21 lines · Auto Configured
Quoted 13 lines

From: Romain Perier <[email protected]>

It reverts commit a4b4e0461ec5 ("of: Add standard property for poweroff capability"). As discussed on the mailing list, it makes more sense to rename back to the old established property name, without the vendor prefix. Problem being that the word "source" usually tends to be used for inputs and that is out of control of the OS. The poweroff capability is an output which simply turns the system-power off. Also, this property might be used by drivers which power-off the system and power back on subsequent RTC alarms. This seems to suggest to remove "poweroff" from the property name and to choose "system-power-controller" as the more generic name. This patchs adds the required renaming changes and defines an helper function which is compatible with both properties, the old one which was only used by tps65910 and the new one without vendor-prefix.

Now this is a bit of a mess.

There's a commit in the mfd tree, 25f833c1171d ("mfd: tps65910: Convert ti,system-power-controller DT property to poweroff-source"), which breaks all dts using tps65910 since these are never updated to the now retracted property name ("poweroff-source").

Quoted 7 lines
Quoted 3 lines

My word!

Romain, what conversation on the MLs are you talking about?

I think Romain is referring to this thread:

        https://lkml.org/lkml/2014/10/23/161

Yes, this is this one.

Quoted 10 lines
Quoted 4 lines
Quoted 2 lines

This one should simply be reverted ASAP.

No need to revert, I can just remove the patch from the MFD tree.

Ok, good. Then this is limited to the regulator tree, and we could proceed as I outlined below.

Romain, care to resend this patch without the tps65910 chunks?

If you can just drop the patch from mfd tree Lee, please do. Yes Johan, np, what I want is that we find a smart solution, nothing more.

Quoted 5 lines

You should also fix the commit message, which claims to define a "helper function which is compatible with both properties", something which was no longer the case.

Quoted 8 lines
Quoted 2 lines

Thanks,
Johan

So I need to resend this patch which would only introduce an helper function which checks for "system-power-controller" property (it would also have a new commit message).
As you suggested, this helper might be named "of_device_is_system_power_controller" ?

I mean, the backward compatibility can be handled directly from the device driver which would use the new property, no ?

#14 lore raw

Re: [PATCH v4 1/2] of: Rename "poweroff-source" property to "system-power-controller"

Am Montag, 24. November 2014, 14:01:02 schrieb Romain Perier:

Quoted 9 lines

2014-11-24 13:58 GMT+01:00 Romain Perier <[email protected]>:

Quoted 5 lines

So I need to resend this patch which would only introduce an helper function which checks for "system-power-controller" property (it would also have a new commit message).
As you suggested, this helper might be named "of_device_is_system_power_controller" ?

I mean, the backward compatibility can be handled directly from the device driver which would use the new property, no ?

yep, that is what Grant asked for ... to have drivers that need backward- compatibility (like with the "ti,"-prefix) to do this themselfs.

Heiko

#15 lore raw

Re: [PATCH v4 1/2] of: Rename "poweroff-source" property to "system-power-controller"

In reply to Romain Perier
Quoted 11 lines · Romain Perier

2014-11-24 12:35 GMT+01:00 Johan Hovold <[email protected]>:

Quoted 4 lines

You should also fix the commit message, which claims to define a "helper function which is compatible with both properties", something which was no longer the case.

So I need to resend this patch which would only introduce an helper function which checks for "system-power-controller" property (it would also have a new commit message).
As you suggested, this helper might be named "of_device_is_system_power_controller" ?

Correct. Rename the helper and property name you introduced to "of_device_is_system_power_controller" and "system-power-controller" and update the act8865 driver to use the new names (all in one patch).

Send the patch to Mark (and keep everyone else one CC) so he can apply it to the regulator tree.

Other drivers that are currently using "ti,system-power-controller" can continue to do so (for backward compatibility), while we later also add a call to your helper function (and update binding documentation) and also update the device trees for boards that use this functionality.

Thanks,
Johan

#16 lore raw

PATCH v4 2/2 dt-bindings: Update documentation for "system-power-controller" and fix misspellings

In reply to Auto Configured

From: Romain Perier <[email protected]>

---
 .../devicetree/bindings/power/power-controller.txt   | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
Documentation/devicetree/bindings/power/power-controller.txt +10 -10
index 845868b..9afa847 100644
@@ -1,18 +1,18 @@
-* Generic Poweroff capability
+* Generic system power control capability
 
-Power-management integrated circuits or miscellaneous harware components are
-sometimes able to control the system power. The device driver associated to these
-components might needs to define poweroff capability, which tells to the kernel
-how to switch off the system. The corresponding driver must have the standard
-property "poweroff-source" in its device node. This property marks the device as
-able to shutdown the system. In order to test if this property is found
-programmatically, use the helper function "of_system_has_poweroff_source" from
-of.h .
+Power-management integrated circuits or miscellaneous hardware components are
+sometimes able to control the system power. The device driver associated with these
+components might need to define this capability, which tells the kernel that
+it can be used to switch off the system. The corresponding device must have the
+standard property "system-power-controller" in its device node. This property
+marks the device as able to control the system power. In order to test if this
+property is found programmatically, use the helper function
+"of_is_system_power_controller" from of.h .
 
 Example:
 
 act8846: act8846@5 {
 	 compatible = "active-semi,act8846";
 	 status = "okay";
-	 poweroff-source;
+	 system-power-controller;
 }
Signature · 1 line
1.9.1