dell-wmi: Generate one sparse keymap for all machines
This patch reworks code for generating sparse keymap and processing WMI events. It unifies procedure for generating sparse keymap and also unifies big switch code for processing WMI events of different types. After this patch dell-wmi driver does not differ between "old" and "new" hotkey type. It constructs sparse keymap table with all WMI codes. It is because on some laptops (e.g. Dell Latitude E6440) ACPI/firmware send both event types (old and new). Each WMI code in sparse keymap table is prefixed by 16bit event type, so it does not change functionality on laptops with "old" hotkey support (those without scancodes in DMI). This allow us to distinguish between same WMI codes with different types in sparse keymap. Thanks to this WMI events of type 0x0011 were moved from big switch into sparse keymap table too. This patch also fixes possible bug in parsing WMI event buffer introduced in commit 5ea25597 ("dell-wmi: Add support for new Dell systems"). That commit changed buffer type from int* to u16* without fixing code. More at: http://lkml.iu.edu/hypermail/linux/kernel/1507.0/01950.htmlSigned-off-by: NPali Rohár <pali.rohar@gmail.com> Tested-by: NMichał Kępień <kernel@kempniu.pl> Reviewed-by: NMichał Kępień <kernel@kempniu.pl> Tested-by: NGabriele Mazzotta <gabriele.mzt@gmail.com> Signed-off-by: NDarren Hart <dvhart@linux.intel.com>
Showing
想要评论请 注册 或 登录