lkml.org 
[lkml]   [2018]   [Jan]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Support tablet mode switch for Dell laptops
On Thursday 18 January 2018 16:44:08 Pali Rohár wrote:
> On Thursday 18 January 2018 14:59:50 Marco Martin wrote:
> > - if (!sparse_keymap_report_event(priv->input_dev, event, 1, true))
> > + if (event == 0xCC) {
> > + input_report_switch(priv->input_dev, SW_TABLET_MODE, 1);
> > + input_sync(priv->input_dev);
> > + } else if (event == 0xCD) {
> > + input_report_switch(priv->input_dev, SW_TABLET_MODE, 0);
> > + input_sync(priv->input_dev);
> > + } else if (!sparse_keymap_report_event(priv->input_dev, event, 1, true))
>
> Is not it possible to put 0xCC and 0xCD into sparse keymap table?
> Because IIRC sparse keymap was created just to avoid that big
> if-elseif-elseif-else blocks.

Dmitry, can you comment above part? I think that there should be better
way how to handle above switches and sparse keymap via one input device.

> > dev_info(&device->dev, "unknown event index 0x%x\n",
> > event);
> > }
>

--
Pali Rohár
pali.rohar@gmail.com

\
 
 \ /
  Last update: 2018-01-19 17:02    [W:0.064 / U:1.416 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site