Re: [PATCH v2 2/4] Input: zforce_ts: Reject open if initialization not finished

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 03, 2016 at 12:41:48PM +0200, Dirk Behme wrote:
> From: Oleksij Rempel <linux@xxxxxxxxxxxxxxxx>
> 
> Response EAGAIN when open the device while BOOT_COMPLETE
> notification is not received and initialization of the zForce touch
> controller is not finished.

Hmm, why not allow open to complete, but check the open count when we
receive boot completion status and call zforce_start() there if open
count is not 0?

Thanks.

> 
> Signed-off-by: Oleksij Rempel <fixed-term.Oleksij.Rempel@xxxxxxxxxxxx>
> Signed-off-by: Knut Wohlrab <Knut.Wohlrab@xxxxxxxxxxxx>
> ---
>  drivers/input/touchscreen/zforce_ts.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/input/touchscreen/zforce_ts.c b/drivers/input/touchscreen/zforce_ts.c
> index 9839d86..fc0edd6 100644
> --- a/drivers/input/touchscreen/zforce_ts.c
> +++ b/drivers/input/touchscreen/zforce_ts.c
> @@ -690,6 +690,10 @@ static int zforce_input_open(struct input_dev *dev)
>  	struct zforce_ts *ts = input_get_drvdata(dev);
>  	int ret;
>  
> +	/* if not probed try again later */
> +	if (ts->state == ZF_STATE_UNINITIALZED)
> +		return -EAGAIN;
> +
>  	ret = zforce_start(ts);
>  	if (ret)
>  		return ret;
> -- 
> 1.9.1
> 

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



[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux