From patchwork Tue Apr 19 22:39:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Octavian Purdila X-Patchwork-Id: 8883721 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3327ABF440 for ; Tue, 19 Apr 2016 22:41:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4973A2013A for ; Tue, 19 Apr 2016 22:41:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5E2A0202B8 for ; Tue, 19 Apr 2016 22:41:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753597AbcDSWlB (ORCPT ); Tue, 19 Apr 2016 18:41:01 -0400 Received: from mga04.intel.com ([192.55.52.120]:61700 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932465AbcDSWkC (ORCPT ); Tue, 19 Apr 2016 18:40:02 -0400 Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP; 19 Apr 2016 15:40:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,507,1455004800"; d="scan'208";a="88266399" Received: from mbenvenu-mobl.ger.corp.intel.com (HELO opurdila-mobl.ger.corp.intel.com) ([10.252.34.94]) by fmsmga004.fm.intel.com with ESMTP; 19 Apr 2016 15:39:58 -0700 From: Octavian Purdila To: "Rafael J. Wysocki" , Len Brown , Matt Fleming , Mark Brown , Wolfram Sang Cc: Joel Becker , linux-acpi@vger.kernel.org, linux-efi@vger.kernel.org, linux-i2c@vger.kernel.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, irina.tirdea@intel.com, Octavian Purdila Subject: [RFC PATCH v2 08/10] acpi: add support for configfs Date: Wed, 20 Apr 2016 01:39:06 +0300 Message-Id: <1461105548-20618-9-git-send-email-octavian.purdila@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1461105548-20618-1-git-send-email-octavian.purdila@intel.com> References: <1461105548-20618-1-git-send-email-octavian.purdila@intel.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Register the ACPI subsystem with configfs. Signed-off-by: Octavian Purdila --- Documentation/ABI/testing/configfs-acpi | 7 ++++++ MAINTAINERS | 1 + drivers/acpi/Kconfig | 9 ++++++++ drivers/acpi/Makefile | 1 + drivers/acpi/configfs.c | 39 +++++++++++++++++++++++++++++++++ 5 files changed, 57 insertions(+) create mode 100644 Documentation/ABI/testing/configfs-acpi create mode 100644 drivers/acpi/configfs.c diff --git a/Documentation/ABI/testing/configfs-acpi b/Documentation/ABI/testing/configfs-acpi new file mode 100644 index 0000000..0c806aa --- /dev/null +++ b/Documentation/ABI/testing/configfs-acpi @@ -0,0 +1,7 @@ +What: /config/acpi +Date: April 2016 +KernelVersion: 4.6 +Contact: linux-acpi@vger.kernel.org +Description: + This represents the ACPI subsystem entry point directory. It + contains sub-groups corresponding to ACPI configurable options. diff --git a/MAINTAINERS b/MAINTAINERS index 1c32f8a..6695648 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -289,6 +289,7 @@ F: include/linux/acpi.h F: include/acpi/ F: Documentation/acpi/ F: Documentation/ABI/testing/sysfs-bus-acpi +F: Documentation/ABI/testing/configfs-acpi F: drivers/pci/*acpi* F: drivers/pci/*/*acpi* F: drivers/pci/*/*/*acpi* diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 82b96ee..7d02816 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -521,4 +521,13 @@ config XPOWER_PMIC_OPREGION endif +config ACPI_CONFIGFS + tristate "ACPI configfs support" + select CONFIGFS_FS + default n + help + Select this option to enable support for ACPI configuration from + userspace. The configurable ACPI groups will be visible under + /config/acpi, assuming configfs is mounted under /config. + endif # ACPI diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile index edeb2d1..319e63d 100644 --- a/drivers/acpi/Makefile +++ b/drivers/acpi/Makefile @@ -98,5 +98,6 @@ obj-$(CONFIG_ACPI_EXTLOG) += acpi_extlog.o obj-$(CONFIG_PMIC_OPREGION) += pmic/intel_pmic.o obj-$(CONFIG_CRC_PMIC_OPREGION) += pmic/intel_pmic_crc.o obj-$(CONFIG_XPOWER_PMIC_OPREGION) += pmic/intel_pmic_xpower.o +obj-$(CONFIG_ACPI_CONFIGFS) += configfs.o video-objs += acpi_video.o video_detect.o diff --git a/drivers/acpi/configfs.c b/drivers/acpi/configfs.c new file mode 100644 index 0000000..96aa3d8 --- /dev/null +++ b/drivers/acpi/configfs.c @@ -0,0 +1,39 @@ +/* + * ACPI configfs support + * + * Copyright (c) 2015 Intel Corporation + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published by + * the Free Software Foundation. + */ + +#include +#include +#include +#include + +static int __init acpi_configfs_init(void) +{ + int ret; + struct config_group *root = &acpi_configfs.su_group; + + config_group_init(root); + + ret = configfs_register_subsystem(&acpi_configfs); + if (ret) + return ret; + + return 0; +} +module_init(acpi_configfs_init); + +static void __exit acpi_configfs_exit(void) +{ + configfs_unregister_subsystem(&acpi_configfs); +} +module_exit(acpi_configfs_exit); + +MODULE_AUTHOR("Octavian Purdila "); +MODULE_DESCRIPTION("ACPI configfs support"); +MODULE_LICENSE("GPL v2");