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

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: 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
ea01a31b 4fbd8d19

+25 -8
+2 -2
drivers/mfd/cros_ec.c
··· 40 40 }; 41 41 42 42 static const struct mfd_cell ec_cell = { 43 - .name = "cros-ec-ctl", 43 + .name = "cros-ec-dev", 44 44 .platform_data = &ec_p, 45 45 .pdata_size = sizeof(ec_p), 46 46 }; 47 47 48 48 static const struct mfd_cell ec_pd_cell = { 49 - .name = "cros-ec-ctl", 49 + .name = "cros-ec-dev", 50 50 .platform_data = &pd_p, 51 51 .pdata_size = sizeof(pd_p), 52 52 };
+4
drivers/platform/chrome/Kconfig
··· 41 41 config CROS_EC_CHARDEV 42 42 tristate "Chrome OS Embedded Controller userspace device interface" 43 43 depends on MFD_CROS_EC 44 + select CROS_EC_CTL 44 45 ---help--- 45 46 This driver adds support to talk with the ChromeOS EC from userspace. 46 47 47 48 If you have a supported Chromebook, choose Y or M here. 48 49 The module will be called cros_ec_dev. 50 + 51 + config CROS_EC_CTL 52 + tristate 49 53 50 54 config CROS_EC_LPC 51 55 tristate "ChromeOS Embedded Controller (LPC)"
+4 -4
drivers/platform/chrome/Makefile
··· 2 2 3 3 obj-$(CONFIG_CHROMEOS_LAPTOP) += chromeos_laptop.o 4 4 obj-$(CONFIG_CHROMEOS_PSTORE) += chromeos_pstore.o 5 - cros_ec_devs-objs := cros_ec_dev.o cros_ec_sysfs.o \ 6 - cros_ec_lightbar.o cros_ec_vbc.o \ 7 - cros_ec_debugfs.o 8 - obj-$(CONFIG_CROS_EC_CHARDEV) += cros_ec_devs.o 5 + cros_ec_ctl-objs := cros_ec_sysfs.o cros_ec_lightbar.o \ 6 + cros_ec_vbc.o cros_ec_debugfs.o 7 + obj-$(CONFIG_CROS_EC_CTL) += cros_ec_ctl.o 8 + obj-$(CONFIG_CROS_EC_CHARDEV) += cros_ec_dev.o 9 9 cros_ec_lpcs-objs := cros_ec_lpc.o cros_ec_lpc_reg.o 10 10 cros_ec_lpcs-$(CONFIG_CROS_EC_LPC_MEC) += cros_ec_lpc_mec.o 11 11 obj-$(CONFIG_CROS_EC_LPC) += cros_ec_lpcs.o
+2
drivers/platform/chrome/cros_ec_debugfs.c
··· 390 390 debugfs_remove_recursive(debug_info->dir); 391 391 return ret; 392 392 } 393 + EXPORT_SYMBOL(cros_ec_debugfs_init); 393 394 394 395 void cros_ec_debugfs_remove(struct cros_ec_dev *ec) 395 396 { ··· 400 399 debugfs_remove_recursive(ec->debug_info->dir); 401 400 cros_ec_cleanup_console_log(ec->debug_info); 402 401 } 402 + EXPORT_SYMBOL(cros_ec_debugfs_remove);
+5 -2
drivers/platform/chrome/cros_ec_dev.c
··· 28 28 #include "cros_ec_debugfs.h" 29 29 #include "cros_ec_dev.h" 30 30 31 + #define DRV_NAME "cros-ec-dev" 32 + 31 33 /* Device variables */ 32 34 #define CROS_MAX_DEV 128 33 35 static int ec_major; ··· 463 461 } 464 462 465 463 static const struct platform_device_id cros_ec_id[] = { 466 - { "cros-ec-ctl", 0 }, 464 + { DRV_NAME, 0 }, 467 465 { /* sentinel */ }, 468 466 }; 469 467 MODULE_DEVICE_TABLE(platform, cros_ec_id); ··· 495 493 496 494 static struct platform_driver cros_ec_dev_driver = { 497 495 .driver = { 498 - .name = "cros-ec-ctl", 496 + .name = DRV_NAME, 499 497 .pm = &cros_ec_dev_pm_ops, 500 498 }, 501 499 .probe = ec_device_probe, ··· 546 544 module_init(cros_ec_dev_init); 547 545 module_exit(cros_ec_dev_exit); 548 546 547 + MODULE_ALIAS("platform:" DRV_NAME); 549 548 MODULE_AUTHOR("Bill Richardson <wfrichar@chromium.org>"); 550 549 MODULE_DESCRIPTION("Userspace interface to the Chrome OS Embedded Controller"); 551 550 MODULE_VERSION("1.0");
+4
drivers/platform/chrome/cros_ec_lightbar.c
··· 414 414 415 415 return ret; 416 416 } 417 + EXPORT_SYMBOL(lb_manual_suspend_ctrl); 417 418 418 419 int lb_suspend(struct cros_ec_dev *ec) 419 420 { ··· 423 422 424 423 return lb_send_empty_cmd(ec, LIGHTBAR_CMD_SUSPEND); 425 424 } 425 + EXPORT_SYMBOL(lb_suspend); 426 426 427 427 int lb_resume(struct cros_ec_dev *ec) 428 428 { ··· 432 430 433 431 return lb_send_empty_cmd(ec, LIGHTBAR_CMD_RESUME); 434 432 } 433 + EXPORT_SYMBOL(lb_resume); 435 434 436 435 static ssize_t sequence_store(struct device *dev, struct device_attribute *attr, 437 436 const char *buf, size_t count) ··· 625 622 .attrs = __lb_cmds_attrs, 626 623 .is_visible = cros_ec_lightbar_attrs_are_visible, 627 624 }; 625 + EXPORT_SYMBOL(cros_ec_lightbar_attr_group);
+3
drivers/platform/chrome/cros_ec_sysfs.c
··· 294 294 struct attribute_group cros_ec_attr_group = { 295 295 .attrs = __ec_attrs, 296 296 }; 297 + EXPORT_SYMBOL(cros_ec_attr_group); 297 298 299 + MODULE_LICENSE("GPL"); 300 + MODULE_DESCRIPTION("ChromeOS EC control driver");
+1
drivers/platform/chrome/cros_ec_vbc.c
··· 135 135 .bin_attrs = cros_ec_vbc_bin_attrs, 136 136 .is_bin_visible = cros_ec_vbc_is_visible, 137 137 }; 138 + EXPORT_SYMBOL(cros_ec_vbc_attr_group);