Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ea01a31b authored by Thierry Escande's avatar Thierry Escande Committed by Lee Jones
Browse files

cros_ec: Split cros_ec_devs module



This patch splits the cros_ec_devs module in two parts with a
cros_ec_dev module responsible for handling MFD devices registration and
a cros_ec_ctl module responsible for handling the various user-space
interfaces.

For consistency purpose, the driver name for the cros_ec_dev module is
now cros-ec-dev instead of cros-ec-ctl.

In the next commit, the new cros_ec_dev module will be moved to the MFD
subtree so mfd_add_devices() calls are not done from outside MFD.

Signed-off-by: default avatarThierry Escande <thierry.escande@collabora.com>
Reviewed-by: default avatarGwendal Grignou <gwendal@chromium.org>
Tested-by: default avatarGuenter Roeck <groeck@chromium.org>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent 4fbd8d19
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -40,13 +40,13 @@ static struct cros_ec_platform pd_p = {
};

static const struct mfd_cell ec_cell = {
	.name = "cros-ec-ctl",
	.name = "cros-ec-dev",
	.platform_data = &ec_p,
	.pdata_size = sizeof(ec_p),
};

static const struct mfd_cell ec_pd_cell = {
	.name = "cros-ec-ctl",
	.name = "cros-ec-dev",
	.platform_data = &pd_p,
	.pdata_size = sizeof(pd_p),
};
+4 −0
Original line number Diff line number Diff line
@@ -41,12 +41,16 @@ config 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

config CROS_EC_LPC
        tristate "ChromeOS Embedded Controller (LPC)"
        depends on MFD_CROS_EC && ACPI && (X86 || COMPILE_TEST)
+4 −4
Original line number Diff line number Diff line
@@ -2,10 +2,10 @@

obj-$(CONFIG_CHROMEOS_LAPTOP)		+= chromeos_laptop.o
obj-$(CONFIG_CHROMEOS_PSTORE)		+= chromeos_pstore.o
cros_ec_devs-objs			:= cros_ec_dev.o cros_ec_sysfs.o \
					   cros_ec_lightbar.o cros_ec_vbc.o \
					   cros_ec_debugfs.o
obj-$(CONFIG_CROS_EC_CHARDEV)		+= cros_ec_devs.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
+2 −0
Original line number Diff line number Diff line
@@ -390,6 +390,7 @@ int cros_ec_debugfs_init(struct cros_ec_dev *ec)
	debugfs_remove_recursive(debug_info->dir);
	return ret;
}
EXPORT_SYMBOL(cros_ec_debugfs_init);

void cros_ec_debugfs_remove(struct cros_ec_dev *ec)
{
@@ -399,3 +400,4 @@ void cros_ec_debugfs_remove(struct cros_ec_dev *ec)
	debugfs_remove_recursive(ec->debug_info->dir);
	cros_ec_cleanup_console_log(ec->debug_info);
}
EXPORT_SYMBOL(cros_ec_debugfs_remove);
+5 −2
Original line number Diff line number Diff line
@@ -28,6 +28,8 @@
#include "cros_ec_debugfs.h"
#include "cros_ec_dev.h"

#define DRV_NAME "cros-ec-dev"

/* Device variables */
#define CROS_MAX_DEV 128
static int ec_major;
@@ -461,7 +463,7 @@ static int ec_device_remove(struct platform_device *pdev)
}

static const struct platform_device_id cros_ec_id[] = {
	{ "cros-ec-ctl", 0 },
	{ DRV_NAME, 0 },
	{ /* sentinel */ },
};
MODULE_DEVICE_TABLE(platform, cros_ec_id);
@@ -493,7 +495,7 @@ static const struct dev_pm_ops cros_ec_dev_pm_ops = {

static struct platform_driver cros_ec_dev_driver = {
	.driver = {
		.name = "cros-ec-ctl",
		.name = DRV_NAME,
		.pm = &cros_ec_dev_pm_ops,
	},
	.probe = ec_device_probe,
@@ -544,6 +546,7 @@ static void __exit cros_ec_dev_exit(void)
module_init(cros_ec_dev_init);
module_exit(cros_ec_dev_exit);

MODULE_ALIAS("platform:" DRV_NAME);
MODULE_AUTHOR("Bill Richardson <wfrichar@chromium.org>");
MODULE_DESCRIPTION("Userspace interface to the Chrome OS Embedded Controller");
MODULE_VERSION("1.0");
Loading