Commit fb05b9f53fa9131ae86eb8cc4fda20e943a86e36

Authored by Corentin Chary
Committed by Matthew Garrett
1 parent 6a2bcccdb3

asus-nb-wmi: set panel_power correctly

Even if it's currently unused.

Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>

Showing 1 changed file with 2 additions and 0 deletions Inline Diff

drivers/platform/x86/asus-nb-wmi.c
1 /* 1 /*
2 * Asus Notebooks WMI hotkey driver 2 * Asus Notebooks WMI hotkey driver
3 * 3 *
4 * Copyright(C) 2010 Corentin Chary <corentin.chary@gmail.com> 4 * Copyright(C) 2010 Corentin Chary <corentin.chary@gmail.com>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or 8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version. 9 * (at your option) any later version.
10 * 10 *
11 * This program is distributed in the hope that it will be useful, 11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details. 14 * GNU General Public License for more details.
15 * 15 *
16 * You should have received a copy of the GNU General Public License 16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software 17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 19 */
20 20
21 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 21 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
22 22
23 #include <linux/kernel.h> 23 #include <linux/kernel.h>
24 #include <linux/module.h> 24 #include <linux/module.h>
25 #include <linux/init.h> 25 #include <linux/init.h>
26 #include <linux/input.h> 26 #include <linux/input.h>
27 #include <linux/input/sparse-keymap.h> 27 #include <linux/input/sparse-keymap.h>
28 #include <linux/fb.h>
28 29
29 #include "asus-wmi.h" 30 #include "asus-wmi.h"
30 31
31 #define ASUS_NB_WMI_FILE "asus-nb-wmi" 32 #define ASUS_NB_WMI_FILE "asus-nb-wmi"
32 33
33 MODULE_AUTHOR("Corentin Chary <corentincj@iksaif.net>"); 34 MODULE_AUTHOR("Corentin Chary <corentincj@iksaif.net>");
34 MODULE_DESCRIPTION("Asus Notebooks WMI Hotkey Driver"); 35 MODULE_DESCRIPTION("Asus Notebooks WMI Hotkey Driver");
35 MODULE_LICENSE("GPL"); 36 MODULE_LICENSE("GPL");
36 37
37 #define ASUS_NB_WMI_EVENT_GUID "0B3CBB35-E3C2-45ED-91C2-4C5A6D195D1C" 38 #define ASUS_NB_WMI_EVENT_GUID "0B3CBB35-E3C2-45ED-91C2-4C5A6D195D1C"
38 39
39 MODULE_ALIAS("wmi:"ASUS_NB_WMI_EVENT_GUID); 40 MODULE_ALIAS("wmi:"ASUS_NB_WMI_EVENT_GUID);
40 41
41 /* 42 /*
42 * WAPF defines the behavior of the Fn+Fx wlan key 43 * WAPF defines the behavior of the Fn+Fx wlan key
43 * The significance of values is yet to be found, but 44 * The significance of values is yet to be found, but
44 * most of the time: 45 * most of the time:
45 * Bit | Bluetooth | WLAN 46 * Bit | Bluetooth | WLAN
46 * 0 | Hardware | Hardware 47 * 0 | Hardware | Hardware
47 * 1 | Hardware | Software 48 * 1 | Hardware | Software
48 * 4 | Software | Software 49 * 4 | Software | Software
49 */ 50 */
50 static uint wapf; 51 static uint wapf;
51 module_param(wapf, uint, 0444); 52 module_param(wapf, uint, 0444);
52 MODULE_PARM_DESC(wapf, "WAPF value"); 53 MODULE_PARM_DESC(wapf, "WAPF value");
53 54
54 static struct quirk_entry quirk_asus_unknown = { 55 static struct quirk_entry quirk_asus_unknown = {
55 }; 56 };
56 57
57 static void asus_nb_wmi_quirks(struct asus_wmi_driver *driver) 58 static void asus_nb_wmi_quirks(struct asus_wmi_driver *driver)
58 { 59 {
59 driver->quirks = &quirk_asus_unknown; 60 driver->quirks = &quirk_asus_unknown;
60 driver->quirks->wapf = wapf; 61 driver->quirks->wapf = wapf;
62 driver->panel_power = FB_BLANK_UNBLANK;
61 } 63 }
62 64
63 static const struct key_entry asus_nb_wmi_keymap[] = { 65 static const struct key_entry asus_nb_wmi_keymap[] = {
64 { KE_KEY, 0x30, { KEY_VOLUMEUP } }, 66 { KE_KEY, 0x30, { KEY_VOLUMEUP } },
65 { KE_KEY, 0x31, { KEY_VOLUMEDOWN } }, 67 { KE_KEY, 0x31, { KEY_VOLUMEDOWN } },
66 { KE_KEY, 0x32, { KEY_MUTE } }, 68 { KE_KEY, 0x32, { KEY_MUTE } },
67 { KE_KEY, 0x33, { KEY_DISPLAYTOGGLE } }, /* LCD on */ 69 { KE_KEY, 0x33, { KEY_DISPLAYTOGGLE } }, /* LCD on */
68 { KE_KEY, 0x34, { KEY_DISPLAY_OFF } }, /* LCD off */ 70 { KE_KEY, 0x34, { KEY_DISPLAY_OFF } }, /* LCD off */
69 { KE_KEY, 0x40, { KEY_PREVIOUSSONG } }, 71 { KE_KEY, 0x40, { KEY_PREVIOUSSONG } },
70 { KE_KEY, 0x41, { KEY_NEXTSONG } }, 72 { KE_KEY, 0x41, { KEY_NEXTSONG } },
71 { KE_KEY, 0x43, { KEY_STOPCD } }, 73 { KE_KEY, 0x43, { KEY_STOPCD } },
72 { KE_KEY, 0x45, { KEY_PLAYPAUSE } }, 74 { KE_KEY, 0x45, { KEY_PLAYPAUSE } },
73 { KE_KEY, 0x4c, { KEY_MEDIA } }, 75 { KE_KEY, 0x4c, { KEY_MEDIA } },
74 { KE_KEY, 0x50, { KEY_EMAIL } }, 76 { KE_KEY, 0x50, { KEY_EMAIL } },
75 { KE_KEY, 0x51, { KEY_WWW } }, 77 { KE_KEY, 0x51, { KEY_WWW } },
76 { KE_KEY, 0x55, { KEY_CALC } }, 78 { KE_KEY, 0x55, { KEY_CALC } },
77 { KE_IGNORE, 0x57, }, /* Battery mode */ 79 { KE_IGNORE, 0x57, }, /* Battery mode */
78 { KE_IGNORE, 0x58, }, /* AC mode */ 80 { KE_IGNORE, 0x58, }, /* AC mode */
79 { KE_KEY, 0x5C, { KEY_F15 } }, /* Power Gear key */ 81 { KE_KEY, 0x5C, { KEY_F15 } }, /* Power Gear key */
80 { KE_KEY, 0x5D, { KEY_WLAN } }, /* Wireless console Toggle */ 82 { KE_KEY, 0x5D, { KEY_WLAN } }, /* Wireless console Toggle */
81 { KE_KEY, 0x5E, { KEY_WLAN } }, /* Wireless console Enable */ 83 { KE_KEY, 0x5E, { KEY_WLAN } }, /* Wireless console Enable */
82 { KE_KEY, 0x5F, { KEY_WLAN } }, /* Wireless console Disable */ 84 { KE_KEY, 0x5F, { KEY_WLAN } }, /* Wireless console Disable */
83 { KE_KEY, 0x60, { KEY_SWITCHVIDEOMODE } }, 85 { KE_KEY, 0x60, { KEY_SWITCHVIDEOMODE } },
84 { KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, 86 { KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } },
85 { KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, 87 { KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } },
86 { KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, 88 { KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } },
87 { KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } }, 89 { KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } },
88 { KE_KEY, 0x7D, { KEY_BLUETOOTH } }, 90 { KE_KEY, 0x7D, { KEY_BLUETOOTH } },
89 { KE_KEY, 0x7E, { KEY_BLUETOOTH } }, 91 { KE_KEY, 0x7E, { KEY_BLUETOOTH } },
90 { KE_KEY, 0x82, { KEY_CAMERA } }, 92 { KE_KEY, 0x82, { KEY_CAMERA } },
91 { KE_KEY, 0x88, { KEY_RFKILL } }, 93 { KE_KEY, 0x88, { KEY_RFKILL } },
92 { KE_KEY, 0x8A, { KEY_PROG1 } }, 94 { KE_KEY, 0x8A, { KEY_PROG1 } },
93 { KE_KEY, 0x95, { KEY_MEDIA } }, 95 { KE_KEY, 0x95, { KEY_MEDIA } },
94 { KE_KEY, 0x99, { KEY_PHONE } }, 96 { KE_KEY, 0x99, { KEY_PHONE } },
95 { KE_KEY, 0xb5, { KEY_CALC } }, 97 { KE_KEY, 0xb5, { KEY_CALC } },
96 { KE_KEY, 0xc4, { KEY_KBDILLUMUP } }, 98 { KE_KEY, 0xc4, { KEY_KBDILLUMUP } },
97 { KE_KEY, 0xc5, { KEY_KBDILLUMDOWN } }, 99 { KE_KEY, 0xc5, { KEY_KBDILLUMDOWN } },
98 { KE_END, 0}, 100 { KE_END, 0},
99 }; 101 };
100 102
101 static struct asus_wmi_driver asus_nb_wmi_driver = { 103 static struct asus_wmi_driver asus_nb_wmi_driver = {
102 .name = ASUS_NB_WMI_FILE, 104 .name = ASUS_NB_WMI_FILE,
103 .owner = THIS_MODULE, 105 .owner = THIS_MODULE,
104 .event_guid = ASUS_NB_WMI_EVENT_GUID, 106 .event_guid = ASUS_NB_WMI_EVENT_GUID,
105 .keymap = asus_nb_wmi_keymap, 107 .keymap = asus_nb_wmi_keymap,
106 .input_name = "Asus WMI hotkeys", 108 .input_name = "Asus WMI hotkeys",
107 .input_phys = ASUS_NB_WMI_FILE "/input0", 109 .input_phys = ASUS_NB_WMI_FILE "/input0",
108 .detect_quirks = asus_nb_wmi_quirks, 110 .detect_quirks = asus_nb_wmi_quirks,
109 }; 111 };
110 112
111 113
112 static int __init asus_nb_wmi_init(void) 114 static int __init asus_nb_wmi_init(void)
113 { 115 {
114 return asus_wmi_register_driver(&asus_nb_wmi_driver); 116 return asus_wmi_register_driver(&asus_nb_wmi_driver);
115 } 117 }
116 118
117 static void __exit asus_nb_wmi_exit(void) 119 static void __exit asus_nb_wmi_exit(void)
118 { 120 {
119 asus_wmi_unregister_driver(&asus_nb_wmi_driver); 121 asus_wmi_unregister_driver(&asus_nb_wmi_driver);
120 } 122 }
121 123
122 module_init(asus_nb_wmi_init); 124 module_init(asus_nb_wmi_init);
123 module_exit(asus_nb_wmi_exit); 125 module_exit(asus_nb_wmi_exit);
124 126