system.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649
  1. /*
  2. * acpi_system.c - ACPI System Driver ($Revision: 63 $)
  3. *
  4. * Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
  5. * Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
  6. *
  7. * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 2 of the License, or (at
  12. * your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful, but
  15. * WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License along
  20. * with this program; if not, write to the Free Software Foundation, Inc.,
  21. * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  22. *
  23. * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  24. */
  25. #include <linux/proc_fs.h>
  26. #include <linux/seq_file.h>
  27. #include <linux/init.h>
  28. #include <linux/string.h>
  29. #include <asm/uaccess.h>
  30. #include <acpi/acpi_drivers.h>
  31. #define _COMPONENT ACPI_SYSTEM_COMPONENT
  32. ACPI_MODULE_NAME("system");
  33. #ifdef MODULE_PARAM_PREFIX
  34. #undef MODULE_PARAM_PREFIX
  35. #endif
  36. #define MODULE_PARAM_PREFIX "acpi."
  37. #define ACPI_SYSTEM_CLASS "system"
  38. #define ACPI_SYSTEM_DEVICE_NAME "System"
  39. u32 acpi_irq_handled;
  40. /*
  41. * Make ACPICA version work as module param
  42. */
  43. static int param_get_acpica_version(char *buffer, struct kernel_param *kp)
  44. {
  45. int result;
  46. result = sprintf(buffer, "%x", ACPI_CA_VERSION);
  47. return result;
  48. }
  49. module_param_call(acpica_version, NULL, param_get_acpica_version, NULL, 0444);
  50. /* --------------------------------------------------------------------------
  51. FS Interface (/sys)
  52. -------------------------------------------------------------------------- */
  53. static LIST_HEAD(acpi_table_attr_list);
  54. static struct kobject *tables_kobj;
  55. struct acpi_table_attr {
  56. struct bin_attribute attr;
  57. char name[8];
  58. int instance;
  59. struct list_head node;
  60. };
  61. static ssize_t acpi_table_show(struct kobject *kobj,
  62. struct bin_attribute *bin_attr, char *buf,
  63. loff_t offset, size_t count)
  64. {
  65. struct acpi_table_attr *table_attr =
  66. container_of(bin_attr, struct acpi_table_attr, attr);
  67. struct acpi_table_header *table_header = NULL;
  68. acpi_status status;
  69. char name[ACPI_NAME_SIZE];
  70. if (strncmp(table_attr->name, "NULL", 4))
  71. memcpy(name, table_attr->name, ACPI_NAME_SIZE);
  72. else
  73. memcpy(name, "\0\0\0\0", 4);
  74. status =
  75. acpi_get_table(name, table_attr->instance,
  76. &table_header);
  77. if (ACPI_FAILURE(status))
  78. return -ENODEV;
  79. return memory_read_from_buffer(buf, count, &offset,
  80. table_header, table_header->length);
  81. }
  82. static void acpi_table_attr_init(struct acpi_table_attr *table_attr,
  83. struct acpi_table_header *table_header)
  84. {
  85. struct acpi_table_header *header = NULL;
  86. struct acpi_table_attr *attr = NULL;
  87. if (table_header->signature[0] != '\0')
  88. memcpy(table_attr->name, table_header->signature,
  89. ACPI_NAME_SIZE);
  90. else
  91. memcpy(table_attr->name, "NULL", 4);
  92. list_for_each_entry(attr, &acpi_table_attr_list, node) {
  93. if (!memcmp(table_attr->name, attr->name, ACPI_NAME_SIZE))
  94. if (table_attr->instance < attr->instance)
  95. table_attr->instance = attr->instance;
  96. }
  97. table_attr->instance++;
  98. if (table_attr->instance > 1 || (table_attr->instance == 1 &&
  99. !acpi_get_table
  100. (table_header->signature, 2, &header)))
  101. sprintf(table_attr->name + ACPI_NAME_SIZE, "%d",
  102. table_attr->instance);
  103. table_attr->attr.size = 0;
  104. table_attr->attr.read = acpi_table_show;
  105. table_attr->attr.attr.name = table_attr->name;
  106. table_attr->attr.attr.mode = 0444;
  107. return;
  108. }
  109. static int acpi_system_sysfs_init(void)
  110. {
  111. struct acpi_table_attr *table_attr;
  112. struct acpi_table_header *table_header = NULL;
  113. int table_index = 0;
  114. int result;
  115. tables_kobj = kobject_create_and_add("tables", acpi_kobj);
  116. if (!tables_kobj)
  117. return -ENOMEM;
  118. do {
  119. result = acpi_get_table_by_index(table_index, &table_header);
  120. if (!result) {
  121. table_index++;
  122. table_attr = NULL;
  123. table_attr =
  124. kzalloc(sizeof(struct acpi_table_attr), GFP_KERNEL);
  125. if (!table_attr)
  126. return -ENOMEM;
  127. acpi_table_attr_init(table_attr, table_header);
  128. result =
  129. sysfs_create_bin_file(tables_kobj,
  130. &table_attr->attr);
  131. if (result) {
  132. kfree(table_attr);
  133. return result;
  134. } else
  135. list_add_tail(&table_attr->node,
  136. &acpi_table_attr_list);
  137. }
  138. } while (!result);
  139. kobject_uevent(tables_kobj, KOBJ_ADD);
  140. return 0;
  141. }
  142. /*
  143. * Detailed ACPI IRQ counters in /sys/firmware/acpi/interrupts/
  144. * See Documentation/ABI/testing/sysfs-firmware-acpi
  145. */
  146. #define COUNT_GPE 0
  147. #define COUNT_SCI 1 /* acpi_irq_handled */
  148. #define COUNT_ERROR 2 /* other */
  149. #define NUM_COUNTERS_EXTRA 3
  150. struct event_counter {
  151. u32 count;
  152. u32 flags;
  153. };
  154. static struct event_counter *all_counters;
  155. static u32 num_gpes;
  156. static u32 num_counters;
  157. static struct attribute **all_attrs;
  158. static u32 acpi_gpe_count;
  159. static struct attribute_group interrupt_stats_attr_group = {
  160. .name = "interrupts",
  161. };
  162. static struct kobj_attribute *counter_attrs;
  163. static int count_num_gpes(void)
  164. {
  165. int count = 0;
  166. struct acpi_gpe_xrupt_info *gpe_xrupt_info;
  167. struct acpi_gpe_block_info *gpe_block;
  168. acpi_cpu_flags flags;
  169. flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
  170. gpe_xrupt_info = acpi_gbl_gpe_xrupt_list_head;
  171. while (gpe_xrupt_info) {
  172. gpe_block = gpe_xrupt_info->gpe_block_list_head;
  173. while (gpe_block) {
  174. count += gpe_block->register_count *
  175. ACPI_GPE_REGISTER_WIDTH;
  176. gpe_block = gpe_block->next;
  177. }
  178. gpe_xrupt_info = gpe_xrupt_info->next;
  179. }
  180. acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
  181. return count;
  182. }
  183. static int get_gpe_device(int index, acpi_handle *handle)
  184. {
  185. struct acpi_gpe_xrupt_info *gpe_xrupt_info;
  186. struct acpi_gpe_block_info *gpe_block;
  187. acpi_cpu_flags flags;
  188. struct acpi_namespace_node *node;
  189. flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
  190. gpe_xrupt_info = acpi_gbl_gpe_xrupt_list_head;
  191. while (gpe_xrupt_info) {
  192. gpe_block = gpe_xrupt_info->gpe_block_list_head;
  193. node = gpe_block->node;
  194. while (gpe_block) {
  195. index -= gpe_block->register_count *
  196. ACPI_GPE_REGISTER_WIDTH;
  197. if (index < 0) {
  198. acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
  199. /* return NULL if it's FADT GPE */
  200. if (node->type != ACPI_TYPE_DEVICE)
  201. *handle = NULL;
  202. else
  203. *handle = node;
  204. return 0;
  205. }
  206. node = gpe_block->node;
  207. gpe_block = gpe_block->next;
  208. }
  209. gpe_xrupt_info = gpe_xrupt_info->next;
  210. }
  211. acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
  212. return -ENODEV;
  213. }
  214. static void delete_gpe_attr_array(void)
  215. {
  216. struct event_counter *tmp = all_counters;
  217. all_counters = NULL;
  218. kfree(tmp);
  219. if (counter_attrs) {
  220. int i;
  221. for (i = 0; i < num_gpes; i++)
  222. kfree(counter_attrs[i].attr.name);
  223. kfree(counter_attrs);
  224. }
  225. kfree(all_attrs);
  226. return;
  227. }
  228. void acpi_os_gpe_count(u32 gpe_number)
  229. {
  230. acpi_gpe_count++;
  231. if (!all_counters)
  232. return;
  233. if (gpe_number < num_gpes)
  234. all_counters[gpe_number].count++;
  235. else
  236. all_counters[num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_ERROR].
  237. count++;
  238. return;
  239. }
  240. void acpi_os_fixed_event_count(u32 event_number)
  241. {
  242. if (!all_counters)
  243. return;
  244. if (event_number < ACPI_NUM_FIXED_EVENTS)
  245. all_counters[num_gpes + event_number].count++;
  246. else
  247. all_counters[num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_ERROR].
  248. count++;
  249. return;
  250. }
  251. static int get_status(u32 index, acpi_event_status *status, acpi_handle *handle)
  252. {
  253. int result = 0;
  254. if (index >= num_gpes + ACPI_NUM_FIXED_EVENTS)
  255. goto end;
  256. if (index < num_gpes) {
  257. result = get_gpe_device(index, handle);
  258. if (result) {
  259. ACPI_EXCEPTION((AE_INFO, AE_NOT_FOUND,
  260. "Invalid GPE 0x%x\n", index));
  261. goto end;
  262. }
  263. result = acpi_get_gpe_status(*handle, index,
  264. ACPI_NOT_ISR, status);
  265. } else if (index < (num_gpes + ACPI_NUM_FIXED_EVENTS))
  266. result = acpi_get_event_status(index - num_gpes, status);
  267. end:
  268. return result;
  269. }
  270. static ssize_t counter_show(struct kobject *kobj,
  271. struct kobj_attribute *attr, char *buf)
  272. {
  273. int index = attr - counter_attrs;
  274. int size;
  275. acpi_handle handle;
  276. acpi_event_status status;
  277. int result = 0;
  278. all_counters[num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_SCI].count =
  279. acpi_irq_handled;
  280. all_counters[num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_GPE].count =
  281. acpi_gpe_count;
  282. size = sprintf(buf, "%8d", all_counters[index].count);
  283. /* "gpe_all" or "sci" */
  284. if (index >= num_gpes + ACPI_NUM_FIXED_EVENTS)
  285. goto end;
  286. result = get_status(index, &status, &handle);
  287. if (result)
  288. goto end;
  289. if (!(status & ACPI_EVENT_FLAG_HANDLE))
  290. size += sprintf(buf + size, " invalid");
  291. else if (status & ACPI_EVENT_FLAG_ENABLED)
  292. size += sprintf(buf + size, " enabled");
  293. else if (status & ACPI_EVENT_FLAG_WAKE_ENABLED)
  294. size += sprintf(buf + size, " wake_enabled");
  295. else
  296. size += sprintf(buf + size, " disabled");
  297. end:
  298. size += sprintf(buf + size, "\n");
  299. return result ? result : size;
  300. }
  301. /*
  302. * counter_set() sets the specified counter.
  303. * setting the total "sci" file to any value clears all counters.
  304. * enable/disable/clear a gpe/fixed event in user space.
  305. */
  306. static ssize_t counter_set(struct kobject *kobj,
  307. struct kobj_attribute *attr, const char *buf, size_t size)
  308. {
  309. int index = attr - counter_attrs;
  310. acpi_event_status status;
  311. acpi_handle handle;
  312. int result = 0;
  313. if (index == num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_SCI) {
  314. int i;
  315. for (i = 0; i < num_counters; ++i)
  316. all_counters[i].count = 0;
  317. acpi_gpe_count = 0;
  318. acpi_irq_handled = 0;
  319. goto end;
  320. }
  321. /* show the event status for both GPEs and Fixed Events */
  322. result = get_status(index, &status, &handle);
  323. if (result)
  324. goto end;
  325. if (!(status & ACPI_EVENT_FLAG_HANDLE)) {
  326. printk(KERN_WARNING PREFIX
  327. "Can not change Invalid GPE/Fixed Event status\n");
  328. return -EINVAL;
  329. }
  330. if (index < num_gpes) {
  331. if (!strcmp(buf, "disable\n") &&
  332. (status & ACPI_EVENT_FLAG_ENABLED))
  333. result = acpi_disable_gpe(handle, index);
  334. else if (!strcmp(buf, "enable\n") &&
  335. !(status & ACPI_EVENT_FLAG_ENABLED))
  336. result = acpi_enable_gpe(handle, index);
  337. else if (!strcmp(buf, "clear\n") &&
  338. (status & ACPI_EVENT_FLAG_SET))
  339. result = acpi_clear_gpe(handle, index, ACPI_NOT_ISR);
  340. else
  341. all_counters[index].count = strtoul(buf, NULL, 0);
  342. } else if (index < num_gpes + ACPI_NUM_FIXED_EVENTS) {
  343. int event = index - num_gpes;
  344. if (!strcmp(buf, "disable\n") &&
  345. (status & ACPI_EVENT_FLAG_ENABLED))
  346. result = acpi_disable_event(event, ACPI_NOT_ISR);
  347. else if (!strcmp(buf, "enable\n") &&
  348. !(status & ACPI_EVENT_FLAG_ENABLED))
  349. result = acpi_enable_event(event, ACPI_NOT_ISR);
  350. else if (!strcmp(buf, "clear\n") &&
  351. (status & ACPI_EVENT_FLAG_SET))
  352. result = acpi_clear_event(event);
  353. else
  354. all_counters[index].count = strtoul(buf, NULL, 0);
  355. } else
  356. all_counters[index].count = strtoul(buf, NULL, 0);
  357. if (ACPI_FAILURE(result))
  358. result = -EINVAL;
  359. end:
  360. return result ? result : size;
  361. }
  362. void acpi_irq_stats_init(void)
  363. {
  364. int i;
  365. if (all_counters)
  366. return;
  367. num_gpes = count_num_gpes();
  368. num_counters = num_gpes + ACPI_NUM_FIXED_EVENTS + NUM_COUNTERS_EXTRA;
  369. all_attrs = kzalloc(sizeof(struct attribute *) * (num_counters + 1),
  370. GFP_KERNEL);
  371. if (all_attrs == NULL)
  372. return;
  373. all_counters = kzalloc(sizeof(struct event_counter) * (num_counters),
  374. GFP_KERNEL);
  375. if (all_counters == NULL)
  376. goto fail;
  377. counter_attrs = kzalloc(sizeof(struct kobj_attribute) * (num_counters),
  378. GFP_KERNEL);
  379. if (counter_attrs == NULL)
  380. goto fail;
  381. for (i = 0; i < num_counters; ++i) {
  382. char buffer[12];
  383. char *name;
  384. if (i < num_gpes)
  385. sprintf(buffer, "gpe%02X", i);
  386. else if (i == num_gpes + ACPI_EVENT_PMTIMER)
  387. sprintf(buffer, "ff_pmtimer");
  388. else if (i == num_gpes + ACPI_EVENT_GLOBAL)
  389. sprintf(buffer, "ff_gbl_lock");
  390. else if (i == num_gpes + ACPI_EVENT_POWER_BUTTON)
  391. sprintf(buffer, "ff_pwr_btn");
  392. else if (i == num_gpes + ACPI_EVENT_SLEEP_BUTTON)
  393. sprintf(buffer, "ff_slp_btn");
  394. else if (i == num_gpes + ACPI_EVENT_RTC)
  395. sprintf(buffer, "ff_rt_clk");
  396. else if (i == num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_GPE)
  397. sprintf(buffer, "gpe_all");
  398. else if (i == num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_SCI)
  399. sprintf(buffer, "sci");
  400. else if (i == num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_ERROR)
  401. sprintf(buffer, "error");
  402. else
  403. sprintf(buffer, "bug%02X", i);
  404. name = kzalloc(strlen(buffer) + 1, GFP_KERNEL);
  405. if (name == NULL)
  406. goto fail;
  407. strncpy(name, buffer, strlen(buffer) + 1);
  408. counter_attrs[i].attr.name = name;
  409. counter_attrs[i].attr.mode = 0644;
  410. counter_attrs[i].show = counter_show;
  411. counter_attrs[i].store = counter_set;
  412. all_attrs[i] = &counter_attrs[i].attr;
  413. }
  414. interrupt_stats_attr_group.attrs = all_attrs;
  415. if (!sysfs_create_group(acpi_kobj, &interrupt_stats_attr_group))
  416. return;
  417. fail:
  418. delete_gpe_attr_array();
  419. return;
  420. }
  421. static void __exit interrupt_stats_exit(void)
  422. {
  423. sysfs_remove_group(acpi_kobj, &interrupt_stats_attr_group);
  424. delete_gpe_attr_array();
  425. return;
  426. }
  427. /* --------------------------------------------------------------------------
  428. FS Interface (/proc)
  429. -------------------------------------------------------------------------- */
  430. #ifdef CONFIG_ACPI_PROCFS
  431. #define ACPI_SYSTEM_FILE_INFO "info"
  432. #define ACPI_SYSTEM_FILE_EVENT "event"
  433. #define ACPI_SYSTEM_FILE_DSDT "dsdt"
  434. #define ACPI_SYSTEM_FILE_FADT "fadt"
  435. static int acpi_system_read_info(struct seq_file *seq, void *offset)
  436. {
  437. seq_printf(seq, "version: %x\n", ACPI_CA_VERSION);
  438. return 0;
  439. }
  440. static int acpi_system_info_open_fs(struct inode *inode, struct file *file)
  441. {
  442. return single_open(file, acpi_system_read_info, PDE(inode)->data);
  443. }
  444. static const struct file_operations acpi_system_info_ops = {
  445. .owner = THIS_MODULE,
  446. .open = acpi_system_info_open_fs,
  447. .read = seq_read,
  448. .llseek = seq_lseek,
  449. .release = single_release,
  450. };
  451. static ssize_t acpi_system_read_dsdt(struct file *, char __user *, size_t,
  452. loff_t *);
  453. static const struct file_operations acpi_system_dsdt_ops = {
  454. .owner = THIS_MODULE,
  455. .read = acpi_system_read_dsdt,
  456. };
  457. static ssize_t
  458. acpi_system_read_dsdt(struct file *file,
  459. char __user * buffer, size_t count, loff_t * ppos)
  460. {
  461. acpi_status status = AE_OK;
  462. struct acpi_table_header *dsdt = NULL;
  463. ssize_t res;
  464. status = acpi_get_table(ACPI_SIG_DSDT, 1, &dsdt);
  465. if (ACPI_FAILURE(status))
  466. return -ENODEV;
  467. res = simple_read_from_buffer(buffer, count, ppos, dsdt, dsdt->length);
  468. return res;
  469. }
  470. static ssize_t acpi_system_read_fadt(struct file *, char __user *, size_t,
  471. loff_t *);
  472. static const struct file_operations acpi_system_fadt_ops = {
  473. .owner = THIS_MODULE,
  474. .read = acpi_system_read_fadt,
  475. };
  476. static ssize_t
  477. acpi_system_read_fadt(struct file *file,
  478. char __user * buffer, size_t count, loff_t * ppos)
  479. {
  480. acpi_status status = AE_OK;
  481. struct acpi_table_header *fadt = NULL;
  482. ssize_t res;
  483. status = acpi_get_table(ACPI_SIG_FADT, 1, &fadt);
  484. if (ACPI_FAILURE(status))
  485. return -ENODEV;
  486. res = simple_read_from_buffer(buffer, count, ppos, fadt, fadt->length);
  487. return res;
  488. }
  489. static int acpi_system_procfs_init(void)
  490. {
  491. struct proc_dir_entry *entry;
  492. int error = 0;
  493. /* 'info' [R] */
  494. entry = proc_create(ACPI_SYSTEM_FILE_INFO, S_IRUGO, acpi_root_dir,
  495. &acpi_system_info_ops);
  496. if (!entry)
  497. goto Error;
  498. /* 'dsdt' [R] */
  499. entry = proc_create(ACPI_SYSTEM_FILE_DSDT, S_IRUSR, acpi_root_dir,
  500. &acpi_system_dsdt_ops);
  501. if (!entry)
  502. goto Error;
  503. /* 'fadt' [R] */
  504. entry = proc_create(ACPI_SYSTEM_FILE_FADT, S_IRUSR, acpi_root_dir,
  505. &acpi_system_fadt_ops);
  506. if (!entry)
  507. goto Error;
  508. Done:
  509. return error;
  510. Error:
  511. remove_proc_entry(ACPI_SYSTEM_FILE_FADT, acpi_root_dir);
  512. remove_proc_entry(ACPI_SYSTEM_FILE_DSDT, acpi_root_dir);
  513. remove_proc_entry(ACPI_SYSTEM_FILE_INFO, acpi_root_dir);
  514. error = -EFAULT;
  515. goto Done;
  516. }
  517. #else
  518. static int acpi_system_procfs_init(void)
  519. {
  520. return 0;
  521. }
  522. #endif
  523. static int __init acpi_system_init(void)
  524. {
  525. int result = 0;
  526. if (acpi_disabled)
  527. return 0;
  528. result = acpi_system_procfs_init();
  529. if (result)
  530. return result;
  531. result = acpi_system_sysfs_init();
  532. return result;
  533. }
  534. subsys_initcall(acpi_system_init);