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

cros_ec: Move cros_ec_dev module to drivers/mfd

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>

authored by

Thierry Escande and committed by
Lee Jones
5e011558 ea01a31b

+15 -46
+10
drivers/mfd/Kconfig
··· 222 222 response time cannot be guaranteed, we support ignoring 223 223 'pre-amble' bytes before the response actually starts. 224 224 225 + config MFD_CROS_EC_CHARDEV 226 + tristate "Chrome OS Embedded Controller userspace device interface" 227 + depends on MFD_CROS_EC 228 + select CROS_EC_CTL 229 + ---help--- 230 + This driver adds support to talk with the ChromeOS EC from userspace. 231 + 232 + If you have a supported Chromebook, choose Y or M here. 233 + The module will be called cros_ec_dev. 234 + 225 235 config MFD_ASIC3 226 236 bool "Compaq ASIC3" 227 237 depends on GPIOLIB && ARM
+1
drivers/mfd/Makefile
··· 17 17 obj-$(CONFIG_MFD_CROS_EC) += cros_ec_core.o 18 18 obj-$(CONFIG_MFD_CROS_EC_I2C) += cros_ec_i2c.o 19 19 obj-$(CONFIG_MFD_CROS_EC_SPI) += cros_ec_spi.o 20 + obj-$(CONFIG_MFD_CROS_EC_CHARDEV) += cros_ec_dev.o 20 21 obj-$(CONFIG_MFD_EXYNOS_LPASS) += exynos-lpass.o 21 22 22 23 rtsx_pci-objs := rtsx_pcr.o rts5209.o rts5229.o rtl8411.o rts5227.o rts5249.o
-10
drivers/platform/chrome/Kconfig
··· 38 38 If you have a supported Chromebook, choose Y or M here. 39 39 The module will be called chromeos_pstore. 40 40 41 - config CROS_EC_CHARDEV 42 - tristate "Chrome OS Embedded Controller userspace device interface" 43 - depends on MFD_CROS_EC 44 - select CROS_EC_CTL 45 - ---help--- 46 - This driver adds support to talk with the ChromeOS EC from userspace. 47 - 48 - If you have a supported Chromebook, choose Y or M here. 49 - The module will be called cros_ec_dev. 50 - 51 41 config CROS_EC_CTL 52 42 tristate 53 43
-1
drivers/platform/chrome/Makefile
··· 5 5 cros_ec_ctl-objs := cros_ec_sysfs.o cros_ec_lightbar.o \ 6 6 cros_ec_vbc.o cros_ec_debugfs.o 7 7 obj-$(CONFIG_CROS_EC_CTL) += cros_ec_ctl.o 8 - obj-$(CONFIG_CROS_EC_CHARDEV) += cros_ec_dev.o 9 8 cros_ec_lpcs-objs := cros_ec_lpc.o cros_ec_lpc_reg.o 10 9 cros_ec_lpcs-$(CONFIG_CROS_EC_LPC_MEC) += cros_ec_lpc_mec.o 11 10 obj-$(CONFIG_CROS_EC_LPC) += cros_ec_lpcs.o
-3
drivers/platform/chrome/cros_ec_debugfs.c
··· 29 29 #include <linux/slab.h> 30 30 #include <linux/wait.h> 31 31 32 - #include "cros_ec_dev.h" 33 - #include "cros_ec_debugfs.h" 34 - 35 32 #define LOG_SHIFT 14 36 33 #define LOG_SIZE (1 << LOG_SHIFT) 37 34 #define LOG_POLL_SEC 10
-27
drivers/platform/chrome/cros_ec_debugfs.h
··· 1 - /* 2 - * Copyright 2015 Google, Inc. 3 - * 4 - * This program is free software; you can redistribute it and/or modify 5 - * it under the terms of the GNU General Public License as published by 6 - * the Free Software Foundation; either version 2 of the License, or 7 - * (at your option) any later version. 8 - * 9 - * This program is distributed in the hope that it will be useful, 10 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 - * GNU General Public License for more details. 13 - * 14 - * You should have received a copy of the GNU General Public License 15 - * along with this program. If not, see <http://www.gnu.org/licenses/>. 16 - */ 17 - 18 - #ifndef _DRV_CROS_EC_DEBUGFS_H_ 19 - #define _DRV_CROS_EC_DEBUGFS_H_ 20 - 21 - #include "cros_ec_dev.h" 22 - 23 - /* debugfs stuff */ 24 - int cros_ec_debugfs_init(struct cros_ec_dev *ec); 25 - void cros_ec_debugfs_remove(struct cros_ec_dev *ec); 26 - 27 - #endif /* _DRV_CROS_EC_DEBUGFS_H_ */
-1
drivers/platform/chrome/cros_ec_dev.c drivers/mfd/cros_ec_dev.c
··· 25 25 #include <linux/slab.h> 26 26 #include <linux/uaccess.h> 27 27 28 - #include "cros_ec_debugfs.h" 29 28 #include "cros_ec_dev.h" 30 29 31 30 #define DRV_NAME "cros-ec-dev"
drivers/platform/chrome/cros_ec_dev.h drivers/mfd/cros_ec_dev.h
-2
drivers/platform/chrome/cros_ec_lightbar.c
··· 33 33 #include <linux/uaccess.h> 34 34 #include <linux/slab.h> 35 35 36 - #include "cros_ec_dev.h" 37 - 38 36 /* Rate-limit the lightbar interface to prevent DoS. */ 39 37 static unsigned long lb_interval_jiffies = 50 * HZ / 1000; 40 38
-2
drivers/platform/chrome/cros_ec_sysfs.c
··· 34 34 #include <linux/types.h> 35 35 #include <linux/uaccess.h> 36 36 37 - #include "cros_ec_dev.h" 38 - 39 37 /* Accessor functions */ 40 38 41 39 static ssize_t show_ec_reboot(struct device *dev,
+4
include/linux/mfd/cros_ec.h
··· 322 322 extern struct attribute_group cros_ec_lightbar_attr_group; 323 323 extern struct attribute_group cros_ec_vbc_attr_group; 324 324 325 + /* debugfs stuff */ 326 + int cros_ec_debugfs_init(struct cros_ec_dev *ec); 327 + void cros_ec_debugfs_remove(struct cros_ec_dev *ec); 328 + 325 329 /* ACPI GPE handler */ 326 330 #ifdef CONFIG_ACPI 327 331