From: Moritz Fischer <mdf@kernel.org> Date: 2018-02-19 23:04:33
Add 'timeout_ms' property to support boards where the 3s timeout that the
current driver defaults to is too short.
Signed-off-by: Moritz Fischer <mdf@kernel.org>
---
Changes from v1:
- Addressed Rob's feedback (timeout -> timeout_ms)
- Added to old example rather than creating separate one
---
Documentation/devicetree/bindings/power/reset/gpio-poweroff.txt | 3 +++
1 file changed, 3 insertions(+)
@@ -27,10 +27,13 @@ Optional properties: it to an output when the power-off handler is called. If this optional property is not specified, the GPIO is initialized as an output in its inactive state.+- timeout_ms: Time to wait before asserting a WARN_ON(1). If nothing is+ specified, 3000 ms is used. Examples: gpio-poweroff { compatible = "gpio-poweroff"; gpios = <&gpio 4 0>;+ timeout_ms = <3000>; };
From: Moritz Fischer <mdf@kernel.org> Date: 2018-02-19 23:04:46
Add support for reading a timeout value from devicetree.
Fall back to previous default of 3s if nothing is specified.
Signed-off-by: Moritz Fischer <mdf@kernel.org>
---
Changes from v1:
- of_property_read_u32() overwrites the output only if it succeeds,
simplify error handling
---
drivers/power/reset/gpio-poweroff.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
@@ -40,7 +42,7 @@ static void gpio_poweroff_do_poweroff(void)gpiod_set_value(reset_gpio,1);/* give it some time */-mdelay(3000);+mdelay(timeout);WARN_ON(1);}
@@ -64,6 +66,8 @@ static int gpio_poweroff_probe(struct platform_device *pdev)elseflags=GPIOD_OUT_LOW;+of_property_read_u32(pdev->dev.of_node,"timeout_ms",&timeout);+reset_gpio=devm_gpiod_get(&pdev->dev,NULL,flags);if(IS_ERR(reset_gpio))returnPTR_ERR(reset_gpio);
From: Rob Herring <robh@kernel.org> Date: 2018-02-20 14:18:38
On Mon, Feb 19, 2018 at 4:59 PM, Moritz Fischer [off-list ref] wrote:
quoted hunk
Add 'timeout_ms' property to support boards where the 3s timeout that the
current driver defaults to is too short.
Signed-off-by: Moritz Fischer <mdf@kernel.org>
---
Changes from v1:
- Addressed Rob's feedback (timeout -> timeout_ms)
- Added to old example rather than creating separate one
---
Documentation/devicetree/bindings/power/reset/gpio-poweroff.txt | 3 +++
1 file changed, 3 insertions(+)
@@ -27,10 +27,13 @@ Optional properties: it to an output when the power-off handler is called. If this optional property is not specified, the GPIO is initialized as an output in its inactive state.+- timeout_ms: Time to wait before asserting a WARN_ON(1). If nothing is+ specified, 3000 ms is used.