system.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654
  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. #define ACPI_EVENT_VALID 0x01
  151. struct event_counter {
  152. u32 count;
  153. u32 flags;
  154. };
  155. static struct event_counter *all_counters;
  156. static u32 num_gpes;
  157. static u32 num_counters;
  158. static struct attribute **all_attrs;
  159. static u32 acpi_gpe_count;
  160. static struct attribute_group interrupt_stats_attr_group = {
  161. .name = "interrupts",
  162. };
  163. static struct kobj_attribute *counter_attrs;
  164. static int count_num_gpes(void)
  165. {
  166. int count = 0;
  167. struct acpi_gpe_xrupt_info *gpe_xrupt_info;
  168. struct acpi_gpe_block_info *gpe_block;
  169. acpi_cpu_flags flags;
  170. flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
  171. gpe_xrupt_info = acpi_gbl_gpe_xrupt_list_head;
  172. while (gpe_xrupt_info) {
  173. gpe_block = gpe_xrupt_info->gpe_block_list_head;
  174. while (gpe_block) {
  175. count += gpe_block->register_count *
  176. ACPI_GPE_REGISTER_WIDTH;
  177. gpe_block = gpe_block->next;
  178. }
  179. gpe_xrupt_info = gpe_xrupt_info->next;
  180. }
  181. acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
  182. return count;
  183. }
  184. static int get_gpe_device(int index, acpi_handle *handle)
  185. {
  186. struct acpi_gpe_xrupt_info *gpe_xrupt_info;
  187. struct acpi_gpe_block_info *gpe_block;
  188. acpi_cpu_flags flags;
  189. struct acpi_namespace_node *node;
  190. flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
  191. gpe_xrupt_info = acpi_gbl_gpe_xrupt_list_head;
  192. while (gpe_xrupt_info) {
  193. gpe_block = gpe_xrupt_info->gpe_block_list_head;
  194. node = gpe_block->node;
  195. while (gpe_block) {
  196. index -= gpe_block->register_count *
  197. ACPI_GPE_REGISTER_WIDTH;
  198. if (index < 0) {
  199. acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
  200. /* return NULL if it's FADT GPE */
  201. if (node->type != ACPI_TYPE_DEVICE)
  202. *handle = NULL;
  203. else
  204. *handle = node;
  205. return 0;
  206. }
  207. node = gpe_block->node;
  208. gpe_block = gpe_block->next;
  209. }
  210. gpe_xrupt_info = gpe_xrupt_info->next;
  211. }
  212. acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
  213. return -ENODEV;
  214. }
  215. static void delete_gpe_attr_array(void)
  216. {
  217. struct event_counter *tmp = all_counters;
  218. all_counters = NULL;
  219. kfree(tmp);
  220. if (counter_attrs) {
  221. int i;
  222. for (i = 0; i < num_gpes; i++)
  223. kfree(counter_attrs[i].attr.name);
  224. kfree(counter_attrs);
  225. }
  226. kfree(all_attrs);
  227. return;
  228. }
  229. void acpi_os_gpe_count(u32 gpe_number)
  230. {
  231. acpi_gpe_count++;
  232. if (!all_counters)
  233. return;
  234. if (gpe_number < num_gpes)
  235. all_counters[gpe_number].count++;
  236. else
  237. all_counters[num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_ERROR].
  238. count++;
  239. return;
  240. }
  241. void acpi_os_fixed_event_count(u32 event_number)
  242. {
  243. if (!all_counters)
  244. return;
  245. if (event_number < ACPI_NUM_FIXED_EVENTS)
  246. all_counters[num_gpes + event_number].count++;
  247. else
  248. all_counters[num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_ERROR].
  249. count++;
  250. return;
  251. }
  252. static int get_status(u32 index, acpi_event_status *status, acpi_handle *handle)
  253. {
  254. int result = 0;
  255. if (index >= num_gpes + ACPI_NUM_FIXED_EVENTS)
  256. goto end;
  257. if (index < num_gpes) {
  258. result = get_gpe_device(index, handle);
  259. if (result) {
  260. ACPI_EXCEPTION((AE_INFO, AE_NOT_FOUND,
  261. "Invalid GPE 0x%x\n", index));
  262. goto end;
  263. }
  264. result = acpi_get_gpe_status(*handle, index,
  265. ACPI_NOT_ISR, status);
  266. } else if (index < (num_gpes + ACPI_NUM_FIXED_EVENTS))
  267. result = acpi_get_event_status(index - num_gpes, status);
  268. /*
  269. * sleep/power button GPE/Fixed Event is enabled after acpi_system_init,
  270. * check the status at runtime and mark it as valid once it's enabled
  271. */
  272. if (!result && (*status & ACPI_EVENT_FLAG_ENABLED))
  273. all_counters[index].flags |= ACPI_EVENT_VALID;
  274. end:
  275. return result;
  276. }
  277. static ssize_t counter_show(struct kobject *kobj,
  278. struct kobj_attribute *attr, char *buf)
  279. {
  280. int index = attr - counter_attrs;
  281. int size;
  282. acpi_handle handle;
  283. acpi_event_status status;
  284. int result = 0;
  285. all_counters[num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_SCI].count =
  286. acpi_irq_handled;
  287. all_counters[num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_GPE].count =
  288. acpi_gpe_count;
  289. size = sprintf(buf, "%8d", all_counters[index].count);
  290. /* "gpe_all" or "sci" */
  291. if (index >= num_gpes + ACPI_NUM_FIXED_EVENTS)
  292. goto end;
  293. result = get_status(index, &status, &handle);
  294. if (result)
  295. goto end;
  296. if (!(all_counters[index].flags & ACPI_EVENT_VALID))
  297. size += sprintf(buf + size, " invalid");
  298. else if (status & ACPI_EVENT_FLAG_ENABLED)
  299. size += sprintf(buf + size, " enable");
  300. else
  301. size += sprintf(buf + size, " disable");
  302. end:
  303. size += sprintf(buf + size, "\n");
  304. return result ? result : size;
  305. }
  306. /*
  307. * counter_set() sets the specified counter.
  308. * setting the total "sci" file to any value clears all counters.
  309. * enable/disable/clear a gpe/fixed event in user space.
  310. */
  311. static ssize_t counter_set(struct kobject *kobj,
  312. struct kobj_attribute *attr, const char *buf, size_t size)
  313. {
  314. int index = attr - counter_attrs;
  315. acpi_event_status status;
  316. acpi_handle handle;
  317. int result = 0;
  318. if (index == num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_SCI) {
  319. int i;
  320. for (i = 0; i < num_counters; ++i)
  321. all_counters[i].count = 0;
  322. acpi_gpe_count = 0;
  323. acpi_irq_handled = 0;
  324. goto end;
  325. }
  326. /* show the event status for both GPEs and Fixed Events */
  327. result = get_status(index, &status, &handle);
  328. if (result)
  329. goto end;
  330. if (!(all_counters[index].flags & ACPI_EVENT_VALID)) {
  331. printk(KERN_WARNING PREFIX
  332. "Can not change Invalid GPE/Fixed Event status\n");
  333. return -EINVAL;
  334. }
  335. if (index < num_gpes) {
  336. if (!strcmp(buf, "disable\n") &&
  337. (status & ACPI_EVENT_FLAG_ENABLED))
  338. result = acpi_disable_gpe(handle, index, ACPI_NOT_ISR);
  339. else if (!strcmp(buf, "enable\n") &&
  340. !(status & ACPI_EVENT_FLAG_ENABLED))
  341. result = acpi_enable_gpe(handle, index, ACPI_NOT_ISR);
  342. else if (!strcmp(buf, "clear\n") &&
  343. (status & ACPI_EVENT_FLAG_SET))
  344. result = acpi_clear_gpe(handle, index, ACPI_NOT_ISR);
  345. else
  346. all_counters[index].count = strtoul(buf, NULL, 0);
  347. } else if (index < num_gpes + ACPI_NUM_FIXED_EVENTS) {
  348. int event = index - num_gpes;
  349. if (!strcmp(buf, "disable\n") &&
  350. (status & ACPI_EVENT_FLAG_ENABLED))
  351. result = acpi_disable_event(event, ACPI_NOT_ISR);
  352. else if (!strcmp(buf, "enable\n") &&
  353. !(status & ACPI_EVENT_FLAG_ENABLED))
  354. result = acpi_enable_event(event, ACPI_NOT_ISR);
  355. else if (!strcmp(buf, "clear\n") &&
  356. (status & ACPI_EVENT_FLAG_SET))
  357. result = acpi_clear_event(event);
  358. else
  359. all_counters[index].count = strtoul(buf, NULL, 0);
  360. } else
  361. all_counters[index].count = strtoul(buf, NULL, 0);
  362. if (ACPI_FAILURE(result))
  363. result = -EINVAL;
  364. end:
  365. return result ? result : size;
  366. }
  367. void acpi_irq_stats_init(void)
  368. {
  369. int i;
  370. if (all_counters)
  371. return;
  372. num_gpes = count_num_gpes();
  373. num_counters = num_gpes + ACPI_NUM_FIXED_EVENTS + NUM_COUNTERS_EXTRA;
  374. all_attrs = kzalloc(sizeof(struct attribute *) * (num_counters + 1),
  375. GFP_KERNEL);
  376. if (all_attrs == NULL)
  377. return;
  378. all_counters = kzalloc(sizeof(struct event_counter) * (num_counters),
  379. GFP_KERNEL);
  380. if (all_counters == NULL)
  381. goto fail;
  382. counter_attrs = kzalloc(sizeof(struct kobj_attribute) * (num_counters),
  383. GFP_KERNEL);
  384. if (counter_attrs == NULL)
  385. goto fail;
  386. for (i = 0; i < num_counters; ++i) {
  387. char buffer[12];
  388. char *name;
  389. if (i < num_gpes)
  390. sprintf(buffer, "gpe%02X", i);
  391. else if (i == num_gpes + ACPI_EVENT_PMTIMER)
  392. sprintf(buffer, "ff_pmtimer");
  393. else if (i == num_gpes + ACPI_EVENT_GLOBAL)
  394. sprintf(buffer, "ff_gbl_lock");
  395. else if (i == num_gpes + ACPI_EVENT_POWER_BUTTON)
  396. sprintf(buffer, "ff_pwr_btn");
  397. else if (i == num_gpes + ACPI_EVENT_SLEEP_BUTTON)
  398. sprintf(buffer, "ff_slp_btn");
  399. else if (i == num_gpes + ACPI_EVENT_RTC)
  400. sprintf(buffer, "ff_rt_clk");
  401. else if (i == num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_GPE)
  402. sprintf(buffer, "gpe_all");
  403. else if (i == num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_SCI)
  404. sprintf(buffer, "sci");
  405. else if (i == num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_ERROR)
  406. sprintf(buffer, "error");
  407. else
  408. sprintf(buffer, "bug%02X", i);
  409. name = kzalloc(strlen(buffer) + 1, GFP_KERNEL);
  410. if (name == NULL)
  411. goto fail;
  412. strncpy(name, buffer, strlen(buffer) + 1);
  413. counter_attrs[i].attr.name = name;
  414. counter_attrs[i].attr.mode = 0644;
  415. counter_attrs[i].show = counter_show;
  416. counter_attrs[i].store = counter_set;
  417. all_attrs[i] = &counter_attrs[i].attr;
  418. }
  419. interrupt_stats_attr_group.attrs = all_attrs;
  420. if (!sysfs_create_group(acpi_kobj, &interrupt_stats_attr_group))
  421. return;
  422. fail:
  423. delete_gpe_attr_array();
  424. return;
  425. }
  426. static void __exit interrupt_stats_exit(void)
  427. {
  428. sysfs_remove_group(acpi_kobj, &interrupt_stats_attr_group);
  429. delete_gpe_attr_array();
  430. return;
  431. }
  432. /* --------------------------------------------------------------------------
  433. FS Interface (/proc)
  434. -------------------------------------------------------------------------- */
  435. #ifdef CONFIG_ACPI_PROCFS
  436. #define ACPI_SYSTEM_FILE_INFO "info"
  437. #define ACPI_SYSTEM_FILE_EVENT "event"
  438. #define ACPI_SYSTEM_FILE_DSDT "dsdt"
  439. #define ACPI_SYSTEM_FILE_FADT "fadt"
  440. static int acpi_system_read_info(struct seq_file *seq, void *offset)
  441. {
  442. seq_printf(seq, "version: %x\n", ACPI_CA_VERSION);
  443. return 0;
  444. }
  445. static int acpi_system_info_open_fs(struct inode *inode, struct file *file)
  446. {
  447. return single_open(file, acpi_system_read_info, PDE(inode)->data);
  448. }
  449. static const struct file_operations acpi_system_info_ops = {
  450. .owner = THIS_MODULE,
  451. .open = acpi_system_info_open_fs,
  452. .read = seq_read,
  453. .llseek = seq_lseek,
  454. .release = single_release,
  455. };
  456. static ssize_t acpi_system_read_dsdt(struct file *, char __user *, size_t,
  457. loff_t *);
  458. static const struct file_operations acpi_system_dsdt_ops = {
  459. .owner = THIS_MODULE,
  460. .read = acpi_system_read_dsdt,
  461. };
  462. static ssize_t
  463. acpi_system_read_dsdt(struct file *file,
  464. char __user * buffer, size_t count, loff_t * ppos)
  465. {
  466. acpi_status status = AE_OK;
  467. struct acpi_table_header *dsdt = NULL;
  468. ssize_t res;
  469. status = acpi_get_table(ACPI_SIG_DSDT, 1, &dsdt);
  470. if (ACPI_FAILURE(status))
  471. return -ENODEV;
  472. res = simple_read_from_buffer(buffer, count, ppos, dsdt, dsdt->length);
  473. return res;
  474. }
  475. static ssize_t acpi_system_read_fadt(struct file *, char __user *, size_t,
  476. loff_t *);
  477. static const struct file_operations acpi_system_fadt_ops = {
  478. .owner = THIS_MODULE,
  479. .read = acpi_system_read_fadt,
  480. };
  481. static ssize_t
  482. acpi_system_read_fadt(struct file *file,
  483. char __user * buffer, size_t count, loff_t * ppos)
  484. {
  485. acpi_status status = AE_OK;
  486. struct acpi_table_header *fadt = NULL;
  487. ssize_t res;
  488. status = acpi_get_table(ACPI_SIG_FADT, 1, &fadt);
  489. if (ACPI_FAILURE(status))
  490. return -ENODEV;
  491. res = simple_read_from_buffer(buffer, count, ppos, fadt, fadt->length);
  492. return res;
  493. }
  494. static int acpi_system_procfs_init(void)
  495. {
  496. struct proc_dir_entry *entry;
  497. int error = 0;
  498. /* 'info' [R] */
  499. entry = proc_create(ACPI_SYSTEM_FILE_INFO, S_IRUGO, acpi_root_dir,
  500. &acpi_system_info_ops);
  501. if (!entry)
  502. goto Error;
  503. /* 'dsdt' [R] */
  504. entry = proc_create(ACPI_SYSTEM_FILE_DSDT, S_IRUSR, acpi_root_dir,
  505. &acpi_system_dsdt_ops);
  506. if (!entry)
  507. goto Error;
  508. /* 'fadt' [R] */
  509. entry = proc_create(ACPI_SYSTEM_FILE_FADT, S_IRUSR, acpi_root_dir,
  510. &acpi_system_fadt_ops);
  511. if (!entry)
  512. goto Error;
  513. Done:
  514. return error;
  515. Error:
  516. remove_proc_entry(ACPI_SYSTEM_FILE_FADT, acpi_root_dir);
  517. remove_proc_entry(ACPI_SYSTEM_FILE_DSDT, acpi_root_dir);
  518. remove_proc_entry(ACPI_SYSTEM_FILE_INFO, acpi_root_dir);
  519. error = -EFAULT;
  520. goto Done;
  521. }
  522. #else
  523. static int acpi_system_procfs_init(void)
  524. {
  525. return 0;
  526. }
  527. #endif
  528. static int __init acpi_system_init(void)
  529. {
  530. int result = 0;
  531. if (acpi_disabled)
  532. return 0;
  533. result = acpi_system_procfs_init();
  534. if (result)
  535. return result;
  536. result = acpi_system_sysfs_init();
  537. return result;
  538. }
  539. subsys_initcall(acpi_system_init);