lkml.org 
[lkml]   [2018]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] HID: i2c-hid: Add a small delay after powering on/off the device
From
Date


> On Oct 3, 2018, at 5:10 PM, Jiri Kosina <jikos@kernel.org> wrote:
>
> On Mon, 1 Oct 2018, Kai-Heng Feng wrote:
>
>> Raydium touchpanel (2386:4B33) sometimes does not workin desktop session
>> although it works in display manager.
>>
>> During user logging, the display manager exits, close the HID device,
>> then the device gets runtime suspended and powered off. The desktop
>> session begins shortly after, opens the HID device, then the device gets
>> runtime resumed and powered on.
>>
>> If the trasition from display manager to desktop sesesion is fast, the
>> touchpanel cannot switch from powered off to powered on in short
>> timeframe. So add a small delay to workaround the issue.
>>
>> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
>> ---
>> drivers/hid/i2c-hid/i2c-hid.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
>> index f3076659361a..ff5682cc1bce 100644
>> --- a/drivers/hid/i2c-hid/i2c-hid.c
>> +++ b/drivers/hid/i2c-hid/i2c-hid.c
>> @@ -409,6 +409,8 @@ static int i2c_hid_set_power(struct i2c_client *client, int power_state)
>>
>> if (ret)
>> dev_err(&client->dev, "failed to change power setting.\n");
>> + else
>> + msleep(20);
>
> In case there really is no other way around it, at least please add
> comment explaining why this ugly msleep() is there. Thanks,

I am working on a better approach for this issue, I’ll send a v2 soon.

Kai-Heng

>
> --
> Jiri Kosina
> SUSE Labs
>

\
 
 \ /
  Last update: 2018-10-03 11:22    [W:0.057 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site