input: imx_sc_key: Enable wakeup according to dts property wakeup-source
Subsystems (3)
Frank Li
maintainerPATCH v2 1/1 input: imx_sc_key: Enable wakeup according to dts property wakeup-source
From: Abel Vesa <[email protected]>
Enable default wakeup according to dts property 'wakeup-source'.
---
Change from v1 to v2
- change int to bool
- move of_property_read_bool() just before device_init_wakeup()
- drop !!
--- drivers/input/keyboard/imx_sc_key.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/input/keyboard/imx_sc_key.c +5 -0
@@ -110,8 +110,10 @@ static void imx_sc_key_action(void *data)static int imx_sc_key_probe (struct platform_device *pdev) { +struct device_node *np = pdev->dev.of_node;struct imx_key_drv_data *priv;struct input_dev *input; +bool wakeup;int error; priv =devm_kzalloc (&pdev->dev,sizeof (*priv),GFP_KERNEL );
@@ -151,6 +153,9 @@ static int imx_sc_key_probe(struct platform_device *pdev) priv->input = input;platform_set_drvdata (pdev, priv); + wakeup =of_property_read_bool (np,"wakeup-source" ); +device_init_wakeup (&pdev->dev, wakeup); + error =imx_scu_irq_group_enable (SC_IRQ_GROUP_WAKE ,SC_IRQ_BUTTON , true);if (error) {
Signature · 1 line
2.34.1
Dmitry Torokhov
maintainerHi Frank,
Quoted 32 lines · Frank Li
From: Abel Vesa <[email protected]>
Enable default wakeup according to dts property 'wakeup-source'.
Signed-off-by Abel Vesa <[email protected]>Reviewed-by Nitin Garg <[email protected]>Signed-off-by Frank Li <[email protected]>---
Change from v1 to v2
- change int to bool
- moveof_property_read_bool()just beforedevice_init_wakeup()
- drop !!--- drivers/input/keyboard/imx_sc_key.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/input/keyboard/imx_sc_key.c +2
-0@@ -110,8 +110,10 @@ static void imx_sc_key_action(void *data)static int imx_sc_key_probe (struct platform_device *pdev) { +struct device_node *np = pdev->dev.of_node;struct imx_key_drv_data *priv;struct input_dev *input; +bool wakeup;int error; priv =devm_kzalloc (&pdev->dev,sizeof (*priv),GFP_KERNEL );
drivers/input/keyboard/imx_sc_key.c static int imx_sc_key_probe(struct platform_device *pdev) · line 156
Quoted 4 lines
drivers/input/keyboard/imx_sc_key.c +1
-0@@ -151,6 +153,9 @@ static int imx_sc_key_probe(struct platform_device *pdev) priv->input = input;platform_set_drvdata (pdev, priv); + wakeup =of_property_read_bool (np,"wakeup-source" );
The driver uses generic device properties, why do you use OF-specific variant here?
drivers/input/keyboard/imx_sc_key.c static int imx_sc_key_probe(struct platform_device *pdev) · line 158
Quoted 2 lines
drivers/input/keyboard/imx_sc_key.c +2
-0+device_init_wakeup (&pdev->dev, wakeup); +
How does this actually work? Doesn't the call directly below unconditionally configures button as a wakeup source?
drivers/input/keyboard/imx_sc_key.c static int imx_sc_key_probe(struct platform_device *pdev) · line 161
Quoted 3 lines
drivers/input/keyboard/imx_sc_key.c +0
-0error =imx_scu_irq_group_enable (SC_IRQ_GROUP_WAKE ,SC_IRQ_BUTTON , true);if (error) {
Thanks.
Signature · 1 line
Dmitry
Frank Li
maintainerQuoted 38 lines · Dmitry Torokhov
Hi Frank,
Quoted 35 lines · Frank Li
From: Abel Vesa <[email protected]>
Enable default wakeup according to dts property 'wakeup-source'.
Signed-off-by Abel Vesa <[email protected]>Reviewed-by Nitin Garg <[email protected]>Signed-off-by Frank Li <[email protected]>---
Change from v1 to v2
- change int to bool
- moveof_property_read_bool()just beforedevice_init_wakeup()
- drop !!--- drivers/input/keyboard/imx_sc_key.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/input/keyboard/imx_sc_key.c +2
-0@@ -110,8 +110,10 @@ static void imx_sc_key_action(void *data)static int imx_sc_key_probe (struct platform_device *pdev) { +struct device_node *np = pdev->dev.of_node;struct imx_key_drv_data *priv;struct input_dev *input; +bool wakeup;int error; priv =devm_kzalloc (&pdev->dev,sizeof (*priv),GFP_KERNEL );@@ -151,6 +153,9 @@ static int imx_sc_key_probe(struct platform_device *pdev) priv->input = input;platform_set_drvdata (pdev, priv);
Quoted 4 lines
drivers/input/keyboard/imx_sc_key.c static int imx_sc_key_probe(struct platform_device *pdev) · line 156
Quoted 1 line
drivers/input/keyboard/imx_sc_key.c +1
-0+ wakeup =of_property_read_bool (np,"wakeup-source" );The driver uses generic device properties, why do you use OF-specific variant here?
I think it just show default if it is wakeup source.
Do you think we just need call device_init_wakeup(&pdev->dev, wakeup) to maintance consisent between software wakeup enable status with SCU wakeup enable status?
Since most case power-key should be wakeup source.
Quoted 6 lines
drivers/input/keyboard/imx_sc_key.c static int imx_sc_key_probe(struct platform_device *pdev) · line 158
Quoted 3 lines
drivers/input/keyboard/imx_sc_key.c +2
-0+device_init_wakeup (&pdev->dev, wakeup); +How does this actually work? Doesn't the call directly below unconditionally configures button as a wakeup source?
Good capture, I am also strange why it can wakeup even dts have not set wakeup-source.
Frank
Quoted 9 lines
drivers/input/keyboard/imx_sc_key.c static int imx_sc_key_probe(struct platform_device *pdev) · line 161
Quoted 4 lines
drivers/input/keyboard/imx_sc_key.c +0
-0error =imx_scu_irq_group_enable (SC_IRQ_GROUP_WAKE ,SC_IRQ_BUTTON , true);if (error) {Thanks.
Signature · 1 line
Dmitry