Re: [PATCH 1/1] ideapad-laptop: Handle Yoga in tablet mode

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

 



Adding Maxim Mikityanskiy and Hans de Goede to CC.

On 5 May 2016 at 19:42, Darren Hart <dvhart@xxxxxxxxxxxxx> wrote:
> On Fri, Apr 01, 2016 at 11:02:49PM +0200, Christian Hesse wrote:
>> From: Christian Hesse <mail@xxxxxxxx>
>>
>> When Lenovo Yoga 700 is flipped to tablet mode it emmits event 10. Let's
>> send touchpad key codes so software can disable touchpad.
>>
>> Signed-off-by: Christian Hesse <mail@xxxxxxxx>
>> Signed-off-by: Michael Gisbers <michael@xxxxxxxxxx>
>
> Queued, thanks.
>
>> ---
>>  drivers/platform/x86/ideapad-laptop.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
>> index be3bc2f..1d49db1 100644
>> --- a/drivers/platform/x86/ideapad-laptop.c
>> +++ b/drivers/platform/x86/ideapad-laptop.c
>> @@ -809,6 +809,7 @@ static void ideapad_acpi_notify(acpi_handle handle, u32 event, void *data)
>>                       case 6:
>>                               ideapad_input_report(priv, vpc_bit);
>>                               break;
>> +                     case 10:
>>                       case 5:
>>                               ideapad_sync_touchpad_state(priv);

I'm not sure this is the right action here: ideapad_sync_touchpad()
sends a sequence of KEY_TOUCHPAD_DISABLE and KEY_TOUCHPAD_ENABLED,
which are interpreted by userspace as "the touchpad has been
{dis,en}abled by the hardware". The way userspace is expected to react
to it is by showing a notification of the fact to the user, but not
disabling the touchpad. This behavior can be confirmed in the original
commit message that introduced this change (I couldn't find any actual
documentation on this): "Input: add keycodes for touchpad on/off keys"
(0417596f66). I was actually going to propose a patch similar to Hans'
"ideapad-laptop: Disable touchpad interface on Yoga models"
(f79a901331) for the Yoga 900, to avoid an "touchpad ON" OSD
notification being shown to the user when returning for suspend.

Also, I've been investigating touchpad-related problems in the Lenovo
Yoga 900 recently, and trying to understand this code. IIUC
ideadpad_sync_touchpad_state() was created as part of "ideapad: add
Lenovo IdeaPad Z570 support (part 2)" (07a4a4fc8) to allow userspace
to syncronize a touchpad-state-indicator LED with the actual touchpad
state, although it seems to me it only works if the touchpad is always
enabled by the hardware on resume (cc'ing the original patch author
here for maybe a confirmation on how this is expected to work).

Additionally, while I indeed see an unknown event reported by
ideapad_laptop when closing the lid on the Yoga 900, it is not
vpc_bit=10, but vpc_bit=1. But I also see the keyboard device sending
the same scancode that is sent when the actual touchpad-toggle media
key is pressed (F6 on the Yoga 900), so I'm not 100% sure how all of
this play together yet. I think it would be great if we could
understand the problem a bit better and find a more generic solution.
Were you able to trace the DSDT code that generates this notification?

Best regards,

--
João Paulo Rechi Vita
http://about.me/jprvita
--
To unsubscribe from this list: send the line "unsubscribe platform-driver-x86" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux