Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ACPI: add support for configfs

Register the ACPI subsystem with configfs.

Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Octavian Purdila and committed by
Rafael J. Wysocki
0bf54fcd 475fb4e8

+70
+7
Documentation/ABI/testing/configfs-acpi
··· 1 + What: /config/acpi 2 + Date: July 2016 3 + KernelVersion: 4.8 4 + Contact: linux-acpi@vger.kernel.org 5 + Description: 6 + This represents the ACPI subsystem entry point directory. It 7 + contains sub-groups corresponding to ACPI configurable options.
+1
MAINTAINERS
··· 288 288 F: include/acpi/ 289 289 F: Documentation/acpi/ 290 290 F: Documentation/ABI/testing/sysfs-bus-acpi 291 + F: Documentation/ABI/testing/configfs-acpi 291 292 F: drivers/pci/*acpi* 292 293 F: drivers/pci/*/*acpi* 293 294 F: drivers/pci/*/*/*acpi*
+8
drivers/acpi/Kconfig
··· 524 524 525 525 endif 526 526 527 + config ACPI_CONFIGFS 528 + tristate "ACPI configfs support" 529 + select CONFIGFS_FS 530 + help 531 + Select this option to enable support for ACPI configuration from 532 + userspace. The configurable ACPI groups will be visible under 533 + /config/acpi, assuming configfs is mounted under /config. 534 + 527 535 endif # ACPI
+1
drivers/acpi/Makefile
··· 99 99 obj-$(CONFIG_PMIC_OPREGION) += pmic/intel_pmic.o 100 100 obj-$(CONFIG_CRC_PMIC_OPREGION) += pmic/intel_pmic_crc.o 101 101 obj-$(CONFIG_XPOWER_PMIC_OPREGION) += pmic/intel_pmic_xpower.o 102 + obj-$(CONFIG_ACPI_CONFIGFS) += configfs.o 102 103 103 104 video-objs += acpi_video.o video_detect.o
+53
drivers/acpi/configfs.c
··· 1 + /* 2 + * ACPI configfs support 3 + * 4 + * Copyright (c) 2016 Intel Corporation 5 + * 6 + * This program is free software; you can redistribute it and/or modify it 7 + * under the terms of the GNU General Public License version 2 as published by 8 + * the Free Software Foundation. 9 + */ 10 + 11 + #include <linux/init.h> 12 + #include <linux/module.h> 13 + #include <linux/configfs.h> 14 + #include <linux/acpi.h> 15 + 16 + static struct config_item_type acpi_root_group_type = { 17 + .ct_owner = THIS_MODULE, 18 + }; 19 + 20 + static struct configfs_subsystem acpi_configfs = { 21 + .su_group = { 22 + .cg_item = { 23 + .ci_namebuf = "acpi", 24 + .ci_type = &acpi_root_group_type, 25 + }, 26 + }, 27 + .su_mutex = __MUTEX_INITIALIZER(acpi_configfs.su_mutex), 28 + }; 29 + 30 + static int __init acpi_configfs_init(void) 31 + { 32 + int ret; 33 + struct config_group *root = &acpi_configfs.su_group; 34 + 35 + config_group_init(root); 36 + 37 + ret = configfs_register_subsystem(&acpi_configfs); 38 + if (ret) 39 + return ret; 40 + 41 + return 0; 42 + } 43 + module_init(acpi_configfs_init); 44 + 45 + static void __exit acpi_configfs_exit(void) 46 + { 47 + configfs_unregister_subsystem(&acpi_configfs); 48 + } 49 + module_exit(acpi_configfs_exit); 50 + 51 + MODULE_AUTHOR("Octavian Purdila <octavian.purdila@intel.com>"); 52 + MODULE_DESCRIPTION("ACPI configfs support"); 53 + MODULE_LICENSE("GPL v2");