hp-wmi.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616
  1. /*
  2. * HP WMI hotkeys
  3. *
  4. * Copyright (C) 2008 Red Hat <mjg@redhat.com>
  5. *
  6. * Portions based on wistron_btns.c:
  7. * Copyright (C) 2005 Miloslav Trmac <mitr@volny.cz>
  8. * Copyright (C) 2005 Bernhard Rosenkraenzer <bero@arklinux.org>
  9. * Copyright (C) 2005 Dmitry Torokhov <dtor@mail.ru>
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License as published by
  13. * the Free Software Foundation; either version 2 of the License, or
  14. * (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  24. */
  25. #include <linux/kernel.h>
  26. #include <linux/module.h>
  27. #include <linux/init.h>
  28. #include <linux/types.h>
  29. #include <linux/input.h>
  30. #include <acpi/acpi_drivers.h>
  31. #include <linux/platform_device.h>
  32. #include <linux/acpi.h>
  33. #include <linux/rfkill.h>
  34. #include <linux/string.h>
  35. MODULE_AUTHOR("Matthew Garrett <mjg59@srcf.ucam.org>");
  36. MODULE_DESCRIPTION("HP laptop WMI hotkeys driver");
  37. MODULE_LICENSE("GPL");
  38. MODULE_ALIAS("wmi:95F24279-4D7B-4334-9387-ACCDC67EF61C");
  39. MODULE_ALIAS("wmi:5FB7F034-2C63-45e9-BE91-3D44E2C707E4");
  40. #define HPWMI_EVENT_GUID "95F24279-4D7B-4334-9387-ACCDC67EF61C"
  41. #define HPWMI_BIOS_GUID "5FB7F034-2C63-45e9-BE91-3D44E2C707E4"
  42. #define HPWMI_DISPLAY_QUERY 0x1
  43. #define HPWMI_HDDTEMP_QUERY 0x2
  44. #define HPWMI_ALS_QUERY 0x3
  45. #define HPWMI_HARDWARE_QUERY 0x4
  46. #define HPWMI_WIRELESS_QUERY 0x5
  47. #define HPWMI_HOTKEY_QUERY 0xc
  48. enum hp_wmi_radio {
  49. HPWMI_WIFI = 0,
  50. HPWMI_BLUETOOTH = 1,
  51. HPWMI_WWAN = 2,
  52. };
  53. static int __init hp_wmi_bios_setup(struct platform_device *device);
  54. static int __exit hp_wmi_bios_remove(struct platform_device *device);
  55. static int hp_wmi_resume_handler(struct device *device);
  56. struct bios_args {
  57. u32 signature;
  58. u32 command;
  59. u32 commandtype;
  60. u32 datasize;
  61. u32 data;
  62. };
  63. struct bios_return {
  64. u32 sigpass;
  65. u32 return_code;
  66. u32 value;
  67. };
  68. struct key_entry {
  69. char type; /* See KE_* below */
  70. u16 code;
  71. u16 keycode;
  72. };
  73. enum { KE_KEY, KE_END };
  74. static struct key_entry hp_wmi_keymap[] = {
  75. {KE_KEY, 0x02, KEY_BRIGHTNESSUP},
  76. {KE_KEY, 0x03, KEY_BRIGHTNESSDOWN},
  77. {KE_KEY, 0x20e6, KEY_PROG1},
  78. {KE_KEY, 0x2142, KEY_MEDIA},
  79. {KE_KEY, 0x213b, KEY_INFO},
  80. {KE_KEY, 0x231b, KEY_HELP},
  81. {KE_END, 0}
  82. };
  83. static struct input_dev *hp_wmi_input_dev;
  84. static struct platform_device *hp_wmi_platform_dev;
  85. static struct rfkill *wifi_rfkill;
  86. static struct rfkill *bluetooth_rfkill;
  87. static struct rfkill *wwan_rfkill;
  88. static const struct dev_pm_ops hp_wmi_pm_ops = {
  89. .resume = hp_wmi_resume_handler,
  90. .restore = hp_wmi_resume_handler,
  91. };
  92. static struct platform_driver hp_wmi_driver = {
  93. .driver = {
  94. .name = "hp-wmi",
  95. .owner = THIS_MODULE,
  96. .pm = &hp_wmi_pm_ops,
  97. },
  98. .probe = hp_wmi_bios_setup,
  99. .remove = hp_wmi_bios_remove,
  100. };
  101. static int hp_wmi_perform_query(int query, int write, int value)
  102. {
  103. struct bios_return bios_return;
  104. acpi_status status;
  105. union acpi_object *obj;
  106. struct bios_args args = {
  107. .signature = 0x55434553,
  108. .command = write ? 0x2 : 0x1,
  109. .commandtype = query,
  110. .datasize = write ? 0x4 : 0,
  111. .data = value,
  112. };
  113. struct acpi_buffer input = { sizeof(struct bios_args), &args };
  114. struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL };
  115. status = wmi_evaluate_method(HPWMI_BIOS_GUID, 0, 0x3, &input, &output);
  116. obj = output.pointer;
  117. if (!obj)
  118. return -EINVAL;
  119. else if (obj->type != ACPI_TYPE_BUFFER) {
  120. kfree(obj);
  121. return -EINVAL;
  122. }
  123. bios_return = *((struct bios_return *)obj->buffer.pointer);
  124. kfree(obj);
  125. if (bios_return.return_code > 0)
  126. return bios_return.return_code * -1;
  127. else
  128. return bios_return.value;
  129. }
  130. static int hp_wmi_display_state(void)
  131. {
  132. return hp_wmi_perform_query(HPWMI_DISPLAY_QUERY, 0, 0);
  133. }
  134. static int hp_wmi_hddtemp_state(void)
  135. {
  136. return hp_wmi_perform_query(HPWMI_HDDTEMP_QUERY, 0, 0);
  137. }
  138. static int hp_wmi_als_state(void)
  139. {
  140. return hp_wmi_perform_query(HPWMI_ALS_QUERY, 0, 0);
  141. }
  142. static int hp_wmi_dock_state(void)
  143. {
  144. int ret = hp_wmi_perform_query(HPWMI_HARDWARE_QUERY, 0, 0);
  145. if (ret < 0)
  146. return ret;
  147. return ret & 0x1;
  148. }
  149. static int hp_wmi_tablet_state(void)
  150. {
  151. int ret = hp_wmi_perform_query(HPWMI_HARDWARE_QUERY, 0, 0);
  152. if (ret < 0)
  153. return ret;
  154. return (ret & 0x4) ? 1 : 0;
  155. }
  156. static int hp_wmi_set_block(void *data, bool blocked)
  157. {
  158. enum hp_wmi_radio r = (enum hp_wmi_radio) data;
  159. int query = BIT(r + 8) | ((!blocked) << r);
  160. return hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 1, query);
  161. }
  162. static const struct rfkill_ops hp_wmi_rfkill_ops = {
  163. .set_block = hp_wmi_set_block,
  164. };
  165. static bool hp_wmi_get_sw_state(enum hp_wmi_radio r)
  166. {
  167. int wireless = hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 0, 0);
  168. int mask = 0x200 << (r * 8);
  169. if (wireless & mask)
  170. return false;
  171. else
  172. return true;
  173. }
  174. static bool hp_wmi_get_hw_state(enum hp_wmi_radio r)
  175. {
  176. int wireless = hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 0, 0);
  177. int mask = 0x800 << (r * 8);
  178. if (wireless & mask)
  179. return false;
  180. else
  181. return true;
  182. }
  183. static ssize_t show_display(struct device *dev, struct device_attribute *attr,
  184. char *buf)
  185. {
  186. int value = hp_wmi_display_state();
  187. if (value < 0)
  188. return -EINVAL;
  189. return sprintf(buf, "%d\n", value);
  190. }
  191. static ssize_t show_hddtemp(struct device *dev, struct device_attribute *attr,
  192. char *buf)
  193. {
  194. int value = hp_wmi_hddtemp_state();
  195. if (value < 0)
  196. return -EINVAL;
  197. return sprintf(buf, "%d\n", value);
  198. }
  199. static ssize_t show_als(struct device *dev, struct device_attribute *attr,
  200. char *buf)
  201. {
  202. int value = hp_wmi_als_state();
  203. if (value < 0)
  204. return -EINVAL;
  205. return sprintf(buf, "%d\n", value);
  206. }
  207. static ssize_t show_dock(struct device *dev, struct device_attribute *attr,
  208. char *buf)
  209. {
  210. int value = hp_wmi_dock_state();
  211. if (value < 0)
  212. return -EINVAL;
  213. return sprintf(buf, "%d\n", value);
  214. }
  215. static ssize_t show_tablet(struct device *dev, struct device_attribute *attr,
  216. char *buf)
  217. {
  218. int value = hp_wmi_tablet_state();
  219. if (value < 0)
  220. return -EINVAL;
  221. return sprintf(buf, "%d\n", value);
  222. }
  223. static ssize_t set_als(struct device *dev, struct device_attribute *attr,
  224. const char *buf, size_t count)
  225. {
  226. u32 tmp = simple_strtoul(buf, NULL, 10);
  227. hp_wmi_perform_query(HPWMI_ALS_QUERY, 1, tmp);
  228. return count;
  229. }
  230. static DEVICE_ATTR(display, S_IRUGO, show_display, NULL);
  231. static DEVICE_ATTR(hddtemp, S_IRUGO, show_hddtemp, NULL);
  232. static DEVICE_ATTR(als, S_IRUGO | S_IWUSR, show_als, set_als);
  233. static DEVICE_ATTR(dock, S_IRUGO, show_dock, NULL);
  234. static DEVICE_ATTR(tablet, S_IRUGO, show_tablet, NULL);
  235. static struct key_entry *hp_wmi_get_entry_by_scancode(int code)
  236. {
  237. struct key_entry *key;
  238. for (key = hp_wmi_keymap; key->type != KE_END; key++)
  239. if (code == key->code)
  240. return key;
  241. return NULL;
  242. }
  243. static struct key_entry *hp_wmi_get_entry_by_keycode(int keycode)
  244. {
  245. struct key_entry *key;
  246. for (key = hp_wmi_keymap; key->type != KE_END; key++)
  247. if (key->type == KE_KEY && keycode == key->keycode)
  248. return key;
  249. return NULL;
  250. }
  251. static int hp_wmi_getkeycode(struct input_dev *dev, int scancode, int *keycode)
  252. {
  253. struct key_entry *key = hp_wmi_get_entry_by_scancode(scancode);
  254. if (key && key->type == KE_KEY) {
  255. *keycode = key->keycode;
  256. return 0;
  257. }
  258. return -EINVAL;
  259. }
  260. static int hp_wmi_setkeycode(struct input_dev *dev, int scancode, int keycode)
  261. {
  262. struct key_entry *key;
  263. int old_keycode;
  264. if (keycode < 0 || keycode > KEY_MAX)
  265. return -EINVAL;
  266. key = hp_wmi_get_entry_by_scancode(scancode);
  267. if (key && key->type == KE_KEY) {
  268. old_keycode = key->keycode;
  269. key->keycode = keycode;
  270. set_bit(keycode, dev->keybit);
  271. if (!hp_wmi_get_entry_by_keycode(old_keycode))
  272. clear_bit(old_keycode, dev->keybit);
  273. return 0;
  274. }
  275. return -EINVAL;
  276. }
  277. static void hp_wmi_notify(u32 value, void *context)
  278. {
  279. struct acpi_buffer response = { ACPI_ALLOCATE_BUFFER, NULL };
  280. static struct key_entry *key;
  281. union acpi_object *obj;
  282. int eventcode;
  283. wmi_get_event_data(value, &response);
  284. obj = (union acpi_object *)response.pointer;
  285. if (!obj || obj->type != ACPI_TYPE_BUFFER || obj->buffer.length != 8) {
  286. printk(KERN_INFO "HP WMI: Unknown response received\n");
  287. kfree(obj);
  288. return;
  289. }
  290. eventcode = *((u8 *) obj->buffer.pointer);
  291. kfree(obj);
  292. if (eventcode == 0x4)
  293. eventcode = hp_wmi_perform_query(HPWMI_HOTKEY_QUERY, 0,
  294. 0);
  295. key = hp_wmi_get_entry_by_scancode(eventcode);
  296. if (key) {
  297. switch (key->type) {
  298. case KE_KEY:
  299. input_report_key(hp_wmi_input_dev,
  300. key->keycode, 1);
  301. input_sync(hp_wmi_input_dev);
  302. input_report_key(hp_wmi_input_dev,
  303. key->keycode, 0);
  304. input_sync(hp_wmi_input_dev);
  305. break;
  306. }
  307. } else if (eventcode == 0x1) {
  308. input_report_switch(hp_wmi_input_dev, SW_DOCK,
  309. hp_wmi_dock_state());
  310. input_report_switch(hp_wmi_input_dev, SW_TABLET_MODE,
  311. hp_wmi_tablet_state());
  312. input_sync(hp_wmi_input_dev);
  313. } else if (eventcode == 0x5) {
  314. if (wifi_rfkill)
  315. rfkill_set_states(wifi_rfkill,
  316. hp_wmi_get_sw_state(HPWMI_WIFI),
  317. hp_wmi_get_hw_state(HPWMI_WIFI));
  318. if (bluetooth_rfkill)
  319. rfkill_set_states(bluetooth_rfkill,
  320. hp_wmi_get_sw_state(HPWMI_BLUETOOTH),
  321. hp_wmi_get_hw_state(HPWMI_BLUETOOTH));
  322. if (wwan_rfkill)
  323. rfkill_set_states(wwan_rfkill,
  324. hp_wmi_get_sw_state(HPWMI_WWAN),
  325. hp_wmi_get_hw_state(HPWMI_WWAN));
  326. } else
  327. printk(KERN_INFO "HP WMI: Unknown key pressed - %x\n",
  328. eventcode);
  329. kfree(obj);
  330. }
  331. static int __init hp_wmi_input_setup(void)
  332. {
  333. struct key_entry *key;
  334. int err;
  335. hp_wmi_input_dev = input_allocate_device();
  336. hp_wmi_input_dev->name = "HP WMI hotkeys";
  337. hp_wmi_input_dev->phys = "wmi/input0";
  338. hp_wmi_input_dev->id.bustype = BUS_HOST;
  339. hp_wmi_input_dev->getkeycode = hp_wmi_getkeycode;
  340. hp_wmi_input_dev->setkeycode = hp_wmi_setkeycode;
  341. for (key = hp_wmi_keymap; key->type != KE_END; key++) {
  342. switch (key->type) {
  343. case KE_KEY:
  344. set_bit(EV_KEY, hp_wmi_input_dev->evbit);
  345. set_bit(key->keycode, hp_wmi_input_dev->keybit);
  346. break;
  347. }
  348. }
  349. set_bit(EV_SW, hp_wmi_input_dev->evbit);
  350. set_bit(SW_DOCK, hp_wmi_input_dev->swbit);
  351. set_bit(SW_TABLET_MODE, hp_wmi_input_dev->swbit);
  352. /* Set initial hardware state */
  353. input_report_switch(hp_wmi_input_dev, SW_DOCK, hp_wmi_dock_state());
  354. input_report_switch(hp_wmi_input_dev, SW_TABLET_MODE,
  355. hp_wmi_tablet_state());
  356. input_sync(hp_wmi_input_dev);
  357. err = input_register_device(hp_wmi_input_dev);
  358. if (err) {
  359. input_free_device(hp_wmi_input_dev);
  360. return err;
  361. }
  362. return 0;
  363. }
  364. static void cleanup_sysfs(struct platform_device *device)
  365. {
  366. device_remove_file(&device->dev, &dev_attr_display);
  367. device_remove_file(&device->dev, &dev_attr_hddtemp);
  368. device_remove_file(&device->dev, &dev_attr_als);
  369. device_remove_file(&device->dev, &dev_attr_dock);
  370. device_remove_file(&device->dev, &dev_attr_tablet);
  371. }
  372. static int __init hp_wmi_bios_setup(struct platform_device *device)
  373. {
  374. int err;
  375. int wireless = hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 0, 0);
  376. err = device_create_file(&device->dev, &dev_attr_display);
  377. if (err)
  378. goto add_sysfs_error;
  379. err = device_create_file(&device->dev, &dev_attr_hddtemp);
  380. if (err)
  381. goto add_sysfs_error;
  382. err = device_create_file(&device->dev, &dev_attr_als);
  383. if (err)
  384. goto add_sysfs_error;
  385. err = device_create_file(&device->dev, &dev_attr_dock);
  386. if (err)
  387. goto add_sysfs_error;
  388. err = device_create_file(&device->dev, &dev_attr_tablet);
  389. if (err)
  390. goto add_sysfs_error;
  391. if (wireless & 0x1) {
  392. wifi_rfkill = rfkill_alloc("hp-wifi", &device->dev,
  393. RFKILL_TYPE_WLAN,
  394. &hp_wmi_rfkill_ops,
  395. (void *) HPWMI_WIFI);
  396. rfkill_init_sw_state(wifi_rfkill,
  397. hp_wmi_get_sw_state(HPWMI_WIFI));
  398. rfkill_set_hw_state(wifi_rfkill,
  399. hp_wmi_get_hw_state(HPWMI_WIFI));
  400. err = rfkill_register(wifi_rfkill);
  401. if (err)
  402. goto register_wifi_error;
  403. }
  404. if (wireless & 0x2) {
  405. bluetooth_rfkill = rfkill_alloc("hp-bluetooth", &device->dev,
  406. RFKILL_TYPE_BLUETOOTH,
  407. &hp_wmi_rfkill_ops,
  408. (void *) HPWMI_BLUETOOTH);
  409. rfkill_init_sw_state(bluetooth_rfkill,
  410. hp_wmi_get_sw_state(HPWMI_BLUETOOTH));
  411. rfkill_set_hw_state(bluetooth_rfkill,
  412. hp_wmi_get_hw_state(HPWMI_BLUETOOTH));
  413. err = rfkill_register(bluetooth_rfkill);
  414. if (err)
  415. goto register_bluetooth_error;
  416. }
  417. if (wireless & 0x4) {
  418. wwan_rfkill = rfkill_alloc("hp-wwan", &device->dev,
  419. RFKILL_TYPE_WWAN,
  420. &hp_wmi_rfkill_ops,
  421. (void *) HPWMI_WWAN);
  422. rfkill_init_sw_state(wwan_rfkill,
  423. hp_wmi_get_sw_state(HPWMI_WWAN));
  424. rfkill_set_hw_state(wwan_rfkill,
  425. hp_wmi_get_hw_state(HPWMI_WWAN));
  426. err = rfkill_register(wwan_rfkill);
  427. if (err)
  428. goto register_wwan_err;
  429. }
  430. return 0;
  431. register_wwan_err:
  432. rfkill_destroy(wwan_rfkill);
  433. if (bluetooth_rfkill)
  434. rfkill_unregister(bluetooth_rfkill);
  435. register_bluetooth_error:
  436. rfkill_destroy(bluetooth_rfkill);
  437. if (wifi_rfkill)
  438. rfkill_unregister(wifi_rfkill);
  439. register_wifi_error:
  440. rfkill_destroy(wifi_rfkill);
  441. add_sysfs_error:
  442. cleanup_sysfs(device);
  443. return err;
  444. }
  445. static int __exit hp_wmi_bios_remove(struct platform_device *device)
  446. {
  447. cleanup_sysfs(device);
  448. if (wifi_rfkill) {
  449. rfkill_unregister(wifi_rfkill);
  450. rfkill_destroy(wifi_rfkill);
  451. }
  452. if (bluetooth_rfkill) {
  453. rfkill_unregister(bluetooth_rfkill);
  454. rfkill_destroy(bluetooth_rfkill);
  455. }
  456. if (wwan_rfkill) {
  457. rfkill_unregister(wwan_rfkill);
  458. rfkill_destroy(wwan_rfkill);
  459. }
  460. return 0;
  461. }
  462. static int hp_wmi_resume_handler(struct device *device)
  463. {
  464. /*
  465. * Hardware state may have changed while suspended, so trigger
  466. * input events for the current state. As this is a switch,
  467. * the input layer will only actually pass it on if the state
  468. * changed.
  469. */
  470. if (hp_wmi_input_dev) {
  471. input_report_switch(hp_wmi_input_dev, SW_DOCK,
  472. hp_wmi_dock_state());
  473. input_report_switch(hp_wmi_input_dev, SW_TABLET_MODE,
  474. hp_wmi_tablet_state());
  475. input_sync(hp_wmi_input_dev);
  476. }
  477. if (wifi_rfkill)
  478. rfkill_set_states(wifi_rfkill,
  479. hp_wmi_get_sw_state(HPWMI_WIFI),
  480. hp_wmi_get_hw_state(HPWMI_WIFI));
  481. if (bluetooth_rfkill)
  482. rfkill_set_states(bluetooth_rfkill,
  483. hp_wmi_get_sw_state(HPWMI_BLUETOOTH),
  484. hp_wmi_get_hw_state(HPWMI_BLUETOOTH));
  485. if (wwan_rfkill)
  486. rfkill_set_states(wwan_rfkill,
  487. hp_wmi_get_sw_state(HPWMI_WWAN),
  488. hp_wmi_get_hw_state(HPWMI_WWAN));
  489. return 0;
  490. }
  491. static int __init hp_wmi_init(void)
  492. {
  493. int err;
  494. if (wmi_has_guid(HPWMI_EVENT_GUID)) {
  495. err = wmi_install_notify_handler(HPWMI_EVENT_GUID,
  496. hp_wmi_notify, NULL);
  497. if (!err)
  498. hp_wmi_input_setup();
  499. }
  500. if (wmi_has_guid(HPWMI_BIOS_GUID)) {
  501. err = platform_driver_register(&hp_wmi_driver);
  502. if (err)
  503. return 0;
  504. hp_wmi_platform_dev = platform_device_alloc("hp-wmi", -1);
  505. if (!hp_wmi_platform_dev) {
  506. platform_driver_unregister(&hp_wmi_driver);
  507. return 0;
  508. }
  509. platform_device_add(hp_wmi_platform_dev);
  510. }
  511. return 0;
  512. }
  513. static void __exit hp_wmi_exit(void)
  514. {
  515. if (wmi_has_guid(HPWMI_EVENT_GUID)) {
  516. wmi_remove_notify_handler(HPWMI_EVENT_GUID);
  517. input_unregister_device(hp_wmi_input_dev);
  518. }
  519. if (hp_wmi_platform_dev) {
  520. platform_device_del(hp_wmi_platform_dev);
  521. platform_driver_unregister(&hp_wmi_driver);
  522. }
  523. }
  524. module_init(hp_wmi_init);
  525. module_exit(hp_wmi_exit);