Re: [PATCH] Support intel-vbtn based tablet mode switch

From: Marco Martin
Date: Tue Jan 23 2018 - 07:42:50 EST


On Tue, Jan 23, 2018 at 12:46 AM, Dmitry Torokhov
<dmitry.torokhov@xxxxxxxxx> wrote:
>> @@ -81,6 +86,7 @@ static void notify_handler(acpi_handle handle, u32 event, void *context)
>> return;
>> }
>> } else if (sparse_keymap_report_event(priv->input_dev, event, 1, true)) {
>> + input_sync(priv->input_dev);
>
> I do not understand why this is needed, as sparse keymap should issue
> sync for you. From sparse_keymap_report_entry():

indeed, I was testing on a 4.13 build, the sync there was pushed in
november only for 4.14, i've rebuilt it now on 4.14 and my sync is not
needed anymore

> Can be shorter:
>
> input_report_switch(priv->input_dev, SW_TABLET_MODE,
> obj->integer.value & TABLET_MODE_FLAG);
>
> You also need:
>
> input_sync(priv->input_dev);

in v3 this shorter version and doesn't report the capability if it's
the wrong type

--
Marco Martin