asus-nb-wmi.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560
  1. /*
  2. * Asus Notebooks WMI hotkey driver
  3. *
  4. * Copyright(C) 2010 Corentin Chary <corentin.chary@gmail.com>
  5. *
  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
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  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
  18. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19. */
  20. #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
  21. #include <linux/kernel.h>
  22. #include <linux/module.h>
  23. #include <linux/init.h>
  24. #include <linux/input.h>
  25. #include <linux/input/sparse-keymap.h>
  26. #include <linux/fb.h>
  27. #include <linux/dmi.h>
  28. #include <linux/i8042.h>
  29. #include "asus-wmi.h"
  30. #define ASUS_NB_WMI_FILE "asus-nb-wmi"
  31. MODULE_AUTHOR("Corentin Chary <corentin.chary@gmail.com>");
  32. MODULE_DESCRIPTION("Asus Notebooks WMI Hotkey Driver");
  33. MODULE_LICENSE("GPL");
  34. #define ASUS_NB_WMI_EVENT_GUID "0B3CBB35-E3C2-45ED-91C2-4C5A6D195D1C"
  35. MODULE_ALIAS("wmi:"ASUS_NB_WMI_EVENT_GUID);
  36. /*
  37. * WAPF defines the behavior of the Fn+Fx wlan key
  38. * The significance of values is yet to be found, but
  39. * most of the time:
  40. * Bit | Bluetooth | WLAN
  41. * 0 | Hardware | Hardware
  42. * 1 | Hardware | Software
  43. * 4 | Software | Software
  44. */
  45. static int wapf = -1;
  46. module_param(wapf, uint, 0444);
  47. MODULE_PARM_DESC(wapf, "WAPF value");
  48. static struct quirk_entry *quirks;
  49. static bool asus_q500a_i8042_filter(unsigned char data, unsigned char str,
  50. struct serio *port)
  51. {
  52. static bool extended;
  53. bool ret = false;
  54. if (str & I8042_STR_AUXDATA)
  55. return false;
  56. if (unlikely(data == 0xe1)) {
  57. extended = true;
  58. ret = true;
  59. } else if (unlikely(extended)) {
  60. extended = false;
  61. ret = true;
  62. }
  63. return ret;
  64. }
  65. static struct quirk_entry quirk_asus_unknown = {
  66. .wapf = 0,
  67. };
  68. static struct quirk_entry quirk_asus_q500a = {
  69. .i8042_filter = asus_q500a_i8042_filter,
  70. };
  71. /*
  72. * For those machines that need software to control bt/wifi status
  73. * and can't adjust brightness through ACPI interface
  74. * and have duplicate events(ACPI and WMI) for display toggle
  75. */
  76. static struct quirk_entry quirk_asus_x55u = {
  77. .wapf = 4,
  78. .wmi_backlight_power = true,
  79. .no_display_toggle = true,
  80. };
  81. static struct quirk_entry quirk_asus_wapf4 = {
  82. .wapf = 4,
  83. };
  84. static struct quirk_entry quirk_asus_x200ca = {
  85. .wapf = 2,
  86. };
  87. static struct quirk_entry quirk_no_rfkill = {
  88. .no_rfkill = true,
  89. };
  90. static struct quirk_entry quirk_no_rfkill_wapf4 = {
  91. .wapf = 4,
  92. .no_rfkill = true,
  93. };
  94. static struct quirk_entry quirk_asus_ux303ub = {
  95. .wmi_backlight_native = true,
  96. };
  97. static struct quirk_entry quirk_asus_x550lb = {
  98. .xusb2pr = 0x01D9,
  99. };
  100. static struct quirk_entry quirk_asus_ux330uak = {
  101. .wmi_force_als_set = true,
  102. };
  103. static int dmi_matched(const struct dmi_system_id *dmi)
  104. {
  105. quirks = dmi->driver_data;
  106. return 1;
  107. }
  108. static const struct dmi_system_id asus_quirks[] = {
  109. {
  110. .callback = dmi_matched,
  111. .ident = "ASUSTeK COMPUTER INC. Q500A",
  112. .matches = {
  113. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  114. DMI_MATCH(DMI_PRODUCT_NAME, "Q500A"),
  115. },
  116. .driver_data = &quirk_asus_q500a,
  117. },
  118. {
  119. .callback = dmi_matched,
  120. .ident = "ASUSTeK COMPUTER INC. U32U",
  121. .matches = {
  122. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."),
  123. DMI_MATCH(DMI_PRODUCT_NAME, "U32U"),
  124. },
  125. /*
  126. * Note this machine has a Brazos APU, and most Brazos Asus
  127. * machines need quirk_asus_x55u / wmi_backlight_power but
  128. * here acpi-video seems to work fine for backlight control.
  129. */
  130. .driver_data = &quirk_asus_wapf4,
  131. },
  132. {
  133. .callback = dmi_matched,
  134. .ident = "ASUSTeK COMPUTER INC. X302UA",
  135. .matches = {
  136. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  137. DMI_MATCH(DMI_PRODUCT_NAME, "X302UA"),
  138. },
  139. .driver_data = &quirk_asus_wapf4,
  140. },
  141. {
  142. .callback = dmi_matched,
  143. .ident = "ASUSTeK COMPUTER INC. X401U",
  144. .matches = {
  145. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  146. DMI_MATCH(DMI_PRODUCT_NAME, "X401U"),
  147. },
  148. .driver_data = &quirk_asus_x55u,
  149. },
  150. {
  151. .callback = dmi_matched,
  152. .ident = "ASUSTeK COMPUTER INC. X401A",
  153. .matches = {
  154. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  155. DMI_MATCH(DMI_PRODUCT_NAME, "X401A"),
  156. },
  157. .driver_data = &quirk_asus_wapf4,
  158. },
  159. {
  160. .callback = dmi_matched,
  161. .ident = "ASUSTeK COMPUTER INC. X401A1",
  162. .matches = {
  163. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  164. DMI_MATCH(DMI_PRODUCT_NAME, "X401A1"),
  165. },
  166. .driver_data = &quirk_asus_wapf4,
  167. },
  168. {
  169. .callback = dmi_matched,
  170. .ident = "ASUSTeK COMPUTER INC. X45U",
  171. .matches = {
  172. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  173. DMI_MATCH(DMI_PRODUCT_NAME, "X45U"),
  174. },
  175. .driver_data = &quirk_asus_wapf4,
  176. },
  177. {
  178. .callback = dmi_matched,
  179. .ident = "ASUSTeK COMPUTER INC. X456UA",
  180. .matches = {
  181. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  182. DMI_MATCH(DMI_PRODUCT_NAME, "X456UA"),
  183. },
  184. .driver_data = &quirk_no_rfkill_wapf4,
  185. },
  186. {
  187. .callback = dmi_matched,
  188. .ident = "ASUSTeK COMPUTER INC. X456UF",
  189. .matches = {
  190. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  191. DMI_MATCH(DMI_PRODUCT_NAME, "X456UF"),
  192. },
  193. .driver_data = &quirk_no_rfkill_wapf4,
  194. },
  195. {
  196. .callback = dmi_matched,
  197. .ident = "ASUSTeK COMPUTER INC. X501U",
  198. .matches = {
  199. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  200. DMI_MATCH(DMI_PRODUCT_NAME, "X501U"),
  201. },
  202. .driver_data = &quirk_asus_x55u,
  203. },
  204. {
  205. .callback = dmi_matched,
  206. .ident = "ASUSTeK COMPUTER INC. X501A",
  207. .matches = {
  208. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  209. DMI_MATCH(DMI_PRODUCT_NAME, "X501A"),
  210. },
  211. .driver_data = &quirk_asus_wapf4,
  212. },
  213. {
  214. .callback = dmi_matched,
  215. .ident = "ASUSTeK COMPUTER INC. X501A1",
  216. .matches = {
  217. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  218. DMI_MATCH(DMI_PRODUCT_NAME, "X501A1"),
  219. },
  220. .driver_data = &quirk_asus_wapf4,
  221. },
  222. {
  223. .callback = dmi_matched,
  224. .ident = "ASUSTeK COMPUTER INC. X550CA",
  225. .matches = {
  226. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  227. DMI_MATCH(DMI_PRODUCT_NAME, "X550CA"),
  228. },
  229. .driver_data = &quirk_asus_wapf4,
  230. },
  231. {
  232. .callback = dmi_matched,
  233. .ident = "ASUSTeK COMPUTER INC. X550CC",
  234. .matches = {
  235. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  236. DMI_MATCH(DMI_PRODUCT_NAME, "X550CC"),
  237. },
  238. .driver_data = &quirk_asus_wapf4,
  239. },
  240. {
  241. .callback = dmi_matched,
  242. .ident = "ASUSTeK COMPUTER INC. X550CL",
  243. .matches = {
  244. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  245. DMI_MATCH(DMI_PRODUCT_NAME, "X550CL"),
  246. },
  247. .driver_data = &quirk_asus_wapf4,
  248. },
  249. {
  250. .callback = dmi_matched,
  251. .ident = "ASUSTeK COMPUTER INC. X550VB",
  252. .matches = {
  253. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  254. DMI_MATCH(DMI_PRODUCT_NAME, "X550VB"),
  255. },
  256. .driver_data = &quirk_asus_wapf4,
  257. },
  258. {
  259. .callback = dmi_matched,
  260. .ident = "ASUSTeK COMPUTER INC. X551CA",
  261. .matches = {
  262. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  263. DMI_MATCH(DMI_PRODUCT_NAME, "X551CA"),
  264. },
  265. .driver_data = &quirk_asus_wapf4,
  266. },
  267. {
  268. .callback = dmi_matched,
  269. .ident = "ASUSTeK COMPUTER INC. X55A",
  270. .matches = {
  271. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  272. DMI_MATCH(DMI_PRODUCT_NAME, "X55A"),
  273. },
  274. .driver_data = &quirk_asus_wapf4,
  275. },
  276. {
  277. .callback = dmi_matched,
  278. .ident = "ASUSTeK COMPUTER INC. X55C",
  279. .matches = {
  280. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  281. DMI_MATCH(DMI_PRODUCT_NAME, "X55C"),
  282. },
  283. .driver_data = &quirk_asus_wapf4,
  284. },
  285. {
  286. .callback = dmi_matched,
  287. .ident = "ASUSTeK COMPUTER INC. X55U",
  288. .matches = {
  289. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  290. DMI_MATCH(DMI_PRODUCT_NAME, "X55U"),
  291. },
  292. .driver_data = &quirk_asus_x55u,
  293. },
  294. {
  295. .callback = dmi_matched,
  296. .ident = "ASUSTeK COMPUTER INC. X55VD",
  297. .matches = {
  298. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  299. DMI_MATCH(DMI_PRODUCT_NAME, "X55VD"),
  300. },
  301. .driver_data = &quirk_asus_wapf4,
  302. },
  303. {
  304. .callback = dmi_matched,
  305. .ident = "ASUSTeK COMPUTER INC. X75A",
  306. .matches = {
  307. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  308. DMI_MATCH(DMI_PRODUCT_NAME, "X75A"),
  309. },
  310. .driver_data = &quirk_asus_wapf4,
  311. },
  312. {
  313. .callback = dmi_matched,
  314. .ident = "ASUSTeK COMPUTER INC. X75VBP",
  315. .matches = {
  316. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  317. DMI_MATCH(DMI_PRODUCT_NAME, "X75VBP"),
  318. },
  319. .driver_data = &quirk_asus_wapf4,
  320. },
  321. {
  322. .callback = dmi_matched,
  323. .ident = "ASUSTeK COMPUTER INC. X75VD",
  324. .matches = {
  325. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  326. DMI_MATCH(DMI_PRODUCT_NAME, "X75VD"),
  327. },
  328. .driver_data = &quirk_asus_wapf4,
  329. },
  330. {
  331. .callback = dmi_matched,
  332. .ident = "ASUSTeK COMPUTER INC. 1015E",
  333. .matches = {
  334. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  335. DMI_MATCH(DMI_PRODUCT_NAME, "1015E"),
  336. },
  337. .driver_data = &quirk_asus_wapf4,
  338. },
  339. {
  340. .callback = dmi_matched,
  341. .ident = "ASUSTeK COMPUTER INC. 1015U",
  342. .matches = {
  343. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  344. DMI_MATCH(DMI_PRODUCT_NAME, "1015U"),
  345. },
  346. .driver_data = &quirk_asus_wapf4,
  347. },
  348. {
  349. .callback = dmi_matched,
  350. .ident = "ASUSTeK COMPUTER INC. X200CA",
  351. .matches = {
  352. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  353. DMI_MATCH(DMI_PRODUCT_NAME, "X200CA"),
  354. },
  355. .driver_data = &quirk_asus_x200ca,
  356. },
  357. {
  358. .callback = dmi_matched,
  359. .ident = "ASUSTeK COMPUTER INC. X555UB",
  360. .matches = {
  361. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  362. DMI_MATCH(DMI_PRODUCT_NAME, "X555UB"),
  363. },
  364. .driver_data = &quirk_no_rfkill,
  365. },
  366. {
  367. .callback = dmi_matched,
  368. .ident = "ASUSTeK COMPUTER INC. N552VW",
  369. .matches = {
  370. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  371. DMI_MATCH(DMI_PRODUCT_NAME, "N552VW"),
  372. },
  373. .driver_data = &quirk_no_rfkill,
  374. },
  375. {
  376. .callback = dmi_matched,
  377. .ident = "ASUSTeK COMPUTER INC. U303LB",
  378. .matches = {
  379. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  380. DMI_MATCH(DMI_PRODUCT_NAME, "U303LB"),
  381. },
  382. .driver_data = &quirk_no_rfkill,
  383. },
  384. {
  385. .callback = dmi_matched,
  386. .ident = "ASUSTeK COMPUTER INC. Z550MA",
  387. .matches = {
  388. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  389. DMI_MATCH(DMI_PRODUCT_NAME, "Z550MA"),
  390. },
  391. .driver_data = &quirk_no_rfkill,
  392. },
  393. {
  394. .callback = dmi_matched,
  395. .ident = "ASUSTeK COMPUTER INC. UX303UB",
  396. .matches = {
  397. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  398. DMI_MATCH(DMI_PRODUCT_NAME, "UX303UB"),
  399. },
  400. .driver_data = &quirk_asus_ux303ub,
  401. },
  402. {
  403. .callback = dmi_matched,
  404. .ident = "ASUSTeK COMPUTER INC. UX330UAK",
  405. .matches = {
  406. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  407. DMI_MATCH(DMI_PRODUCT_NAME, "UX330UAK"),
  408. },
  409. .driver_data = &quirk_asus_ux330uak,
  410. },
  411. {
  412. .callback = dmi_matched,
  413. .ident = "ASUSTeK COMPUTER INC. X550LB",
  414. .matches = {
  415. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  416. DMI_MATCH(DMI_PRODUCT_NAME, "X550LB"),
  417. },
  418. .driver_data = &quirk_asus_x550lb,
  419. },
  420. {},
  421. };
  422. static void asus_nb_wmi_quirks(struct asus_wmi_driver *driver)
  423. {
  424. int ret;
  425. quirks = &quirk_asus_unknown;
  426. dmi_check_system(asus_quirks);
  427. driver->quirks = quirks;
  428. driver->panel_power = FB_BLANK_UNBLANK;
  429. /* overwrite the wapf setting if the wapf paramater is specified */
  430. if (wapf != -1)
  431. quirks->wapf = wapf;
  432. else
  433. wapf = quirks->wapf;
  434. if (quirks->i8042_filter) {
  435. ret = i8042_install_filter(quirks->i8042_filter);
  436. if (ret) {
  437. pr_warn("Unable to install key filter\n");
  438. return;
  439. }
  440. pr_info("Using i8042 filter function for receiving events\n");
  441. }
  442. }
  443. static const struct key_entry asus_nb_wmi_keymap[] = {
  444. { KE_KEY, ASUS_WMI_BRN_DOWN, { KEY_BRIGHTNESSDOWN } },
  445. { KE_KEY, ASUS_WMI_BRN_UP, { KEY_BRIGHTNESSUP } },
  446. { KE_KEY, 0x30, { KEY_VOLUMEUP } },
  447. { KE_KEY, 0x31, { KEY_VOLUMEDOWN } },
  448. { KE_KEY, 0x32, { KEY_MUTE } },
  449. { KE_KEY, 0x33, { KEY_DISPLAYTOGGLE } }, /* LCD on */
  450. { KE_KEY, 0x34, { KEY_DISPLAY_OFF } }, /* LCD off */
  451. { KE_KEY, 0x40, { KEY_PREVIOUSSONG } },
  452. { KE_KEY, 0x41, { KEY_NEXTSONG } },
  453. { KE_KEY, 0x43, { KEY_STOPCD } }, /* Stop/Eject */
  454. { KE_KEY, 0x45, { KEY_PLAYPAUSE } },
  455. { KE_KEY, 0x4c, { KEY_MEDIA } }, /* WMP Key */
  456. { KE_KEY, 0x50, { KEY_EMAIL } },
  457. { KE_KEY, 0x51, { KEY_WWW } },
  458. { KE_KEY, 0x55, { KEY_CALC } },
  459. { KE_IGNORE, 0x57, }, /* Battery mode */
  460. { KE_IGNORE, 0x58, }, /* AC mode */
  461. { KE_KEY, 0x5C, { KEY_F15 } }, /* Power Gear key */
  462. { KE_KEY, 0x5D, { KEY_WLAN } }, /* Wireless console Toggle */
  463. { KE_KEY, 0x5E, { KEY_WLAN } }, /* Wireless console Enable */
  464. { KE_KEY, 0x5F, { KEY_WLAN } }, /* Wireless console Disable */
  465. { KE_KEY, 0x60, { KEY_TOUCHPAD_ON } },
  466. { KE_KEY, 0x61, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD only */
  467. { KE_KEY, 0x62, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT only */
  468. { KE_KEY, 0x63, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT */
  469. { KE_KEY, 0x64, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV */
  470. { KE_KEY, 0x65, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV */
  471. { KE_KEY, 0x66, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV */
  472. { KE_KEY, 0x67, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV */
  473. { KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } },
  474. { KE_IGNORE, 0x6E, }, /* Low Battery notification */
  475. { KE_KEY, 0x7a, { KEY_ALS_TOGGLE } }, /* Ambient Light Sensor Toggle */
  476. { KE_KEY, 0x7D, { KEY_BLUETOOTH } }, /* Bluetooth Enable */
  477. { KE_KEY, 0x7E, { KEY_BLUETOOTH } }, /* Bluetooth Disable */
  478. { KE_KEY, 0x82, { KEY_CAMERA } },
  479. { KE_KEY, 0x88, { KEY_RFKILL } }, /* Radio Toggle Key */
  480. { KE_KEY, 0x8A, { KEY_PROG1 } }, /* Color enhancement mode */
  481. { KE_KEY, 0x8C, { KEY_SWITCHVIDEOMODE } }, /* SDSP DVI only */
  482. { KE_KEY, 0x8D, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + DVI */
  483. { KE_KEY, 0x8E, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + DVI */
  484. { KE_KEY, 0x8F, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV + DVI */
  485. { KE_KEY, 0x90, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + DVI */
  486. { KE_KEY, 0x91, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV + DVI */
  487. { KE_KEY, 0x92, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV + DVI */
  488. { KE_KEY, 0x93, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV + DVI */
  489. { KE_KEY, 0x95, { KEY_MEDIA } },
  490. { KE_KEY, 0x99, { KEY_PHONE } },
  491. { KE_KEY, 0xA0, { KEY_SWITCHVIDEOMODE } }, /* SDSP HDMI only */
  492. { KE_KEY, 0xA1, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + HDMI */
  493. { KE_KEY, 0xA2, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + HDMI */
  494. { KE_KEY, 0xA3, { KEY_SWITCHVIDEOMODE } }, /* SDSP TV + HDMI */
  495. { KE_KEY, 0xA4, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + HDMI */
  496. { KE_KEY, 0xA5, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV + HDMI */
  497. { KE_KEY, 0xA6, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV + HDMI */
  498. { KE_KEY, 0xA7, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV + HDMI */
  499. { KE_KEY, 0xB5, { KEY_CALC } },
  500. { KE_KEY, 0xC4, { KEY_KBDILLUMUP } },
  501. { KE_KEY, 0xC5, { KEY_KBDILLUMDOWN } },
  502. { KE_IGNORE, 0xC6, }, /* Ambient Light Sensor notification */
  503. { KE_END, 0},
  504. };
  505. static struct asus_wmi_driver asus_nb_wmi_driver = {
  506. .name = ASUS_NB_WMI_FILE,
  507. .owner = THIS_MODULE,
  508. .event_guid = ASUS_NB_WMI_EVENT_GUID,
  509. .keymap = asus_nb_wmi_keymap,
  510. .input_name = "Asus WMI hotkeys",
  511. .input_phys = ASUS_NB_WMI_FILE "/input0",
  512. .detect_quirks = asus_nb_wmi_quirks,
  513. };
  514. static int __init asus_nb_wmi_init(void)
  515. {
  516. return asus_wmi_register_driver(&asus_nb_wmi_driver);
  517. }
  518. static void __exit asus_nb_wmi_exit(void)
  519. {
  520. asus_wmi_unregister_driver(&asus_nb_wmi_driver);
  521. }
  522. module_init(asus_nb_wmi_init);
  523. module_exit(asus_nb_wmi_exit);