linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] input: touchscreen: add delay time to device power on
@ 2019-07-10  2:58 crag0715
  2019-07-10  8:58 ` Crag Wang
  0 siblings, 1 reply; 3+ messages in thread
From: crag0715 @ 2019-07-10  2:58 UTC (permalink / raw)
  Cc: mario_limonciello, chrome.os.engineering, Crag.Wang, Sangwon Jee,
	Dmitry Torokhov, linux-input, linux-kernel

From: "Crag.Wang" <crag.wang@dell.com>

Delay time for MELFAS MIP4 controller is required at power on stage
regardless the existence of GPIO consumer lookup from devicetree or
ACPI device table.

There is an issue if GPIO ce is undefined in the ACPI results no delay
time for deive power on, the controller ended up in an abnormal state.

TEST=echo i2c-MLFS0000:00 > /sys/bus/i2c/drivers/mip4_ts/unbind
     verify the touch function is off

     echo i2c-MLFS0000:00 > /sys/bus/i2c/drivers/mip4_ts/bind
     verify the touch function is on

Signed-off-by: Crag.Wang <crag.wang@dell.com>
---
 drivers/input/touchscreen/melfas_mip4.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/melfas_mip4.c b/drivers/input/touchscreen/melfas_mip4.c
index 430a2bc5f7ca..8e803658fb43 100644
--- a/drivers/input/touchscreen/melfas_mip4.c
+++ b/drivers/input/touchscreen/melfas_mip4.c
@@ -374,12 +374,11 @@ static int mip4_query_device(struct mip4_ts *ts)
 
 static int mip4_power_on(struct mip4_ts *ts)
 {
-	if (ts->gpio_ce) {
+	if (ts->gpio_ce)
 		gpiod_set_value_cansleep(ts->gpio_ce, 1);
 
-		/* Booting delay : 200~300ms */
-		usleep_range(200 * 1000, 300 * 1000);
-	}
+	/* Booting delay : 200~300ms */
+	usleep_range(200 * 1000, 300 * 1000);
 
 	return 0;
 }
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] input: touchscreen: add delay time to device power on
  2019-07-10  2:58 [PATCH] input: touchscreen: add delay time to device power on crag0715
@ 2019-07-10  8:58 ` Crag Wang
  2019-07-12  6:48   ` Dmitry Torokhov
  0 siblings, 1 reply; 3+ messages in thread
From: Crag Wang @ 2019-07-10  8:58 UTC (permalink / raw)
  To: yjjung, jsj1012, leesh832
  Cc: Mario Limonciello, chrome.os.engineering, Crag.Wang, Sangwon Jee,
	Dmitry Torokhov, linux-input, linux-kernel

Adding more

On Wed, Jul 10, 2019 at 10:59 AM <crag0715@gmail.com> wrote:
>
> From: "Crag.Wang" <crag.wang@dell.com>
>
> Delay time for MELFAS MIP4 controller is required at power on stage
> regardless the existence of GPIO consumer lookup from devicetree or
> ACPI device table.
>
> There is an issue if GPIO ce is undefined in the ACPI results no delay
> time for deive power on, the controller ended up in an abnormal state.
>
> TEST=echo i2c-MLFS0000:00 > /sys/bus/i2c/drivers/mip4_ts/unbind
>      verify the touch function is off
>
>      echo i2c-MLFS0000:00 > /sys/bus/i2c/drivers/mip4_ts/bind
>      verify the touch function is on
>
> Signed-off-by: Crag.Wang <crag.wang@dell.com>
> ---
>  drivers/input/touchscreen/melfas_mip4.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/input/touchscreen/melfas_mip4.c b/drivers/input/touchscreen/melfas_mip4.c
> index 430a2bc5f7ca..8e803658fb43 100644
> --- a/drivers/input/touchscreen/melfas_mip4.c
> +++ b/drivers/input/touchscreen/melfas_mip4.c
> @@ -374,12 +374,11 @@ static int mip4_query_device(struct mip4_ts *ts)
>
>  static int mip4_power_on(struct mip4_ts *ts)
>  {
> -       if (ts->gpio_ce) {
> +       if (ts->gpio_ce)
>                 gpiod_set_value_cansleep(ts->gpio_ce, 1);
>
> -               /* Booting delay : 200~300ms */
> -               usleep_range(200 * 1000, 300 * 1000);
> -       }
> +       /* Booting delay : 200~300ms */
> +       usleep_range(200 * 1000, 300 * 1000);
>
>         return 0;
>  }
> --
> 2.20.1
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] input: touchscreen: add delay time to device power on
  2019-07-10  8:58 ` Crag Wang
@ 2019-07-12  6:48   ` Dmitry Torokhov
  0 siblings, 0 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2019-07-12  6:48 UTC (permalink / raw)
  To: Crag Wang
  Cc: yjjung, jsj1012, leesh832, Mario Limonciello,
	chrome.os.engineering, Crag.Wang, Sangwon Jee, linux-input,
	linux-kernel

Hi Crag,

On Wed, Jul 10, 2019 at 04:58:40PM +0800, Crag Wang wrote:
> Adding more
> 
> On Wed, Jul 10, 2019 at 10:59 AM <crag0715@gmail.com> wrote:
> >
> > From: "Crag.Wang" <crag.wang@dell.com>
> >
> > Delay time for MELFAS MIP4 controller is required at power on stage
> > regardless the existence of GPIO consumer lookup from devicetree or
> > ACPI device table.
> >
> > There is an issue if GPIO ce is undefined in the ACPI results no delay
> > time for deive power on, the controller ended up in an abnormal state.
> >

If kernel does not reset the controller it should not have to wait for
reset to complete either. Since your firmware resets the controller it
also has to conform to the timing requirements.

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-07-12  6:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-10  2:58 [PATCH] input: touchscreen: add delay time to device power on crag0715
2019-07-10  8:58 ` Crag Wang
2019-07-12  6:48   ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).