of: Rename "poweroff-source" property to "system-power-controller"
Subsystems (6)
PATCH 1/10 of: Rename "poweroff-source" property to "system-power-controller"
As discussed on the mailing list, it makes more sense to rename this property to "system-power-controller". 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 prefixed by a vendor name and the new one without any prefix.
--- include/linux/of.h | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-)
include/linux/of.h +23 -4
@@ -867,14 +867,33 @@ 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 the property for controlling system +* power is found in 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) -{ -return of_property_read_bool (np,"poweroff-source" ); +static inline bool of_is_system_power_controller (const struct device_node *np) +{ +struct property *pp; +unsigned long flags; +char *sep; +bool found = false; + +raw_spin_lock_irqsave (&devtree_lock, flags); +for_each_property_of_node (np, pp) { +if (of_prop_cmp (pp->name,"system-power-controller" ) ==0 ) { + found = true; +break ; + } + sep =strchr (pp->name,',' ); +if (sep && sep - pp->name &&of_prop_cmp (sep +1 ,"system-power-controller" ) ==0 ) { + found = true; +break ; + } + } +raw_spin_unlock_irqrestore (&devtree_lock, flags); +return found; }#endif /* _LINUX_OF_H */
Signature · 1 line
1.9.1
PATCH 2/10 dt-bindings: Document the standard property "system-power-controller"
This simply renames the previous documentation to something more generic and adds updates according to last changes.
--- .../devicetree/bindings/power/power-controller.txt | 18 ++++++++++++++++++ Documentation/devicetree/bindings/power/poweroff.txt | 18 ------------------ 2 files changed, 18 insertions(+), 18 deletions(-) create mode 100644 Documentation/devicetree/bindings/power/power-controller.txt delete mode 100644 Documentation/devicetree/bindings/power/poweroff.txt
Documentation/devicetree/bindings/power/power-controller.txt new file +18 -0
@@ -0,0 +1,18 @@ +* 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 this capability, which tells to the kernel +how to switch off the system. The corresponding driver must have the standard +property "system-power-controller" in its device node. This property marks the device as +able to controller 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"; + system-power-controller; +}
Documentation/devicetree/bindings/power/poweroff.txt deleted +0 -18
@@ -1,18 +0,0 @@ -* Generic Poweroff 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 . - -Example: - -act8846: act8846@5 { - compatible = "active-semi,act8846"; - status = "okay"; - poweroff-source; -}
Signature · 1 line
1.9.1
Re: [PATCH v1 02/10] dt-bindings: Document the standard property "system-power-controller"
Quoted 25 lines · Romain Perier
This simply renames the previous documentation to something more generic and adds updates according to last changes.
Signed-off-by Romain Perier <[email protected]>--- .../devicetree/bindings/power/power-controller.txt | 18 ++++++++++++++++++ Documentation/devicetree/bindings/power/poweroff.txt | 18 ------------------ 2 files changed, 18 insertions(+), 18 deletions(-) create mode 100644 Documentation/devicetree/bindings/power/power-controller.txt delete mode 100644 Documentation/devicetree/bindings/power/poweroff.txtDocumentation/devicetree/bindings/power/power-controller.txt new file +8
-0@@ -0,0 +1,18 @@ +* 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 this capability, which tells to the kernel +how to switch off the system. The corresponding driver must have the standard +property "system-power-controller" in its device node. This property marks the device as +able to controller the system-power. In order to test if this property is found
Documentation/devicetree/bindings/power/power-controller.txt line 18
Quoted 10 lines
Documentation/devicetree/bindings/power/power-controller.txt new file +10
-0+programmatically, use the helper function "of_is_system_power_controller" from +of.h . + +Example: + +act8846: act8846 at 5 { + compatible = "active-semi,act8846"; + status = "okay"; + system-power-controller; +}
there is no mention here that system-power-controller superseeds poweroff-source and deprecates that.
Signature · 8 lines
balbi -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141027/660b5436/attachment-0001.sig>
Mark Brown
maintainerRe: [PATCH v1 02/10] dt-bindings: Document the standard property "system-power-controller"
Quoted 10 lines · Felipe Balbi
Documentation/devicetree/bindings/power/power-controller.txt line 18
Quoted 5 lines · Romain Perier
Documentation/devicetree/bindings/power/power-controller.txt new file +5
-0+act8846: act8846 at 5 { + compatible = "active-semi,act8846"; + status = "okay"; + system-power-controller; +}there is no mention here that system-power-controller superseeds poweroff-source and deprecates that.
Given that poweroff-source hasn't made it into a released kernel yet we
can probably just kill it off completely can't we?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141027/fdc56111/attachment.sig>
Re: [PATCH v1 02/10] dt-bindings: Document the standard property "system-power-controller"
Quoted 12 lines · Mark Brown
Quoted 10 lines · Felipe Balbi
Documentation/devicetree/bindings/power/power-controller.txt line 18
Quoted 5 lines · Romain Perier
Documentation/devicetree/bindings/power/power-controller.txt new file +5
-0+act8846: act8846 at 5 { + compatible = "active-semi,act8846"; + status = "okay"; + system-power-controller; +}there is no mention here that system-power-controller superseeds poweroff-source and deprecates that.
Quoted 2 lines
Given that poweroff-source hasn't made it into a released kernel yet we can probably just kill it off completely can't we?
please do, then we will never have that commit in Linus' tree to give us nightmares.
Signature · 8 lines
balbi -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141027/39c95de0/attachment.sig>
Mark Brown
maintainerRe: [PATCH v1 02/10] dt-bindings: Document the standard property "system-power-controller"
Quoted 7 lines · Felipe Balbi
Quoted 2 lines · Mark Brown
Given that poweroff-source hasn't made it into a released kernel yet we can probably just kill it off completely can't we?
please do, then we will never have that commit in Linus' tree to give us nightmares.
Well, the commit isn't a particularly big deal (and got cross-merged
into another tree already) - if it's convenient to rebase it out we
probably should but it's also not the end of the world either so long as
it doesn't appear in a release. Worst case people adopt it based on the
list discussions and we check for two properties which also isn't that
bad.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141027/7034db18/attachment.sig>
Re: [PATCH v1 02/10] dt-bindings: Document the standard property "system-power-controller"
If this is possible, that's probably better to drop all these patches (including poweroff-source) from "next", in this way it will be possible to re-do things properly from scratch (with the new name).
If you have a look at linux-next the property "poweroff-source" is already used by tps910 AND act8865, I don't like that (it is not used yet by dts files). I mean, I don't really want to support "vendor,system-power-controller", "system-power-controller" and "poweroff-source" from "of_has_system_power_source" and do a lot of unclean commits in order to don't break compatibility. Just keep things simple.
What do you think ?
2014-10-27 18:57 GMT+01:00 Mark Brown <[email protected]>:
Quoted 15 lines · Felipe Balbi
Quoted 7 lines · Mark Brown
Quoted 3 lines
Given that poweroff-source hasn't made it into a released kernel yet we can probably just kill it off completely can't we?
please do, then we will never have that commit in Linus' tree to give us nightmares.
Well, the commit isn't a particularly big deal (and got cross-merged into another tree already) - if it's convenient to rebase it out we probably should but it's also not the end of the world either so long as it doesn't appear in a release. Worst case people adopt it based on the list discussions and we check for two properties which also isn't that bad.
PATCH v2 4/10 ARM: dts: rockchip: Enable power off in pmic for Radxa Rock
In reply to Romain PerierAdd "system-power-controller" property to act8846 node. poweroff command is now handled for this board.
--- arch/arm/boot/dts/rk3188-radxarock.dts | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/boot/dts/rk3188-radxarock.dts +2 -0
@@ -141,6 +141,8 @@ pinctrl-names = "default"; pinctrl-0 = <&act8846_dvs0_ctl>; + system-power-controller; + regulators { vcc_ddr: REG1 { regulator-name = "VCC_DDR";
Signature · 1 line
1.9.1
PATCH v2 6/10 mfd: tps65910: Use the standard DT property system-power-controller
In reply to Romain PerierNo longer use custom property to define poweroff capability, use the standard DT property instead.
--- drivers/mfd/tps65910.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mfd/tps65910.c +1 -2
@@ -423,8 +423,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_property_read_bool (np, -"ti,system-power-controller" ); + board_info->pm_off =of_is_system_power_controller ();return board_info; }
Signature · 1 line
1.9.1
Re: [PATCH v2 06/10] mfd: tps65910: Use the standard DT property system-power-controller
Am Montag, den 27.10.2014, 16:26 +0000 schrieb Romain Perier:
Quoted 13 lines
No longer use custom property to define poweroff capability, use the standard DT property instead.
Signed-off-by Romain Perier <[email protected]>--- drivers/mfd/tps65910.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/mfd/tps65910.c +0
-0
drivers/mfd/tps65910.c static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client, · line 429
Quoted 9 lines
drivers/mfd/tps65910.c +1
-2@@ -423,8 +423,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_property_read_bool (np, -"ti,system-power-controller" ); + board_info->pm_off =of_is_system_power_controller ();return board_info; }
You are breaking compatibility with older DTs here. This is not acceptable.
You may change all in-tree DTs to use the new property and also patch the driver to understand it, but you must make sure that the driver still understands the old, custom property. And especially in this case it isn't really hard to do.
Regards,
Lucas
Signature · 2 lines
Pengutronix e.K. | Lucas Stach | Industrial Linux Solutions | http://www.pengutronix.de/ |
Re: [PATCH v2 06/10] mfd: tps65910: Use the standard DT property system-power-controller
Quoted 26 lines · Lucas Stach
Am Montag, den 27.10.2014, 16:26 +0000 schrieb Romain Perier:
Quoted 13 lines
No longer use custom property to define poweroff capability, use the standard DT property instead.
Signed-off-by Romain Perier <[email protected]>--- drivers/mfd/tps65910.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/mfd/tps65910.c +0
-0drivers/mfd/tps65910.c static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client, · line 429
Quoted 9 lines
drivers/mfd/tps65910.c +1
-2@@ -423,8 +423,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_property_read_bool (np, -"ti,system-power-controller" ); + board_info->pm_off =of_is_system_power_controller ();return board_info; }You are breaking compatibility with older DTs here. This is not acceptable.
Quoted 4 lines
You may change all in-tree DTs to use the new property and also patch the driver to understand it, but you must make sure that the driver still understands the old, custom property. And especially in this case it isn't really hard to do.
correct, it should be simple to hide that underof_is_system_power_controller() itself.
Signature · 8 lines
balbi -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141027/67e9648b/attachment.sig>
Re: [PATCH v2 06/10] mfd: tps65910: Use the standard DT property system-power-controller
Quoted 27 lines · Felipe Balbi
Quoted 26 lines · Lucas Stach
Am Montag, den 27.10.2014, 16:26 +0000 schrieb Romain Perier:
Quoted 13 lines
No longer use custom property to define poweroff capability, use the standard DT property instead.
Signed-off-by Romain Perier <[email protected]>--- drivers/mfd/tps65910.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/mfd/tps65910.c +0
-0drivers/mfd/tps65910.c static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client, · line 429
Quoted 9 lines
drivers/mfd/tps65910.c +1
-2@@ -423,8 +423,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_property_read_bool (np, -"ti,system-power-controller" ); + board_info->pm_off =of_is_system_power_controller ();return board_info; }You are breaking compatibility with older DTs here. This is not acceptable.
Quoted 7 lines
Quoted 4 lines
You may change all in-tree DTs to use the new property and also patch the driver to understand it, but you must make sure that the driver still understands the old, custom property. And especially in this case it isn't really hard to do.
correct, it should be simple to hide that under
of_is_system_power_controller()itself.
Guys, take a look at the code (PATCH 1/10). ;)
Johan
Re: [PATCH v2 06/10] mfd: tps65910: Use the standard DT property system-power-controller
Please take a look at "PATCH v1 1/10" of this serie, read it carefully... it's already handled ^^
2014-10-27 17:43 GMT+01:00 Johan Hovold <[email protected]>:
Quoted 39 lines · Felipe Balbi
Quoted 27 lines · Lucas Stach
Quoted 26 lines
Am Montag, den 27.10.2014, 16:26 +0000 schrieb Romain Perier:
Quoted 13 lines
No longer use custom property to define poweroff capability, use the standard DT property instead.
Signed-off-by Romain Perier <[email protected]>--- drivers/mfd/tps65910.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/mfd/tps65910.c +0
-0drivers/mfd/tps65910.c static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client, · line 429
Quoted 9 lines
drivers/mfd/tps65910.c +1
-2@@ -423,8 +423,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_property_read_bool (np, -"ti,system-power-controller" ); + board_info->pm_off =of_is_system_power_controller ();return board_info; }You are breaking compatibility with older DTs here. This is not acceptable.
Quoted 7 lines
Quoted 4 lines
You may change all in-tree DTs to use the new property and also patch the driver to understand it, but you must make sure that the driver still understands the old, custom property. And especially in this case it isn't really hard to do.
correct, it should be simple to hide that under
of_is_system_power_controller()itself.Guys, take a look at the code (PATCH 1/10). ;)
Johan
Re: [PATCH v2 06/10] mfd: tps65910: Use the standard DT property system-power-controller
In reply to Felipe BalbiAm Montag, 27. Oktober 2014, 11:41:53 schrieb Felipe Balbi:
Quoted 31 lines · Lucas Stach
Quoted 30 lines
Am Montag, den 27.10.2014, 16:26 +0000 schrieb Romain Perier:
Quoted 24 lines
No longer use custom property to define poweroff capability, use the standard DT property instead.
Signed-off-by Romain Perier <[email protected]>---
drivers/mfd/tps65910.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/mfd/tps65910.c +1
-2@@ -423,8 +423,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_property_read_bool (np, - "ti,system-power-controller"); + board_info->pm_off = of_is_system_power_controller();return board_info;Quoted 1 line
}
You are breaking compatibility with older DTs here. This is not acceptable.
Quoted 7 lines
Quoted 4 lines
You may change all in-tree DTs to use the new property and also patch the driver to understand it, but you must make sure that the driver still understands the old, custom property. And especially in this case it isn't really hard to do.
correct, it should be simple to hide that under
of_is_system_power_controller()itself.
If I'm reading patch 1 correctly, it already does handle the generic "system- power-controller", as well as any foo,system-power-controller properties.
Heiko
Re: [PATCH v2 06/10] mfd: tps65910: Use the standard DT property system-power-controller
Quoted 37 lines · Heiko St?bner
Am Montag, 27. Oktober 2014, 11:41:53 schrieb Felipe Balbi:
Quoted 36 lines · Lucas Stach
Quoted 34 lines
Am Montag, den 27.10.2014, 16:26 +0000 schrieb Romain Perier:
Quoted 24 lines
No longer use custom property to define poweroff capability, use the standard DT property instead.
Signed-off-by Romain Perier <[email protected]>---
drivers/mfd/tps65910.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/mfd/tps65910.c +1
-2@@ -423,8 +423,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_property_read_bool (np, - "ti,system-power-controller"); + board_info->pm_off = of_is_system_power_controller();return board_info;Quoted 1 line
}
You are breaking compatibility with older DTs here. This is not acceptable.
You may change all in-tree DTs to use the new property and also patch the driver to understand it, but you must make sure that the driver still understands the old, custom property. And especially in this case it isn't really hard to do.
Quoted 5 lines
Quoted 2 lines
correct, it should be simple to hide that under
of_is_system_power_controller()itself.If I'm reading patch 1 correctly, it already does handle the generic "system- power-controller", as well as any foo,system-power-controller properties.
that's very true, but it doesn't handle poweroff-source which, one way or another, will be merged into Linus' tree creating a bisection point where things won't work.
The best solution would be for those patches to be removed from whichever tree they are, otherwise there will always be a commit in the mainline kernel with that binding and, even if unlikely, there will always be the possibility of people using that commit or a developer having to bisect an issue only to find a few commits where things don't even build.
Signature · 8 lines
balbi -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141027/baac9f77/attachment.sig>
Re: [PATCH v2 06/10] mfd: tps65910: Use the standard DT property system-power-controller
In reply to Romain PerierQuoted 13 lines · Romain Perier
No longer use custom property to define poweroff capability, use the standard DT property instead.
Signed-off-by Romain Perier <[email protected]>--- drivers/mfd/tps65910.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/mfd/tps65910.c +0
-0
drivers/mfd/tps65910.c static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client, · line 426
Quoted 6 lines
drivers/mfd/tps65910.c +1
-2@@ -423,8 +423,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_property_read_bool (np, -"ti,system-power-controller" ); + board_info->pm_off =of_is_system_power_controller ();
you didn't build-test this, did you ?
Signature · 8 lines
balbi -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141027/1ff85a52/attachment.sig>
PATCH v2 7/10 ARM: dts: tegra: Use standard power-off property in tps65911 for tegra30 apalis
In reply to Romain Perier--- arch/arm/boot/dts/tegra30-apalis.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/tegra30-apalis.dtsi +1 -1
@@ -412,7 +412,7 @@ #interrupt-cells = <2>; interrupt-controller; - ti,system-power-controller; + system-power-controller; #gpio-cells = <2>; gpio-controller;
Signature · 1 line
1.9.1
Re: [PATCH v2 07/10] ARM: dts: tegra: Use standard power-off property in tps65911 for tegra30 apalis
Quoted 10 lines · Romain Perier
Signed-off-by Romain Perier <[email protected]>--- arch/arm/boot/dts/tegra30-apalis.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm/boot/dts/tegra30-apalis.dtsi +0
-0
arch/arm/boot/dts/tegra30-apalis.dtsi line 415
Quoted 5 lines
arch/arm/boot/dts/tegra30-apalis.dtsi +1
-1@@ -412,7 +412,7 @@ #interrupt-cells = <2>; interrupt-controller; - ti,system-power-controller; + system-power-controller;
this board is broken until this patch is applied.
Signature · 8 lines
balbi -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141027/2859fd67/attachment.sig>
Re: [PATCH v2 07/10] ARM: dts: tegra: Use standard power-off property in tps65911 for tegra30 apalis
Quoted 14 lines · Felipe Balbi
Quoted 13 lines · Romain Perier
Signed-off-by Romain Perier <[email protected]>--- arch/arm/boot/dts/tegra30-apalis.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm/boot/dts/tegra30-apalis.dtsi +0
-0@@ -412,7 +412,7 @@ #interrupt-cells = <2>; interrupt-controller;
Quoted 4 lines
arch/arm/boot/dts/tegra30-apalis.dtsi line 415
Quoted 2 lines
arch/arm/boot/dts/tegra30-apalis.dtsi +1
-1- ti,system-power-controller; + system-power-controller;this board is broken until this patch is applied.
It should not. Supporting a new property in the tps65911 is fine, but the old property must keep being supported to preserve DT compatibility. If a change removing support for "ti,system-power-controller" has landed in -next, then it should be removed.
Re: [PATCH v2 07/10] ARM: dts: tegra: Use standard power-off property in tps65911 for tegra30 apalis
The old property is supported. See "[PATCH v1 1/10]" ^^ (of_is_system_power_controller supports both properties...)
2014-10-28 5:34 GMT+01:00 Alexandre Courbot <[email protected]>:
Quoted 25 lines · Felipe Balbi
Quoted 14 lines · Romain Perier
Quoted 13 lines
Signed-off-by Romain Perier <[email protected]>--- arch/arm/boot/dts/tegra30-apalis.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm/boot/dts/tegra30-apalis.dtsi +0
-0@@ -412,7 +412,7 @@ #interrupt-cells = <2>; interrupt-controller;Quoted 4 lines
arch/arm/boot/dts/tegra30-apalis.dtsi line 415
Quoted 2 lines
arch/arm/boot/dts/tegra30-apalis.dtsi +1
-1- ti,system-power-controller; + system-power-controller;this board is broken until this patch is applied.
It should not. Supporting a new property in the tps65911 is fine, but the old property must keep being supported to preserve DT compatibility. If a change removing support for "ti,system-power-controller" has landed in -next, then it should be removed.
PATCH v2 8/10 ARM: dts: tegra: Use standard power-off property in tps65911 for tegra30 beaver
In reply to Romain Perier--- arch/arm/boot/dts/tegra30-beaver.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/tegra30-beaver.dts +1 -1
@@ -188,7 +188,7 @@ #interrupt-cells = <2>; interrupt-controller; - ti,system-power-controller; + system-power-controller; #gpio-cells = <2>; gpio-controller;
Signature · 1 line
1.9.1
Re: [PATCH v2 08/10] ARM: dts: tegra: Use standard power-off property in tps65911 for tegra30 beaver
Quoted 10 lines · Romain Perier
Signed-off-by Romain Perier <[email protected]>--- arch/arm/boot/dts/tegra30-beaver.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm/boot/dts/tegra30-beaver.dts +0
-0
arch/arm/boot/dts/tegra30-beaver.dts line 191
Quoted 5 lines
arch/arm/boot/dts/tegra30-beaver.dts +1
-1@@ -188,7 +188,7 @@ #interrupt-cells = <2>; interrupt-controller; - ti,system-power-controller; + system-power-controller;
and this... likewise to all others. You should add regressions midway through your series and you can't simply drop a DT binding which has been shipped on stable kernels.
Signature · 8 lines
balbi -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141027/f7948ba7/attachment-0001.sig>
PATCH v2 9/10 ARM: dts: tegra: Use standard power-off property in tps65911 for tegra30 cardhu
In reply to Romain Perier--- arch/arm/boot/dts/tegra30-cardhu.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/tegra30-cardhu.dtsi +1 -1
@@ -232,7 +232,7 @@ #interrupt-cells = <2>; interrupt-controller; - ti,system-power-controller; + system-power-controller; #gpio-cells = <2>; gpio-controller;
Signature · 1 line
1.9.1
PATCH v2 10/10 ARM: dts: tegra: Use standard power-off property in tps65911 for tegra30 colibri
In reply to Romain Perier--- arch/arm/boot/dts/tegra30-colibri.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/tegra30-colibri.dtsi +1 -1
@@ -190,7 +190,7 @@ #interrupt-cells = <2>; interrupt-controller; - ti,system-power-controller; + system-power-controller; #gpio-cells = <2>; gpio-controller;
Signature · 1 line
1.9.1
PATCH 3/10 regulator: act8865: Use of_is_system_power_controller helper function
In reply to Romain Perier--- drivers/regulator/act8865-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/act8865-regulator.c +1 -1
@@ -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;
Signature · 1 line
1.9.1
Re: [PATCH v1 03/10] regulator: act8865: Use of_is_system_power_controller helper function
Quoted 10 lines · Romain Perier
Signed-off-by Romain Perier <[email protected]>--- drivers/regulator/act8865-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/regulator/act8865-regulator.c +0
-0
drivers/regulator/act8865-regulator.c static int act8865_pmic_probe(struct i2c_client *client, · line 368
Quoted 5 lines
drivers/regulator/act8865-regulator.c +1
-1@@ -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)) {
so building this driver is broken until this patch ? not very good either.
Looks to me you should add of_is_system_power_controller without remove of_system_has_poweroff_source() until all users of that have been converted over.
Signature · 8 lines
balbi -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141027/f6c2b806/attachment.sig>
Re: [PATCH v1 03/10] regulator: act8865: Use of_is_system_power_controller helper function
Am Montag, 27. Oktober 2014, 11:40:22 schrieb Felipe Balbi:
Quoted 23 lines · Romain Perier
Quoted 11 lines
Signed-off-by Romain Perier <[email protected]>---
drivers/regulator/act8865-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/regulator/act8865-regulator.cindex 76301ed..435aba1 100644drivers/regulator/act8865-regulator.c static int act8865_pmic_probe(struct i2c_client · line 370
Quoted 7 lines
drivers/regulator/act8865-regulator.c +1
-1@@ -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)) {so building this driver is broken until this patch ? not very good either.
Quoted 3 lines
Looks to me you should add
of_is_system_power_controllerwithout removeof_system_has_poweroff_source()until all users of that have been converted over.
or alternatively fold this change into patch1 to keep the renaming together
PATCH 5/10 dt-bindings: act8865: Update documentation about property system-power-controller
In reply to Romain Perier--- Documentation/devicetree/bindings/regulator/act8865-regulator.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/regulator/act8865-regulator.txt +2 -2
@@ -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.
Signature · 1 line
1.9.1
Quoted 48 lines · Romain Perier
As discussed on the mailing list, it makes more sense to rename this property to "system-power-controller". 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 prefixed by a vendor name and the new one without any prefix.
Signed-off-by Romain Perier <[email protected]>--- include/linux/of.h | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-)include/linux/of.h +16
-4@@ -867,14 +867,33 @@ 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 the property for controlling system +* power is found in 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) -{ -return of_property_read_bool (np,"poweroff-source" ); +static inline bool of_is_system_power_controller (const struct device_node *np) +{ +struct property *pp; +unsigned long flags; +char *sep; +bool found = false; + +raw_spin_lock_irqsave (&devtree_lock, flags); +for_each_property_of_node (np, pp) { +if (of_prop_cmp (pp->name,"system-power-controller" ) ==0 ) { + found = true; +break ; + } + sep =strchr (pp->name,',' );
include/linux/of.h static inline int of_changeset_update_property(struct of_changeset *ocs, · line 899
Quoted 10 lines
include/linux/of.h +7
-0+if (sep && sep - pp->name &&of_prop_cmp (sep +1 ,"system-power-controller" ) ==0 ) { + found = true; +break ; + } + } +raw_spin_unlock_irqrestore (&devtree_lock, flags); +return found; }#endif /* _LINUX_OF_H */
I think you still need to support poweroff-source since it has been released on a stable kernel. Perhaps add a warning message telling users it's deprecated and asking them to switch over to system-power-controller ? Still, simply removing it isn't very nice.
Signature · 8 lines
balbi -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141027/522d45cb/attachment.sig>
Quoted 12 lines · Felipe Balbi
Quoted 10 lines · Romain Perier
As discussed on the mailing list, it makes more sense to rename this property to "system-power-controller". 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 prefixed by a vendor name and the new one without any prefix.
Quoted 4 lines
I think you still need to support poweroff-source since it has been released on a stable kernel. Perhaps add a warning message telling users it's deprecated and asking them to switch over to system-power-controller ? Still, simply removing it isn't very nice.
No, Romain sent a patch that replaced "<vendor>,system-power-controller" with "poweroff-source". It's now in Mark's tree (for v3.19), and this series "reverts" to the old name minus the vendor-prefix.
Johan
Quoted 13 lines · Johan Hovold
Quoted 11 lines · Felipe Balbi
Quoted 10 lines · Romain Perier
As discussed on the mailing list, it makes more sense to rename this property to "system-power-controller". 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 prefixed by a vendor name and the new one without any prefix.
Quoted 8 lines
Quoted 4 lines
I think you still need to support poweroff-source since it has been released on a stable kernel. Perhaps add a warning message telling users it's deprecated and asking them to switch over to system-power-controller ? Still, simply removing it isn't very nice.
No, Romain sent a patch that replaced "<vendor>,system-power-controller" with "poweroff-source". It's now in Mark's tree (for v3.19), and this series "reverts" to the old name minus the vendor-prefix.
oh, so poweroff-source isn't in Linus' tree yet ? (/me goes grep)
Then it should be fine. My bad.
Many of the other comments are still valid because even though poweroff-source isn't in mainline yet, this series still creates bisection points which are broken. The best solution would be to drop all those patches from Mark's tree. Read, not revert, drop.
Signature · 8 lines
balbi -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141027/929e60ca/attachment.sig>
Am Montag, 27. Oktober 2014, 11:47:41 schrieb Felipe Balbi:
Quoted 24 lines · Johan Hovold
Quoted 14 lines · Felipe Balbi
Quoted 13 lines · Romain Perier
Quoted 11 lines
As discussed on the mailing list, it makes more sense to rename this property to "system-power-controller". 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 prefixed by a vendor name and the new one without any prefix.
Quoted 8 lines
Quoted 4 lines
I think you still need to support poweroff-source since it has been released on a stable kernel. Perhaps add a warning message telling users it's deprecated and asking them to switch over to system-power-controller ? Still, simply removing it isn't very nice.
No, Romain sent a patch that replaced "<vendor>,system-power-controller" with "poweroff-source". It's now in Mark's tree (for v3.19), and this series "reverts" to the old name minus the vendor-prefix.
Quoted 8 lines
oh, so poweroff-source isn't in Linus' tree yet ? (/me goes grep)
Then it should be fine. My bad.
Many of the other comments are still valid because even though poweroff-source isn't in mainline yet, this series still creates bisection points which are broken. The best solution would be to drop all those patches from Mark's tree. Read, not revert, drop.
There have never been any users of the poweroff-source. The act8846 in the radxarock would have been the first, but I held off with the dts patch as the naming issue came up at the same time.
So I guess if Romain keeps the renaming together there shouldn't be any other bad bisection points?
Quoted 34 lines · Heiko St?bner
Am Montag, 27. Oktober 2014, 11:47:41 schrieb Felipe Balbi:
Quoted 24 lines · Johan Hovold
Quoted 14 lines · Felipe Balbi
Quoted 13 lines · Romain Perier
Quoted 11 lines
As discussed on the mailing list, it makes more sense to rename this property to "system-power-controller". 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 prefixed by a vendor name and the new one without any prefix.
Quoted 8 lines
Quoted 4 lines
I think you still need to support poweroff-source since it has been released on a stable kernel. Perhaps add a warning message telling users it's deprecated and asking them to switch over to system-power-controller ? Still, simply removing it isn't very nice.
No, Romain sent a patch that replaced "<vendor>,system-power-controller" with "poweroff-source". It's now in Mark's tree (for v3.19), and this series "reverts" to the old name minus the vendor-prefix.
Quoted 8 lines
oh, so poweroff-source isn't in Linus' tree yet ? (/me goes grep)
Then it should be fine. My bad.
Many of the other comments are still valid because even though poweroff-source isn't in mainline yet, this series still creates bisection points which are broken. The best solution would be to drop all those patches from Mark's tree. Read, not revert, drop.
Quoted 6 lines
There have never been any users of the poweroff-source. The act8846 in the radxarock would have been the first, but I held off with the dts patch as the naming issue came up at the same time.
So I guess if Romain keeps the renaming together there shouldn't be any other bad bisection points?
Not build breaks, but there will always be the commit below:
commit a88f5c6deb2a44f694b01aac48231ec97059b26a
Author: Romain Perier <[email protected]> Date: Tue Oct 14 06:31:12 2014 +0000
dt-bindings: Document the standard property "poweroff-source"
Documentation/devicetree/bindings/power/poweroff.txt new file +18 -0
@@ -0,0 +1,18 @@ +* Generic Poweroff 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 . + +Example: + +act8846: act8846 at 5 { + compatible = "active-semi,act8846"; + status = "okay"; + poweroff-source; +}
Even if for a small time frame, there will always be a commit where we called "poweroff-source" a standard binding and, as such, as should support it.
Signature · 8 lines
balbi -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141027/b90740a2/attachment.sig>
Quoted 23 lines · Felipe Balbi
Quoted 13 lines · Johan Hovold
Quoted 11 lines · Felipe Balbi
Quoted 10 lines · Romain Perier
As discussed on the mailing list, it makes more sense to rename this property to "system-power-controller". 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 prefixed by a vendor name and the new one without any prefix.
Quoted 8 lines
Quoted 4 lines
I think you still need to support poweroff-source since it has been released on a stable kernel. Perhaps add a warning message telling users it's deprecated and asking them to switch over to system-power-controller ? Still, simply removing it isn't very nice.
No, Romain sent a patch that replaced "<vendor>,system-power-controller" with "poweroff-source". It's now in Mark's tree (for v3.19), and this series "reverts" to the old name minus the vendor-prefix.
Quoted 8 lines
oh, so poweroff-source isn't in Linus' tree yet ? (/me goes grep)
Then it should be fine. My bad.
Many of the other comments are still valid because even though poweroff-source isn't in mainline yet, this series still creates bisection points which are broken. The best solution would be to drop all those patches from Mark's tree. Read, not revert, drop.
I agree.
Johan
Quoted 46 lines · Romain Perier
As discussed on the mailing list, it makes more sense to rename this property to "system-power-controller". 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 prefixed by a vendor name and the new one without any prefix.
Signed-off-by Romain Perier <[email protected]>--- include/linux/of.h | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-)include/linux/of.h +14
-4@@ -867,14 +867,33 @@ 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 the property for controlling system +* power is found in 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) -{ -return of_property_read_bool (np,"poweroff-source" ); +static inline bool of_is_system_power_controller (const struct device_node *np) +{ +struct property *pp; +unsigned long flags; +char *sep; +bool found = false; + +raw_spin_lock_irqsave (&devtree_lock, flags); +for_each_property_of_node (np, pp) { +if (of_prop_cmp (pp->name,"system-power-controller" ) ==0 ) { + found = true; +break ;
include/linux/of.h static inline int of_changeset_update_property(struct of_changeset *ocs, · line 897
Quoted 10 lines
include/linux/of.h +9
-0+ } + sep =strchr (pp->name,',' ); +if (sep && sep - pp->name &&of_prop_cmp (sep +1 ,"system-power-controller" ) ==0 ) { + found = true; +break ; + } + } +raw_spin_unlock_irqrestore (&devtree_lock, flags); +return found; }
You probably don't want this to be inline.
Johan
2014-10-27 18:16 GMT+01:00 Johan Hovold <[email protected]>:
Quoted 2 lines
You probably don't want this to be inline.
Yeah this is what I thought, I agree, it's a bit big to be inline... I will fix it, I just wait a bit to see what is decided for this serie...