Skip to content

Commit

Permalink
cros_ec: Move cros_ec_dev module to drivers/mfd
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Thierry Escande authored and Lee Jones committed Dec 15, 2017
1 parent ea01a31 commit 5e01155
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 46 deletions.
10 changes: 10 additions & 0 deletions drivers/mfd/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions drivers/mfd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
File renamed without changes.
10 changes: 0 additions & 10 deletions drivers/platform/chrome/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion drivers/platform/chrome/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions drivers/platform/chrome/cros_ec_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 0 additions & 27 deletions drivers/platform/chrome/cros_ec_debugfs.h

This file was deleted.

2 changes: 0 additions & 2 deletions drivers/platform/chrome/cros_ec_lightbar.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 0 additions & 2 deletions drivers/platform/chrome/cros_ec_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions include/linux/mfd/cros_ec.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 5e01155

Please sign in to comment.