Skip to contentSkip to conversation

input: touchscreen: add delay time to device power on

PATCH In review [email protected] 2 participants 3 messages Jul 10, 2019 – Jul 12, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 input: touchscreen: add delay time to device power on

From: "Crag.Wang" <[email protected]>

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

---
 drivers/input/touchscreen/melfas_mip4.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/input/touchscreen/melfas_mip4.c +3 -4
index 430a2bc5f7ca..8e803658fb43 100644
@@ -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;
 }
Signature · 1 line
2.20.1
author
#1 lore raw

Adding more

Quoted 44 lines · On Wed, Jul 10, 2019 at 10:59 AM <[email protected]> wrote:

From: "Crag.Wang" <[email protected]>

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

---
 drivers/input/touchscreen/melfas_mip4.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/input/touchscreen/melfas_mip4.c +3 -5
index 430a2bc5f7ca..8e803658fb43 100644
@@ -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

maintainer
#2 lore raw

Hi Crag,

Quoted 13 lines · Crag Wang

Adding more

Quoted 10 lines · On Wed, Jul 10, 2019 at 10:59 AM <[email protected]> wrote:

From: "Crag.Wang" <[email protected]>

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.

Signature · 1 line
Dmitry