asus_acpi.c 34 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238
  1. /*
  2. * asus_acpi.c - Asus Laptop ACPI Extras
  3. *
  4. *
  5. * Copyright (C) 2002, 2003, 2004 Julien Lerouge, Karol Kozimor
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20. *
  21. *
  22. * The development page for this driver is located at
  23. * http://sourceforge.net/projects/acpi4asus/
  24. *
  25. * Credits:
  26. * Pontus Fuchs - Helper functions, cleanup
  27. * Johann Wiesner - Small compile fixes
  28. * John Belmonte - ACPI code for Toshiba laptop was a good starting point.
  29. *
  30. * TODO:
  31. * add Fn key status
  32. * Add mode selection on module loading (parameter) -> still necessary?
  33. * Complete display switching -- may require dirty hacks or calling _DOS?
  34. */
  35. #include <linux/kernel.h>
  36. #include <linux/module.h>
  37. #include <linux/init.h>
  38. #include <linux/types.h>
  39. #include <linux/proc_fs.h>
  40. #include <acpi/acpi_drivers.h>
  41. #include <acpi/acpi_bus.h>
  42. #include <asm/uaccess.h>
  43. #define ASUS_ACPI_VERSION "0.29"
  44. #define PROC_ASUS "asus" //the directory
  45. #define PROC_MLED "mled"
  46. #define PROC_WLED "wled"
  47. #define PROC_TLED "tled"
  48. #define PROC_INFO "info"
  49. #define PROC_LCD "lcd"
  50. #define PROC_BRN "brn"
  51. #define PROC_DISP "disp"
  52. #define ACPI_HOTK_NAME "Asus Laptop ACPI Extras Driver"
  53. #define ACPI_HOTK_CLASS "hotkey"
  54. #define ACPI_HOTK_DEVICE_NAME "Hotkey"
  55. #define ACPI_HOTK_HID "ATK0100"
  56. /*
  57. * Some events we use, same for all Asus
  58. */
  59. #define BR_UP 0x10
  60. #define BR_DOWN 0x20
  61. /*
  62. * Flags for hotk status
  63. */
  64. #define MLED_ON 0x01 //is MLED ON ?
  65. #define WLED_ON 0x02
  66. #define TLED_ON 0x04
  67. MODULE_AUTHOR("Julien Lerouge, Karol Kozimor");
  68. MODULE_DESCRIPTION(ACPI_HOTK_NAME);
  69. MODULE_LICENSE("GPL");
  70. static uid_t asus_uid;
  71. static gid_t asus_gid;
  72. module_param(asus_uid, uint, 0);
  73. MODULE_PARM_DESC(uid, "UID for entries in /proc/acpi/asus.\n");
  74. module_param(asus_gid, uint, 0);
  75. MODULE_PARM_DESC(gid, "GID for entries in /proc/acpi/asus.\n");
  76. /* For each model, all features implemented,
  77. * those marked with R are relative to HOTK, A for absolute */
  78. struct model_data {
  79. char *name; //name of the laptop________________A
  80. char *mt_mled; //method to handle mled_____________R
  81. char *mled_status; //node to handle mled reading_______A
  82. char *mt_wled; //method to handle wled_____________R
  83. char *wled_status; //node to handle wled reading_______A
  84. char *mt_tled; //method to handle tled_____________R
  85. char *tled_status; //node to handle tled reading_______A
  86. char *mt_lcd_switch; //method to turn LCD ON/OFF_________A
  87. char *lcd_status; //node to read LCD panel state______A
  88. char *brightness_up; //method to set brightness up_______A
  89. char *brightness_down; //guess what ?______________________A
  90. char *brightness_set; //method to set absolute brightness_R
  91. char *brightness_get; //method to get absolute brightness_R
  92. char *brightness_status; //node to get brightness____________A
  93. char *display_set; //method to set video output________R
  94. char *display_get; //method to get video output________R
  95. };
  96. /*
  97. * This is the main structure, we can use it to store anything interesting
  98. * about the hotk device
  99. */
  100. struct asus_hotk {
  101. struct acpi_device *device; //the device we are in
  102. acpi_handle handle; //the handle of the hotk device
  103. char status; //status of the hotk, for LEDs, ...
  104. struct model_data *methods; //methods available on the laptop
  105. u8 brightness; //brightness level
  106. enum {
  107. A1x = 0, //A1340D, A1300F
  108. A2x, //A2500H
  109. D1x, //D1
  110. L2D, //L2000D
  111. L3C, //L3800C
  112. L3D, //L3400D
  113. L3H, //L3H, but also L2000E
  114. L4R, //L4500R
  115. L5x, //L5800C
  116. L8L, //L8400L
  117. M1A, //M1300A
  118. M2E, //M2400E, L4400L
  119. M6N, //M6800N
  120. M6R, //M6700R
  121. P30, //Samsung P30
  122. S1x, //S1300A, but also L1400B and M2400A (L84F)
  123. S2x, //S200 (J1 reported), Victor MP-XP7210
  124. xxN, //M2400N, M3700N, M5200N, S1300N, S5200N, W1OOON
  125. //(Centrino)
  126. END_MODEL
  127. } model; //Models currently supported
  128. u16 event_count[128]; //count for each event TODO make this better
  129. };
  130. /* Here we go */
  131. #define A1x_PREFIX "\\_SB.PCI0.ISA.EC0."
  132. #define L3C_PREFIX "\\_SB.PCI0.PX40.ECD0."
  133. #define M1A_PREFIX "\\_SB.PCI0.PX40.EC0."
  134. #define P30_PREFIX "\\_SB.PCI0.LPCB.EC0."
  135. #define S1x_PREFIX "\\_SB.PCI0.PX40."
  136. #define S2x_PREFIX A1x_PREFIX
  137. #define xxN_PREFIX "\\_SB.PCI0.SBRG.EC0."
  138. static struct model_data model_conf[END_MODEL] = {
  139. /*
  140. * Those pathnames are relative to the HOTK / ATKD device :
  141. * - mt_mled
  142. * - mt_wled
  143. * - brightness_set
  144. * - brightness_get
  145. * - display_set
  146. * - display_get
  147. *
  148. * TODO I have seen a SWBX and AIBX method on some models, like L1400B,
  149. * it seems to be a kind of switch, but what for ?
  150. *
  151. */
  152. {
  153. .name = "A1x",
  154. .mt_mled = "MLED",
  155. .mled_status = "\\MAIL",
  156. .mt_lcd_switch = A1x_PREFIX "_Q10",
  157. .lcd_status = "\\BKLI",
  158. .brightness_up = A1x_PREFIX "_Q0E",
  159. .brightness_down = A1x_PREFIX "_Q0F"},
  160. {
  161. .name = "A2x",
  162. .mt_mled = "MLED",
  163. .mt_wled = "WLED",
  164. .wled_status = "\\SG66",
  165. .mt_lcd_switch = "\\Q10",
  166. .lcd_status = "\\BAOF",
  167. .brightness_set = "SPLV",
  168. .brightness_get = "GPLV",
  169. .display_set = "SDSP",
  170. .display_get = "\\INFB"},
  171. {
  172. .name = "D1x",
  173. .mt_mled = "MLED",
  174. .mt_lcd_switch = "\\Q0D",
  175. .lcd_status = "\\GP11",
  176. .brightness_up = "\\Q0C",
  177. .brightness_down = "\\Q0B",
  178. .brightness_status = "\\BLVL",
  179. .display_set = "SDSP",
  180. .display_get = "\\INFB"},
  181. {
  182. .name = "L2D",
  183. .mt_mled = "MLED",
  184. .mled_status = "\\SGP6",
  185. .mt_wled = "WLED",
  186. .wled_status = "\\RCP3",
  187. .mt_lcd_switch = "\\Q10",
  188. .lcd_status = "\\SGP0",
  189. .brightness_up = "\\Q0E",
  190. .brightness_down = "\\Q0F",
  191. .display_set = "SDSP",
  192. .display_get = "\\INFB"},
  193. {
  194. .name = "L3C",
  195. .mt_mled = "MLED",
  196. .mt_wled = "WLED",
  197. .mt_lcd_switch = L3C_PREFIX "_Q10",
  198. .lcd_status = "\\GL32",
  199. .brightness_set = "SPLV",
  200. .brightness_get = "GPLV",
  201. .display_set = "SDSP",
  202. .display_get = "\\_SB.PCI0.PCI1.VGAC.NMAP"},
  203. {
  204. .name = "L3D",
  205. .mt_mled = "MLED",
  206. .mled_status = "\\MALD",
  207. .mt_wled = "WLED",
  208. .mt_lcd_switch = "\\Q10",
  209. .lcd_status = "\\BKLG",
  210. .brightness_set = "SPLV",
  211. .brightness_get = "GPLV",
  212. .display_set = "SDSP",
  213. .display_get = "\\INFB"},
  214. {
  215. .name = "L3H",
  216. .mt_mled = "MLED",
  217. .mt_wled = "WLED",
  218. .mt_lcd_switch = "EHK",
  219. .lcd_status = "\\_SB.PCI0.PM.PBC",
  220. .brightness_set = "SPLV",
  221. .brightness_get = "GPLV",
  222. .display_set = "SDSP",
  223. .display_get = "\\INFB"},
  224. {
  225. .name = "L4R",
  226. .mt_mled = "MLED",
  227. .mt_wled = "WLED",
  228. .wled_status = "\\_SB.PCI0.SBRG.SG13",
  229. .mt_lcd_switch = xxN_PREFIX "_Q10",
  230. .lcd_status = "\\_SB.PCI0.SBSM.SEO4",
  231. .brightness_set = "SPLV",
  232. .brightness_get = "GPLV",
  233. .display_set = "SDSP",
  234. .display_get = "\\_SB.PCI0.P0P1.VGA.GETD"},
  235. {
  236. .name = "L5x",
  237. .mt_mled = "MLED",
  238. /* WLED present, but not controlled by ACPI */
  239. .mt_tled = "TLED",
  240. .mt_lcd_switch = "\\Q0D",
  241. .lcd_status = "\\BAOF",
  242. .brightness_set = "SPLV",
  243. .brightness_get = "GPLV",
  244. .display_set = "SDSP",
  245. .display_get = "\\INFB"},
  246. {
  247. .name = "L8L"
  248. /* No features, but at least support the hotkeys */
  249. },
  250. {
  251. .name = "M1A",
  252. .mt_mled = "MLED",
  253. .mt_lcd_switch = M1A_PREFIX "Q10",
  254. .lcd_status = "\\PNOF",
  255. .brightness_up = M1A_PREFIX "Q0E",
  256. .brightness_down = M1A_PREFIX "Q0F",
  257. .brightness_status = "\\BRIT",
  258. .display_set = "SDSP",
  259. .display_get = "\\INFB"},
  260. {
  261. .name = "M2E",
  262. .mt_mled = "MLED",
  263. .mt_wled = "WLED",
  264. .mt_lcd_switch = "\\Q10",
  265. .lcd_status = "\\GP06",
  266. .brightness_set = "SPLV",
  267. .brightness_get = "GPLV",
  268. .display_set = "SDSP",
  269. .display_get = "\\INFB"},
  270. {
  271. .name = "M6N",
  272. .mt_mled = "MLED",
  273. .mt_wled = "WLED",
  274. .wled_status = "\\_SB.PCI0.SBRG.SG13",
  275. .mt_lcd_switch = xxN_PREFIX "_Q10",
  276. .lcd_status = "\\_SB.BKLT",
  277. .brightness_set = "SPLV",
  278. .brightness_get = "GPLV",
  279. .display_set = "SDSP",
  280. .display_get = "\\SSTE"},
  281. {
  282. .name = "M6R",
  283. .mt_mled = "MLED",
  284. .mt_wled = "WLED",
  285. .mt_lcd_switch = xxN_PREFIX "_Q10",
  286. .lcd_status = "\\_SB.PCI0.SBSM.SEO4",
  287. .brightness_set = "SPLV",
  288. .brightness_get = "GPLV",
  289. .display_set = "SDSP",
  290. .display_get = "\\SSTE"},
  291. {
  292. .name = "P30",
  293. .mt_wled = "WLED",
  294. .mt_lcd_switch = P30_PREFIX "_Q0E",
  295. .lcd_status = "\\BKLT",
  296. .brightness_up = P30_PREFIX "_Q68",
  297. .brightness_down = P30_PREFIX "_Q69",
  298. .brightness_get = "GPLV",
  299. .display_set = "SDSP",
  300. .display_get = "\\DNXT"},
  301. {
  302. .name = "S1x",
  303. .mt_mled = "MLED",
  304. .mled_status = "\\EMLE",
  305. .mt_wled = "WLED",
  306. .mt_lcd_switch = S1x_PREFIX "Q10",
  307. .lcd_status = "\\PNOF",
  308. .brightness_set = "SPLV",
  309. .brightness_get = "GPLV"},
  310. {
  311. .name = "S2x",
  312. .mt_mled = "MLED",
  313. .mled_status = "\\MAIL",
  314. .mt_lcd_switch = S2x_PREFIX "_Q10",
  315. .lcd_status = "\\BKLI",
  316. .brightness_up = S2x_PREFIX "_Q0B",
  317. .brightness_down = S2x_PREFIX "_Q0A"},
  318. {
  319. .name = "xxN",
  320. .mt_mled = "MLED",
  321. /* WLED present, but not controlled by ACPI */
  322. .mt_lcd_switch = xxN_PREFIX "_Q10",
  323. .lcd_status = "\\BKLT",
  324. .brightness_set = "SPLV",
  325. .brightness_get = "GPLV",
  326. .display_set = "SDSP",
  327. .display_get = "\\ADVG"}
  328. };
  329. /* procdir we use */
  330. static struct proc_dir_entry *asus_proc_dir;
  331. /*
  332. * This header is made available to allow proper configuration given model,
  333. * revision number , ... this info cannot go in struct asus_hotk because it is
  334. * available before the hotk
  335. */
  336. static struct acpi_table_header *asus_info;
  337. /* The actual device the driver binds to */
  338. static struct asus_hotk *hotk;
  339. /*
  340. * The hotkey driver declaration
  341. */
  342. static int asus_hotk_add(struct acpi_device *device);
  343. static int asus_hotk_remove(struct acpi_device *device, int type);
  344. static struct acpi_driver asus_hotk_driver = {
  345. .name = ACPI_HOTK_NAME,
  346. .class = ACPI_HOTK_CLASS,
  347. .ids = ACPI_HOTK_HID,
  348. .ops = {
  349. .add = asus_hotk_add,
  350. .remove = asus_hotk_remove,
  351. },
  352. };
  353. /*
  354. * This function evaluates an ACPI method, given an int as parameter, the
  355. * method is searched within the scope of the handle, can be NULL. The output
  356. * of the method is written is output, which can also be NULL
  357. *
  358. * returns 1 if write is successful, 0 else.
  359. */
  360. static int write_acpi_int(acpi_handle handle, const char *method, int val,
  361. struct acpi_buffer *output)
  362. {
  363. struct acpi_object_list params; //list of input parameters (an int here)
  364. union acpi_object in_obj; //the only param we use
  365. acpi_status status;
  366. params.count = 1;
  367. params.pointer = &in_obj;
  368. in_obj.type = ACPI_TYPE_INTEGER;
  369. in_obj.integer.value = val;
  370. status = acpi_evaluate_object(handle, (char *)method, &params, output);
  371. return (status == AE_OK);
  372. }
  373. static int read_acpi_int(acpi_handle handle, const char *method, int *val)
  374. {
  375. struct acpi_buffer output;
  376. union acpi_object out_obj;
  377. acpi_status status;
  378. output.length = sizeof(out_obj);
  379. output.pointer = &out_obj;
  380. status = acpi_evaluate_object(handle, (char *)method, NULL, &output);
  381. *val = out_obj.integer.value;
  382. return (status == AE_OK) && (out_obj.type == ACPI_TYPE_INTEGER);
  383. }
  384. /*
  385. * We write our info in page, we begin at offset off and cannot write more
  386. * than count bytes. We set eof to 1 if we handle those 2 values. We return the
  387. * number of bytes written in page
  388. */
  389. static int
  390. proc_read_info(char *page, char **start, off_t off, int count, int *eof,
  391. void *data)
  392. {
  393. int len = 0;
  394. int temp;
  395. char buf[16]; //enough for all info
  396. /*
  397. * We use the easy way, we don't care of off and count, so we don't set eof
  398. * to 1
  399. */
  400. len += sprintf(page, ACPI_HOTK_NAME " " ASUS_ACPI_VERSION "\n");
  401. len += sprintf(page + len, "Model reference : %s\n",
  402. hotk->methods->name);
  403. /*
  404. * The SFUN method probably allows the original driver to get the list
  405. * of features supported by a given model. For now, 0x0100 or 0x0800
  406. * bit signifies that the laptop is equipped with a Wi-Fi MiniPCI card.
  407. * The significance of others is yet to be found.
  408. */
  409. if (read_acpi_int(hotk->handle, "SFUN", &temp))
  410. len +=
  411. sprintf(page + len, "SFUN value : 0x%04x\n", temp);
  412. /*
  413. * Another value for userspace: the ASYM method returns 0x02 for
  414. * battery low and 0x04 for battery critical, its readings tend to be
  415. * more accurate than those provided by _BST.
  416. * Note: since not all the laptops provide this method, errors are
  417. * silently ignored.
  418. */
  419. if (read_acpi_int(hotk->handle, "ASYM", &temp))
  420. len +=
  421. sprintf(page + len, "ASYM value : 0x%04x\n", temp);
  422. if (asus_info) {
  423. snprintf(buf, 16, "%d", asus_info->length);
  424. len += sprintf(page + len, "DSDT length : %s\n", buf);
  425. snprintf(buf, 16, "%d", asus_info->checksum);
  426. len += sprintf(page + len, "DSDT checksum : %s\n", buf);
  427. snprintf(buf, 16, "%d", asus_info->revision);
  428. len += sprintf(page + len, "DSDT revision : %s\n", buf);
  429. snprintf(buf, 7, "%s", asus_info->oem_id);
  430. len += sprintf(page + len, "OEM id : %s\n", buf);
  431. snprintf(buf, 9, "%s", asus_info->oem_table_id);
  432. len += sprintf(page + len, "OEM table id : %s\n", buf);
  433. snprintf(buf, 16, "%x", asus_info->oem_revision);
  434. len += sprintf(page + len, "OEM revision : 0x%s\n", buf);
  435. snprintf(buf, 5, "%s", asus_info->asl_compiler_id);
  436. len += sprintf(page + len, "ASL comp vendor id : %s\n", buf);
  437. snprintf(buf, 16, "%x", asus_info->asl_compiler_revision);
  438. len += sprintf(page + len, "ASL comp revision : 0x%s\n", buf);
  439. }
  440. return len;
  441. }
  442. /*
  443. * /proc handlers
  444. * We write our info in page, we begin at offset off and cannot write more
  445. * than count bytes. We set eof to 1 if we handle those 2 values. We return the
  446. * number of bytes written in page
  447. */
  448. /* Generic LED functions */
  449. static int read_led(const char *ledname, int ledmask)
  450. {
  451. if (ledname) {
  452. int led_status;
  453. if (read_acpi_int(NULL, ledname, &led_status))
  454. return led_status;
  455. else
  456. printk(KERN_WARNING "Asus ACPI: Error reading LED "
  457. "status\n");
  458. }
  459. return (hotk->status & ledmask) ? 1 : 0;
  460. }
  461. static int parse_arg(const char __user * buf, unsigned long count, int *val)
  462. {
  463. char s[32];
  464. if (!count)
  465. return 0;
  466. if (count > 31)
  467. return -EINVAL;
  468. if (copy_from_user(s, buf, count))
  469. return -EFAULT;
  470. s[count] = 0;
  471. if (sscanf(s, "%i", val) != 1)
  472. return -EINVAL;
  473. return count;
  474. }
  475. /* FIXME: kill extraneous args so it can be called independently */
  476. static int
  477. write_led(const char __user * buffer, unsigned long count,
  478. char *ledname, int ledmask, int invert)
  479. {
  480. int value;
  481. int led_out = 0;
  482. count = parse_arg(buffer, count, &value);
  483. if (count > 0)
  484. led_out = value ? 1 : 0;
  485. hotk->status =
  486. (led_out) ? (hotk->status | ledmask) : (hotk->status & ~ledmask);
  487. if (invert) /* invert target value */
  488. led_out = !led_out & 0x1;
  489. if (!write_acpi_int(hotk->handle, ledname, led_out, NULL))
  490. printk(KERN_WARNING "Asus ACPI: LED (%s) write failed\n",
  491. ledname);
  492. return count;
  493. }
  494. /*
  495. * Proc handlers for MLED
  496. */
  497. static int
  498. proc_read_mled(char *page, char **start, off_t off, int count, int *eof,
  499. void *data)
  500. {
  501. return sprintf(page, "%d\n",
  502. read_led(hotk->methods->mled_status, MLED_ON));
  503. }
  504. static int
  505. proc_write_mled(struct file *file, const char __user * buffer,
  506. unsigned long count, void *data)
  507. {
  508. return write_led(buffer, count, hotk->methods->mt_mled, MLED_ON, 1);
  509. }
  510. /*
  511. * Proc handlers for WLED
  512. */
  513. static int
  514. proc_read_wled(char *page, char **start, off_t off, int count, int *eof,
  515. void *data)
  516. {
  517. return sprintf(page, "%d\n",
  518. read_led(hotk->methods->wled_status, WLED_ON));
  519. }
  520. static int
  521. proc_write_wled(struct file *file, const char __user * buffer,
  522. unsigned long count, void *data)
  523. {
  524. return write_led(buffer, count, hotk->methods->mt_wled, WLED_ON, 0);
  525. }
  526. /*
  527. * Proc handlers for TLED
  528. */
  529. static int
  530. proc_read_tled(char *page, char **start, off_t off, int count, int *eof,
  531. void *data)
  532. {
  533. return sprintf(page, "%d\n",
  534. read_led(hotk->methods->tled_status, TLED_ON));
  535. }
  536. static int
  537. proc_write_tled(struct file *file, const char __user * buffer,
  538. unsigned long count, void *data)
  539. {
  540. return write_led(buffer, count, hotk->methods->mt_tled, TLED_ON, 0);
  541. }
  542. static int get_lcd_state(void)
  543. {
  544. int lcd = 0;
  545. if (hotk->model != L3H) {
  546. /* We don't have to check anything if we are here */
  547. if (!read_acpi_int(NULL, hotk->methods->lcd_status, &lcd))
  548. printk(KERN_WARNING
  549. "Asus ACPI: Error reading LCD status\n");
  550. if (hotk->model == L2D)
  551. lcd = ~lcd;
  552. } else { /* L3H and the like have to be handled differently */
  553. acpi_status status = 0;
  554. struct acpi_object_list input;
  555. union acpi_object mt_params[2];
  556. struct acpi_buffer output;
  557. union acpi_object out_obj;
  558. input.count = 2;
  559. input.pointer = mt_params;
  560. /* Note: the following values are partly guessed up, but
  561. otherwise they seem to work */
  562. mt_params[0].type = ACPI_TYPE_INTEGER;
  563. mt_params[0].integer.value = 0x02;
  564. mt_params[1].type = ACPI_TYPE_INTEGER;
  565. mt_params[1].integer.value = 0x02;
  566. output.length = sizeof(out_obj);
  567. output.pointer = &out_obj;
  568. status =
  569. acpi_evaluate_object(NULL, hotk->methods->lcd_status,
  570. &input, &output);
  571. if (status != AE_OK)
  572. return -1;
  573. if (out_obj.type == ACPI_TYPE_INTEGER)
  574. /* That's what the AML code does */
  575. lcd = out_obj.integer.value >> 8;
  576. }
  577. return (lcd & 1);
  578. }
  579. static int set_lcd_state(int value)
  580. {
  581. int lcd = 0;
  582. acpi_status status = 0;
  583. lcd = value ? 1 : 0;
  584. if (lcd != get_lcd_state()) {
  585. /* switch */
  586. if (hotk->model != L3H) {
  587. status =
  588. acpi_evaluate_object(NULL,
  589. hotk->methods->mt_lcd_switch,
  590. NULL, NULL);
  591. } else { /* L3H and the like have to be handled differently */
  592. if (!write_acpi_int
  593. (hotk->handle, hotk->methods->mt_lcd_switch, 0x07,
  594. NULL))
  595. status = AE_ERROR;
  596. /* L3H's AML executes EHK (0x07) upon Fn+F7 keypress,
  597. the exact behaviour is simulated here */
  598. }
  599. if (ACPI_FAILURE(status))
  600. printk(KERN_WARNING "Asus ACPI: Error switching LCD\n");
  601. }
  602. return 0;
  603. }
  604. static int
  605. proc_read_lcd(char *page, char **start, off_t off, int count, int *eof,
  606. void *data)
  607. {
  608. return sprintf(page, "%d\n", get_lcd_state());
  609. }
  610. static int
  611. proc_write_lcd(struct file *file, const char __user * buffer,
  612. unsigned long count, void *data)
  613. {
  614. int value;
  615. count = parse_arg(buffer, count, &value);
  616. if (count > 0)
  617. set_lcd_state(value);
  618. return count;
  619. }
  620. static int read_brightness(void)
  621. {
  622. int value;
  623. if (hotk->methods->brightness_get) { /* SPLV/GPLV laptop */
  624. if (!read_acpi_int(hotk->handle, hotk->methods->brightness_get,
  625. &value))
  626. printk(KERN_WARNING
  627. "Asus ACPI: Error reading brightness\n");
  628. } else if (hotk->methods->brightness_status) { /* For D1 for example */
  629. if (!read_acpi_int(NULL, hotk->methods->brightness_status,
  630. &value))
  631. printk(KERN_WARNING
  632. "Asus ACPI: Error reading brightness\n");
  633. } else /* No GPLV method */
  634. value = hotk->brightness;
  635. return value;
  636. }
  637. /*
  638. * Change the brightness level
  639. */
  640. static void set_brightness(int value)
  641. {
  642. acpi_status status = 0;
  643. /* SPLV laptop */
  644. if (hotk->methods->brightness_set) {
  645. if (!write_acpi_int(hotk->handle, hotk->methods->brightness_set,
  646. value, NULL))
  647. printk(KERN_WARNING
  648. "Asus ACPI: Error changing brightness\n");
  649. return;
  650. }
  651. /* No SPLV method if we are here, act as appropriate */
  652. value -= read_brightness();
  653. while (value != 0) {
  654. status = acpi_evaluate_object(NULL, (value > 0) ?
  655. hotk->methods->brightness_up :
  656. hotk->methods->brightness_down,
  657. NULL, NULL);
  658. (value > 0) ? value-- : value++;
  659. if (ACPI_FAILURE(status))
  660. printk(KERN_WARNING
  661. "Asus ACPI: Error changing brightness\n");
  662. }
  663. return;
  664. }
  665. static int
  666. proc_read_brn(char *page, char **start, off_t off, int count, int *eof,
  667. void *data)
  668. {
  669. return sprintf(page, "%d\n", read_brightness());
  670. }
  671. static int
  672. proc_write_brn(struct file *file, const char __user * buffer,
  673. unsigned long count, void *data)
  674. {
  675. int value;
  676. count = parse_arg(buffer, count, &value);
  677. if (count > 0) {
  678. value = (0 < value) ? ((15 < value) ? 15 : value) : 0;
  679. /* 0 <= value <= 15 */
  680. set_brightness(value);
  681. } else if (count < 0) {
  682. printk(KERN_WARNING "Asus ACPI: Error reading user input\n");
  683. }
  684. return count;
  685. }
  686. static void set_display(int value)
  687. {
  688. /* no sanity check needed for now */
  689. if (!write_acpi_int(hotk->handle, hotk->methods->display_set,
  690. value, NULL))
  691. printk(KERN_WARNING "Asus ACPI: Error setting display\n");
  692. return;
  693. }
  694. /*
  695. * Now, *this* one could be more user-friendly, but so far, no-one has
  696. * complained. The significance of bits is the same as in proc_write_disp()
  697. */
  698. static int
  699. proc_read_disp(char *page, char **start, off_t off, int count, int *eof,
  700. void *data)
  701. {
  702. int value = 0;
  703. if (!read_acpi_int(hotk->handle, hotk->methods->display_get, &value))
  704. printk(KERN_WARNING
  705. "Asus ACPI: Error reading display status\n");
  706. value &= 0x07; /* needed for some models, shouldn't hurt others */
  707. return sprintf(page, "%d\n", value);
  708. }
  709. /*
  710. * Experimental support for display switching. As of now: 1 should activate
  711. * the LCD output, 2 should do for CRT, and 4 for TV-Out. Any combination
  712. * (bitwise) of these will suffice. I never actually tested 3 displays hooked up
  713. * simultaneously, so be warned. See the acpi4asus README for more info.
  714. */
  715. static int
  716. proc_write_disp(struct file *file, const char __user * buffer,
  717. unsigned long count, void *data)
  718. {
  719. int value;
  720. count = parse_arg(buffer, count, &value);
  721. if (count > 0)
  722. set_display(value);
  723. else if (count < 0)
  724. printk(KERN_WARNING "Asus ACPI: Error reading user input\n");
  725. return count;
  726. }
  727. typedef int (proc_readfunc) (char *page, char **start, off_t off, int count,
  728. int *eof, void *data);
  729. typedef int (proc_writefunc) (struct file * file, const char __user * buffer,
  730. unsigned long count, void *data);
  731. static int
  732. __init asus_proc_add(char *name, proc_writefunc * writefunc,
  733. proc_readfunc * readfunc, mode_t mode,
  734. struct acpi_device *device)
  735. {
  736. struct proc_dir_entry *proc =
  737. create_proc_entry(name, mode, acpi_device_dir(device));
  738. if (!proc) {
  739. printk(KERN_WARNING " Unable to create %s fs entry\n", name);
  740. return -1;
  741. }
  742. proc->write_proc = writefunc;
  743. proc->read_proc = readfunc;
  744. proc->data = acpi_driver_data(device);
  745. proc->owner = THIS_MODULE;
  746. proc->uid = asus_uid;
  747. proc->gid = asus_gid;
  748. return 0;
  749. }
  750. static int __init asus_hotk_add_fs(struct acpi_device *device)
  751. {
  752. struct proc_dir_entry *proc;
  753. mode_t mode;
  754. /*
  755. * If parameter uid or gid is not changed, keep the default setting for
  756. * our proc entries (-rw-rw-rw-) else, it means we care about security,
  757. * and then set to -rw-rw----
  758. */
  759. if ((asus_uid == 0) && (asus_gid == 0)) {
  760. mode = S_IFREG | S_IRUGO | S_IWUGO;
  761. } else {
  762. mode = S_IFREG | S_IRUSR | S_IRGRP | S_IWUSR | S_IWGRP;
  763. }
  764. acpi_device_dir(device) = asus_proc_dir;
  765. if (!acpi_device_dir(device))
  766. return -ENODEV;
  767. proc = create_proc_entry(PROC_INFO, mode, acpi_device_dir(device));
  768. if (proc) {
  769. proc->read_proc = proc_read_info;
  770. proc->data = acpi_driver_data(device);
  771. proc->owner = THIS_MODULE;
  772. proc->uid = asus_uid;
  773. proc->gid = asus_gid;
  774. } else {
  775. printk(KERN_WARNING " Unable to create " PROC_INFO
  776. " fs entry\n");
  777. }
  778. if (hotk->methods->mt_wled) {
  779. asus_proc_add(PROC_WLED, &proc_write_wled, &proc_read_wled,
  780. mode, device);
  781. }
  782. if (hotk->methods->mt_mled) {
  783. asus_proc_add(PROC_MLED, &proc_write_mled, &proc_read_mled,
  784. mode, device);
  785. }
  786. if (hotk->methods->mt_tled) {
  787. asus_proc_add(PROC_TLED, &proc_write_tled, &proc_read_tled,
  788. mode, device);
  789. }
  790. /*
  791. * We need both read node and write method as LCD switch is also accessible
  792. * from keyboard
  793. */
  794. if (hotk->methods->mt_lcd_switch && hotk->methods->lcd_status) {
  795. asus_proc_add(PROC_LCD, &proc_write_lcd, &proc_read_lcd, mode,
  796. device);
  797. }
  798. if ((hotk->methods->brightness_up && hotk->methods->brightness_down) ||
  799. (hotk->methods->brightness_get && hotk->methods->brightness_set)) {
  800. asus_proc_add(PROC_BRN, &proc_write_brn, &proc_read_brn, mode,
  801. device);
  802. }
  803. if (hotk->methods->display_set) {
  804. asus_proc_add(PROC_DISP, &proc_write_disp, &proc_read_disp,
  805. mode, device);
  806. }
  807. return 0;
  808. }
  809. static int asus_hotk_remove_fs(struct acpi_device *device)
  810. {
  811. if (acpi_device_dir(device)) {
  812. remove_proc_entry(PROC_INFO, acpi_device_dir(device));
  813. if (hotk->methods->mt_wled)
  814. remove_proc_entry(PROC_WLED, acpi_device_dir(device));
  815. if (hotk->methods->mt_mled)
  816. remove_proc_entry(PROC_MLED, acpi_device_dir(device));
  817. if (hotk->methods->mt_tled)
  818. remove_proc_entry(PROC_TLED, acpi_device_dir(device));
  819. if (hotk->methods->mt_lcd_switch && hotk->methods->lcd_status)
  820. remove_proc_entry(PROC_LCD, acpi_device_dir(device));
  821. if ((hotk->methods->brightness_up
  822. && hotk->methods->brightness_down)
  823. || (hotk->methods->brightness_get
  824. && hotk->methods->brightness_set))
  825. remove_proc_entry(PROC_BRN, acpi_device_dir(device));
  826. if (hotk->methods->display_set)
  827. remove_proc_entry(PROC_DISP, acpi_device_dir(device));
  828. }
  829. return 0;
  830. }
  831. static void asus_hotk_notify(acpi_handle handle, u32 event, void *data)
  832. {
  833. /* TODO Find a better way to handle events count. */
  834. if (!hotk)
  835. return;
  836. if ((event & ~((u32) BR_UP)) < 16) {
  837. hotk->brightness = (event & ~((u32) BR_UP));
  838. } else if ((event & ~((u32) BR_DOWN)) < 16) {
  839. hotk->brightness = (event & ~((u32) BR_DOWN));
  840. }
  841. acpi_bus_generate_event(hotk->device, event,
  842. hotk->event_count[event % 128]++);
  843. return;
  844. }
  845. /*
  846. * This function is used to initialize the hotk with right values. In this
  847. * method, we can make all the detection we want, and modify the hotk struct
  848. */
  849. static int __init asus_hotk_get_info(void)
  850. {
  851. struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
  852. struct acpi_buffer dsdt = { ACPI_ALLOCATE_BUFFER, NULL };
  853. union acpi_object *model = NULL;
  854. int bsts_result;
  855. acpi_status status;
  856. /*
  857. * Get DSDT headers early enough to allow for differentiating between
  858. * models, but late enough to allow acpi_bus_register_driver() to fail
  859. * before doing anything ACPI-specific. Should we encounter a machine,
  860. * which needs special handling (i.e. its hotkey device has a different
  861. * HID), this bit will be moved. A global variable asus_info contains
  862. * the DSDT header.
  863. */
  864. status = acpi_get_table(ACPI_TABLE_DSDT, 1, &dsdt);
  865. if (ACPI_FAILURE(status))
  866. printk(KERN_WARNING " Couldn't get the DSDT table header\n");
  867. else
  868. asus_info = (struct acpi_table_header *)dsdt.pointer;
  869. /* We have to write 0 on init this far for all ASUS models */
  870. if (!write_acpi_int(hotk->handle, "INIT", 0, &buffer)) {
  871. printk(KERN_ERR " Hotkey initialization failed\n");
  872. return -ENODEV;
  873. }
  874. /* This needs to be called for some laptops to init properly */
  875. if (!read_acpi_int(hotk->handle, "BSTS", &bsts_result))
  876. printk(KERN_WARNING " Error calling BSTS\n");
  877. else if (bsts_result)
  878. printk(KERN_NOTICE " BSTS called, 0x%02x returned\n",
  879. bsts_result);
  880. /* Samsung P30 has a device with a valid _HID whose INIT does not
  881. * return anything. Catch this one and any similar here */
  882. if (buffer.pointer == NULL) {
  883. if (asus_info && /* Samsung P30 */
  884. strncmp(asus_info->oem_table_id, "ODEM", 4) == 0) {
  885. hotk->model = P30;
  886. printk(KERN_NOTICE
  887. " Samsung P30 detected, supported\n");
  888. } else {
  889. hotk->model = M2E;
  890. printk(KERN_WARNING " no string returned by INIT\n");
  891. printk(KERN_WARNING " trying default values, supply "
  892. "the developers with your DSDT\n");
  893. }
  894. hotk->methods = &model_conf[hotk->model];
  895. return AE_OK;
  896. }
  897. model = (union acpi_object *)buffer.pointer;
  898. if (model->type == ACPI_TYPE_STRING) {
  899. printk(KERN_NOTICE " %s model detected, ",
  900. model->string.pointer);
  901. }
  902. hotk->model = END_MODEL;
  903. if (strncmp(model->string.pointer, "L3D", 3) == 0)
  904. hotk->model = L3D;
  905. else if (strncmp(model->string.pointer, "L3H", 3) == 0 ||
  906. strncmp(model->string.pointer, "L2E", 3) == 0)
  907. hotk->model = L3H;
  908. else if (strncmp(model->string.pointer, "L3", 2) == 0 ||
  909. strncmp(model->string.pointer, "L2B", 3) == 0)
  910. hotk->model = L3C;
  911. else if (strncmp(model->string.pointer, "L8L", 3) == 0)
  912. hotk->model = L8L;
  913. else if (strncmp(model->string.pointer, "L4R", 3) == 0)
  914. hotk->model = L4R;
  915. else if (strncmp(model->string.pointer, "M6N", 3) == 0)
  916. hotk->model = M6N;
  917. else if (strncmp(model->string.pointer, "M6R", 3) == 0)
  918. hotk->model = M6R;
  919. else if (strncmp(model->string.pointer, "M2N", 3) == 0 ||
  920. strncmp(model->string.pointer, "M3N", 3) == 0 ||
  921. strncmp(model->string.pointer, "M5N", 3) == 0 ||
  922. strncmp(model->string.pointer, "M6N", 3) == 0 ||
  923. strncmp(model->string.pointer, "S1N", 3) == 0 ||
  924. strncmp(model->string.pointer, "S5N", 3) == 0 ||
  925. strncmp(model->string.pointer, "W1N", 3) == 0)
  926. hotk->model = xxN;
  927. else if (strncmp(model->string.pointer, "M1", 2) == 0)
  928. hotk->model = M1A;
  929. else if (strncmp(model->string.pointer, "M2", 2) == 0 ||
  930. strncmp(model->string.pointer, "L4E", 3) == 0)
  931. hotk->model = M2E;
  932. else if (strncmp(model->string.pointer, "L2", 2) == 0)
  933. hotk->model = L2D;
  934. else if (strncmp(model->string.pointer, "L8", 2) == 0)
  935. hotk->model = S1x;
  936. else if (strncmp(model->string.pointer, "D1", 2) == 0)
  937. hotk->model = D1x;
  938. else if (strncmp(model->string.pointer, "A1", 2) == 0)
  939. hotk->model = A1x;
  940. else if (strncmp(model->string.pointer, "A2", 2) == 0)
  941. hotk->model = A2x;
  942. else if (strncmp(model->string.pointer, "J1", 2) == 0)
  943. hotk->model = S2x;
  944. else if (strncmp(model->string.pointer, "L5", 2) == 0)
  945. hotk->model = L5x;
  946. if (hotk->model == END_MODEL) {
  947. printk("unsupported, trying default values, supply the "
  948. "developers with your DSDT\n");
  949. hotk->model = M2E;
  950. } else {
  951. printk("supported\n");
  952. }
  953. hotk->methods = &model_conf[hotk->model];
  954. /* Sort of per-model blacklist */
  955. if (strncmp(model->string.pointer, "L2B", 3) == 0)
  956. hotk->methods->lcd_status = NULL;
  957. /* L2B is similar enough to L3C to use its settings, with this only
  958. exception */
  959. else if (strncmp(model->string.pointer, "S5N", 3) == 0 ||
  960. strncmp(model->string.pointer, "M5N", 3) == 0)
  961. hotk->methods->mt_mled = NULL;
  962. /* S5N and M5N have no MLED */
  963. else if (strncmp(model->string.pointer, "M2N", 3) == 0 ||
  964. strncmp(model->string.pointer, "W1N", 3) == 0)
  965. hotk->methods->mt_wled = "WLED";
  966. /* M2N and W1N have a usable WLED */
  967. else if (asus_info) {
  968. if (strncmp(asus_info->oem_table_id, "L1", 2) == 0)
  969. hotk->methods->mled_status = NULL;
  970. /* S1300A reports L84F, but L1400B too, account for that */
  971. }
  972. acpi_os_free(model);
  973. return AE_OK;
  974. }
  975. static int __init asus_hotk_check(void)
  976. {
  977. int result = 0;
  978. result = acpi_bus_get_status(hotk->device);
  979. if (result)
  980. return result;
  981. if (hotk->device->status.present) {
  982. result = asus_hotk_get_info();
  983. } else {
  984. printk(KERN_ERR " Hotkey device not present, aborting\n");
  985. return -EINVAL;
  986. }
  987. return result;
  988. }
  989. static int __init asus_hotk_add(struct acpi_device *device)
  990. {
  991. acpi_status status = AE_OK;
  992. int result;
  993. if (!device)
  994. return -EINVAL;
  995. printk(KERN_NOTICE "Asus Laptop ACPI Extras version %s\n",
  996. ASUS_ACPI_VERSION);
  997. hotk =
  998. (struct asus_hotk *)kmalloc(sizeof(struct asus_hotk), GFP_KERNEL);
  999. if (!hotk)
  1000. return -ENOMEM;
  1001. memset(hotk, 0, sizeof(struct asus_hotk));
  1002. hotk->handle = device->handle;
  1003. strcpy(acpi_device_name(device), ACPI_HOTK_DEVICE_NAME);
  1004. strcpy(acpi_device_class(device), ACPI_HOTK_CLASS);
  1005. acpi_driver_data(device) = hotk;
  1006. hotk->device = device;
  1007. result = asus_hotk_check();
  1008. if (result)
  1009. goto end;
  1010. result = asus_hotk_add_fs(device);
  1011. if (result)
  1012. goto end;
  1013. /*
  1014. * We install the handler, it will receive the hotk in parameter, so, we
  1015. * could add other data to the hotk struct
  1016. */
  1017. status = acpi_install_notify_handler(hotk->handle, ACPI_SYSTEM_NOTIFY,
  1018. asus_hotk_notify, hotk);
  1019. if (ACPI_FAILURE(status))
  1020. printk(KERN_ERR " Error installing notify handler\n");
  1021. /* For laptops without GPLV: init the hotk->brightness value */
  1022. if ((!hotk->methods->brightness_get)
  1023. && (!hotk->methods->brightness_status)
  1024. && (hotk->methods->brightness_up
  1025. && hotk->methods->brightness_down)) {
  1026. status =
  1027. acpi_evaluate_object(NULL, hotk->methods->brightness_down,
  1028. NULL, NULL);
  1029. if (ACPI_FAILURE(status))
  1030. printk(KERN_WARNING " Error changing brightness\n");
  1031. else {
  1032. status =
  1033. acpi_evaluate_object(NULL,
  1034. hotk->methods->brightness_up,
  1035. NULL, NULL);
  1036. if (ACPI_FAILURE(status))
  1037. printk(KERN_WARNING " Strange, error changing"
  1038. " brightness\n");
  1039. }
  1040. }
  1041. end:
  1042. if (result) {
  1043. kfree(hotk);
  1044. }
  1045. return result;
  1046. }
  1047. static int asus_hotk_remove(struct acpi_device *device, int type)
  1048. {
  1049. acpi_status status = 0;
  1050. if (!device || !acpi_driver_data(device))
  1051. return -EINVAL;
  1052. status = acpi_remove_notify_handler(hotk->handle, ACPI_SYSTEM_NOTIFY,
  1053. asus_hotk_notify);
  1054. if (ACPI_FAILURE(status))
  1055. printk(KERN_ERR "Asus ACPI: Error removing notify handler\n");
  1056. asus_hotk_remove_fs(device);
  1057. kfree(hotk);
  1058. return 0;
  1059. }
  1060. static int __init asus_acpi_init(void)
  1061. {
  1062. int result;
  1063. if (acpi_disabled)
  1064. return -ENODEV;
  1065. if (!acpi_specific_hotkey_enabled) {
  1066. printk(KERN_ERR "Using generic hotkey driver\n");
  1067. return -ENODEV;
  1068. }
  1069. asus_proc_dir = proc_mkdir(PROC_ASUS, acpi_root_dir);
  1070. if (!asus_proc_dir) {
  1071. printk(KERN_ERR "Asus ACPI: Unable to create /proc entry\n");
  1072. return -ENODEV;
  1073. }
  1074. asus_proc_dir->owner = THIS_MODULE;
  1075. result = acpi_bus_register_driver(&asus_hotk_driver);
  1076. if (result < 1) {
  1077. acpi_bus_unregister_driver(&asus_hotk_driver);
  1078. remove_proc_entry(PROC_ASUS, acpi_root_dir);
  1079. return -ENODEV;
  1080. }
  1081. return 0;
  1082. }
  1083. static void __exit asus_acpi_exit(void)
  1084. {
  1085. acpi_bus_unregister_driver(&asus_hotk_driver);
  1086. remove_proc_entry(PROC_ASUS, acpi_root_dir);
  1087. acpi_os_free(asus_info);
  1088. return;
  1089. }
  1090. module_init(asus_acpi_init);
  1091. module_exit(asus_acpi_exit);