cros_ec: Move cros_ec_dev module to drivers/mfd
authorThierry Escande <thierry.escande@collabora.com>
Mon, 20 Nov 2017 16:15:26 +0000 (17:15 +0100)
committerLee Jones <lee.jones@linaro.org>
Fri, 15 Dec 2017 10:46:06 +0000 (10:46 +0000)
The cros_ec_dev module is responsible for registering the MFD devices
attached to the ChromeOS EC. This patch moves this module to drivers/mfd
so calls to mfd_add_devices() are not done from outside the MFD subtree
anymore.

Signed-off-by: Thierry Escande <thierry.escande@collabora.com>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
Tested-by: Guenter Roeck <groeck@chromium.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/Kconfig
drivers/mfd/Makefile
drivers/mfd/cros_ec_dev.c [moved from drivers/platform/chrome/cros_ec_dev.c with 99% similarity]
drivers/mfd/cros_ec_dev.h [moved from drivers/platform/chrome/cros_ec_dev.h with 100% similarity]
drivers/platform/chrome/Kconfig
drivers/platform/chrome/Makefile
drivers/platform/chrome/cros_ec_debugfs.c
drivers/platform/chrome/cros_ec_debugfs.h [deleted file]
drivers/platform/chrome/cros_ec_lightbar.c
drivers/platform/chrome/cros_ec_sysfs.c
include/linux/mfd/cros_ec.h

index 1d20a800e96795cd2bf1b9303f7bd2fa1d284b03..538a2ae8bd25dae654b35c63522a12e408e0dd85 100644 (file)
@@ -222,6 +222,16 @@ config MFD_CROS_EC_SPI
          response time cannot be guaranteed, we support ignoring
          'pre-amble' bytes before the response actually starts.
 
+config MFD_CROS_EC_CHARDEV
+        tristate "Chrome OS Embedded Controller userspace device interface"
+        depends on MFD_CROS_EC
+        select CROS_EC_CTL
+        ---help---
+          This driver adds support to talk with the ChromeOS EC from userspace.
+
+          If you have a supported Chromebook, choose Y or M here.
+          The module will be called cros_ec_dev.
+
 config MFD_ASIC3
        bool "Compaq ASIC3"
        depends on GPIOLIB && ARM
index d9474ade32e6693fd7a3e5adb583eb2f3366c5cb..fcd8af88110e24bd264666f427fcff6ac8fe01a7 100644 (file)
@@ -17,6 +17,7 @@ cros_ec_core-$(CONFIG_ACPI)   += cros_ec_acpi_gpe.o
 obj-$(CONFIG_MFD_CROS_EC)      += cros_ec_core.o
 obj-$(CONFIG_MFD_CROS_EC_I2C)  += cros_ec_i2c.o
 obj-$(CONFIG_MFD_CROS_EC_SPI)  += cros_ec_spi.o
+obj-$(CONFIG_MFD_CROS_EC_CHARDEV) += cros_ec_dev.o
 obj-$(CONFIG_MFD_EXYNOS_LPASS) += exynos-lpass.o
 
 rtsx_pci-objs                  := rtsx_pcr.o rts5209.o rts5229.o rtl8411.o rts5227.o rts5249.o
similarity index 99%
rename from drivers/platform/chrome/cros_ec_dev.c
rename to drivers/mfd/cros_ec_dev.c
index daf0ffd367a220b8b7d4bf4156deb033ccecb8db..e4fafdd96e5ebab01b930daab301630db9b98db5 100644 (file)
@@ -25,7 +25,6 @@
 #include <linux/slab.h>
 #include <linux/uaccess.h>
 
-#include "cros_ec_debugfs.h"
 #include "cros_ec_dev.h"
 
 #define DRV_NAME "cros-ec-dev"
index bffc892c8bf1abb2980dbe502586bffee4275ae0..e728a96cabfd2448c3eedba7c7f9275d35708484 100644 (file)
@@ -38,16 +38,6 @@ config CHROMEOS_PSTORE
          If you have a supported Chromebook, choose Y or M here.
          The module will be called chromeos_pstore.
 
