diff mbox series

[v2] Input: stmfts - use async probe & suspend/resume to avoid 2s delay

Message ID 20180328143929.2937-1-m.szyprowski@samsung.com
State Accepted
Commit 1d960003603403f28b9d391087905491b98f3923
Headers show
Series [v2] Input: stmfts - use async probe & suspend/resume to avoid 2s delay | expand

Commit Message

Marek Szyprowski March 28, 2018, 2:39 p.m. UTC
Executing stmfts_power_on() function lasts over 2 seconds, what
significantly slows down the boot and resume processes if driver is
compiled in. Avoid this delay by forcing this driver to be probed
and suspended/resumed asynchronously.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>

---
 drivers/input/touchscreen/stmfts.c | 2 ++
 1 file changed, 2 insertions(+)

-- 
2.15.0

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Dmitry Torokhov March 30, 2018, 6:13 p.m. UTC | #1
On Wed, Mar 28, 2018 at 04:39:29PM +0200, Marek Szyprowski wrote:
> Executing stmfts_power_on() function lasts over 2 seconds, what

> significantly slows down the boot and resume processes if driver is

> compiled in. Avoid this delay by forcing this driver to be probed

> and suspended/resumed asynchronously.

> 

> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>


Applied, thank you.

> ---

>  drivers/input/touchscreen/stmfts.c | 2 ++

>  1 file changed, 2 insertions(+)

> 

> diff --git a/drivers/input/touchscreen/stmfts.c b/drivers/input/touchscreen/stmfts.c

> index efdb1a75a163..40c833db150a 100644

> --- a/drivers/input/touchscreen/stmfts.c

> +++ b/drivers/input/touchscreen/stmfts.c

> @@ -730,6 +730,7 @@ static int stmfts_probe(struct i2c_client *client,

>  		return err;

>  

>  	pm_runtime_enable(&client->dev);

> +	device_enable_async_suspend(&client->dev);

>  

>  	return 0;

>  }

> @@ -805,6 +806,7 @@ static struct i2c_driver stmfts_driver = {

>  		.name = STMFTS_DEV_NAME,

>  		.of_match_table = of_match_ptr(stmfts_of_match),

>  		.pm = &stmfts_pm_ops,

> +		.probe_type = PROBE_PREFER_ASYNCHRONOUS,

>  	},

>  	.probe = stmfts_probe,

>  	.remove = stmfts_remove,

> -- 

> 2.15.0

> 


-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox series

Patch

diff --git a/drivers/input/touchscreen/stmfts.c b/drivers/input/touchscreen/stmfts.c
index efdb1a75a163..40c833db150a 100644
--- a/drivers/input/touchscreen/stmfts.c
+++ b/drivers/input/touchscreen/stmfts.c
@@ -730,6 +730,7 @@  static int stmfts_probe(struct i2c_client *client,
 		return err;
 
 	pm_runtime_enable(&client->dev);
+	device_enable_async_suspend(&client->dev);
 
 	return 0;
 }
@@ -805,6 +806,7 @@  static struct i2c_driver stmfts_driver = {
 		.name = STMFTS_DEV_NAME,
 		.of_match_table = of_match_ptr(stmfts_of_match),
 		.pm = &stmfts_pm_ops,
+		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
 	},
 	.probe = stmfts_probe,
 	.remove = stmfts_remove,