-config CROS_EC_CHARDEV
-        tristate "Chrome OS Embedded Controller userspace device interface"
-        depends on MFD_CROS_EC
-        select CROS_EC_CTL
-        ---help---
-          This driver adds support to talk with the ChromeOS EC from userspace.
-
-          If you have a supported Chromebook, choose Y or M here.
-          The module will be called cros_ec_dev.
-
 config CROS_EC_CTL
         tristate
 
index bc239ec98fd7c5f397712794284676cb9aa3cd5e..ff3b369911f0ed7ce50ce3ffdca66842d9b9df5e 100644 (file)
@@ -5,7 +5,6 @@ obj-$(CONFIG_CHROMEOS_PSTORE)           += chromeos_pstore.o
 cros_ec_ctl-objs                       := cros_ec_sysfs.o cros_ec_lightbar.o \
                                           cros_ec_vbc.o cros_ec_debugfs.o
 obj-$(CONFIG_CROS_EC_CTL)              += cros_ec_ctl.o
-obj-$(CONFIG_CROS_EC_CHARDEV)          += cros_ec_dev.o
 cros_ec_lpcs-objs                      := cros_ec_lpc.o cros_ec_lpc_reg.o
 cros_ec_lpcs-$(CONFIG_CROS_EC_LPC_MEC) += cros_ec_lpc_mec.o
 obj-$(CONFIG_CROS_EC_LPC)              += cros_ec_lpcs.o
index d0b8ce0d678e8c052270ca7566f40fe944c19c41..98a35d32f9ddffcc7c8be22ac9559f4191e13967 100644 (file)
@@ -29,9 +29,6 @@
 #include <linux/slab.h>
 #include <linux/wait.h>
 
-#include "cros_ec_dev.h"
-#include "cros_ec_debugfs.h"
-
 #define LOG_SHIFT              14
 #define LOG_SIZE               (1 << LOG_SHIFT)
 #define LOG_POLL_SEC           10
diff --git a/drivers/platform/chrome/cros_ec_debugfs.h b/drivers/platform/chrome/cros_ec_debugfs.h
deleted file mode 100644 (file)
index 1ff3a50..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright 2015 Google, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef _DRV_CROS_EC_DEBUGFS_H_
-#define _DRV_CROS_EC_DEBUGFS_H_
-
-#include "cros_ec_dev.h"
-
-/* debugfs stuff */
-int cros_ec_debugfs_init(struct cros_ec_dev *ec);
-void cros_ec_debugfs_remove(struct cros_ec_dev *ec);
-
-#endif  /* _DRV_CROS_EC_DEBUGFS_H_ */
index 925d91c5868ed632a4d7e9e6717b5ec5874f1641..6ea79d495aa21510e65b01b21a1bd52d02e334b6 100644 (file)
@@ -33,8 +33,6 @@
 #include <linux/uaccess.h>
 #include <linux/slab.h>
 
-#include "cros_ec_dev.h"
-
 /* Rate-limit the lightbar interface to prevent DoS. */
 static unsigned long lb_interval_jiffies = 50 * HZ / 1000;
 
index 201f11afcdc907068f28971898a81479eb0044ce..d6eebe8721875d63ec54c32856d5bcf5aa01503a 100644 (file)
@@ -34,8 +34,6 @@
 #include <linux/types.h>
 #include <linux/uaccess.h>
 
-#include "cros_ec_dev.h"
-
 /* Accessor functions */
 
 static ssize_t show_ec_reboot(struct device *dev,
index 4e887ba22635ecf9c04adc1b0d1b17d106c37022..c61535979b8fc3dbad9433990759382191197f4a 100644 (file)
@@ -322,6 +322,10 @@ extern struct attribute_group cros_ec_attr_group;
 extern struct attribute_group cros_ec_lightbar_attr_group;
 extern struct attribute_group cros_ec_vbc_attr_group;
 
+/* debugfs stuff */
+int cros_ec_debugfs_init(struct cros_ec_dev *ec);
+void cros_ec_debugfs_remove(struct cros_ec_dev *ec);
+
 /* ACPI GPE handler */
 #ifdef CONFIG_ACPI