platform/chrome: Add support for mec1322 EC
v2 cover platform/chrome: Add support for mec1322 EC
Hi Benson,
This series adds support for the LPC Microchip Embedded Controller 1322.
v2:
-Add a few lines in Kconfig description
-Fixed coding style issues
-Updated copyright to year 2016
Shawn Nematbakhsh (2):
platform/chrome: cros_ec_lpc: Add R/W helpers to LPC protocol variants platform/chrome: cros_ec_lpc: Add support for mec1322 EC
drivers/platform/chrome/Kconfig | 12 +++ drivers/platform/chrome/Makefile | 4 +- drivers/platform/chrome/cros_ec_lpc.c | 93 +++++++++----------- drivers/platform/chrome/cros_ec_lpc_mec.c | 140 ++++++++++++++++++++++++++++++ drivers/platform/chrome/cros_ec_lpc_reg.c | 133 ++++++++++++++++++++++++++++ include/linux/mfd/cros_ec_lpc_mec.h | 90 +++++++++++++++++++ include/linux/mfd/cros_ec_lpc_reg.h | 61 +++++++++++++ 7 files changed, 482 insertions(+), 51 deletions(-) create mode 100644 drivers/platform/chrome/cros_ec_lpc_mec.c create mode 100644 drivers/platform/chrome/cros_ec_lpc_reg.c create mode 100644 include/linux/mfd/cros_ec_lpc_mec.h create mode 100644 include/linux/mfd/cros_ec_lpc_reg.h
Signature · 1 line
2.7.4
PATCH v2 1/2 platform/chrome: cros_ec_lpc: Add R/W helpers to LPC protocol variants
From: Shawn Nematbakhsh <[email protected]>
Call common functions for read / write to prepare support for future LPC protocol variants which use different I/O ops than inb / outb.
--- drivers/platform/chrome/Makefile | 3 +- drivers/platform/chrome/cros_ec_lpc.c | 88 +++++++++++++------------------ drivers/platform/chrome/cros_ec_lpc_reg.c | 64 ++++++++++++++++++++++ include/linux/mfd/cros_ec_lpc_reg.h | 47 +++++++++++++++++ 4 files changed, 151 insertions(+), 51 deletions(-) create mode 100644 drivers/platform/chrome/cros_ec_lpc_reg.c create mode 100644 include/linux/mfd/cros_ec_lpc_reg.h
drivers/platform/chrome/Makefile +2 -1
@@ -4,6 +4,7 @@ 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 obj-$(CONFIG_CROS_EC_CHARDEV) += cros_ec_devs.o -obj-$(CONFIG_CROS_EC_LPC) += cros_ec_lpc.o +cros_ec_lpcs-objs := cros_ec_lpc.o cros_ec_lpc_reg.o +obj-$(CONFIG_CROS_EC_LPC) += cros_ec_lpcs.o obj-$(CONFIG_CROS_EC_PROTO) += cros_ec_proto.o obj-$(CONFIG_CROS_KBD_LED_BACKLIGHT) += cros_kbd_led_backlight.o
drivers/platform/chrome/cros_ec_lpc.c +38 -50
202 lines not on this page · raw message
drivers/platform/chrome/cros_ec_lpc_reg.c new file +64 -0
64 lines not on this page · raw message
include/linux/mfd/cros_ec_lpc_reg.h new file +47 -0
47 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH v2 2/2 platform/chrome: cros_ec_lpc: Add support for mec1322 EC
In reply to Thierry EscandeFrom: Shawn Nematbakhsh <[email protected]>
This adds support for the ChromeOS LPC Microchip Embedded Controller (mec1322) variant.
mec1322 accesses I/O region [800h, 9ffh] through embedded memory interface (EMI) rather than LPC.
--- drivers/platform/chrome/Kconfig | 12 +++ drivers/platform/chrome/Makefile | 1 + drivers/platform/chrome/cros_ec_lpc.c | 5 ++ drivers/platform/chrome/cros_ec_lpc_mec.c | 140 ++++++++++++++++++++++++++++++ drivers/platform/chrome/cros_ec_lpc_reg.c | 69 +++++++++++++++ include/linux/mfd/cros_ec_lpc_mec.h | 90 +++++++++++++++++++ include/linux/mfd/cros_ec_lpc_reg.h | 14 +++ 7 files changed, 331 insertions(+) create mode 100644 drivers/platform/chrome/cros_ec_lpc_mec.c create mode 100644 include/linux/mfd/cros_ec_lpc_mec.h
drivers/platform/chrome/Kconfig +12 -0
@@ -59,6 +59,18 @@ config CROS_EC_LPC To compile this driver as a module, choose M here: the module will be called cros_ec_lpc. +config CROS_EC_LPC_MEC + bool "ChromeOS Embedded Controller LPC Microchip EC (MEC) variant" + depends on CROS_EC_LPC + default n + help + If you say Y here, a variant LPC protocol for the Microchip EC + will be used. Note that this variant is not backward compatible + with non-Microchip ECs. + + If you have a ChromeOS Embedded Controller Microchip EC variant + choose Y here. + config CROS_EC_PROTO bool help
drivers/platform/chrome/Makefile +1 -0
@@ -5,6 +5,7 @@ cros_ec_devs-objs := cros_ec_dev.o cros_ec_sysfs.o \ cros_ec_lightbar.o cros_ec_vbc.o obj-$(CONFIG_CROS_EC_CHARDEV) += cros_ec_devs.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 obj-$(CONFIG_CROS_EC_PROTO) += cros_ec_proto.o obj-$(CONFIG_CROS_KBD_LED_BACKLIGHT) += cros_kbd_led_backlight.o
drivers/platform/chrome/cros_ec_lpc.c +5 -0
@@ -346,10 +346,13 @@ static int __init cros_ec_lpc_init(void)return -ENODEV ; } +cros_ec_lpc_reg_init (); +/* Register the driver */ ret =platform_driver_register (&cros_ec_lpc_driver);if (ret) {pr_err (DRV_NAME ": can't register driver: %d\n" , ret); +cros_ec_lpc_reg_destroy ();return ret; }
@@ -358,6 +361,7 @@ static int __init cros_ec_lpc_init(void)if (ret) {pr_err (DRV_NAME ": can't register device: %d\n" , ret);platform_driver_unregister (&cros_ec_lpc_driver); +cros_ec_lpc_reg_destroy ();return ret; }
@@ -368,6 +372,7 @@ static void __exit cros_ec_lpc_exit(void) {platform_device_unregister (&cros_ec_lpc_device);platform_driver_unregister (&cros_ec_lpc_driver); +cros_ec_lpc_reg_destroy (); }module_init (cros_ec_lpc_init);
drivers/platform/chrome/cros_ec_lpc_mec.c new file +140 -0
140 lines not on this page · raw message
drivers/platform/chrome/cros_ec_lpc_reg.c +69 -0
87 lines not on this page · raw message
include/linux/mfd/cros_ec_lpc_mec.h new file +90 -0
90 lines not on this page · raw message
include/linux/mfd/cros_ec_lpc_reg.h +14 -0
@@ -44,4 +44,18 @@ u8 cros_ec_lpc_read_bytes(unsigned int offset, unsigned int length, u8 *dest);*/ u8 cros_ec_lpc_write_bytes (unsigned int offset,unsigned int length,u8 *msg); +/** +* cros_ec_lpc_reg_init +* +* Initialize register I/O. +*/ +void cros_ec_lpc_reg_init (void ); + +/** +* cros_ec_lpc_reg_destroy +* +* Cleanup reg I/O. +*/ +void cros_ec_lpc_reg_destroy (void ); +#endif /* __LINUX_MFD_CROS_EC_REG_H */
Signature · 1 line
2.7.4
Benson Leung
maintainerHi Thierry,
Quoted 3 lines · Thierry Escande
Hi Benson,
This series adds support for the LPC Microchip Embedded Controller 1322.
Thanks. I'll queue these up for the first batch of changes I'll work on as chrome platform maintainer.
Quoted 26 lines
v2:
(quoted diff) +0
-3-Add a few lines in Kconfig description -Fixed coding style issues -Updated copyright to year 2016Shawn Nematbakhsh (2):
platform/chrome:cros_ec_lpc: Add R/W helpers to LPC protocol variants platform/chrome:cros_ec_lpc: Add support for mec1322 ECdrivers/platform/chrome/Kconfig | 12 +++ drivers/platform/chrome/Makefile | 4 +- drivers/platform/chrome/cros_ec_lpc.c | 93 +++++++++----------- drivers/platform/chrome/cros_ec_lpc_mec.c | 140 ++++++++++++++++++++++++++++++ drivers/platform/chrome/cros_ec_lpc_reg.c | 133 ++++++++++++++++++++++++++++ include/linux/mfd/cros_ec_lpc_mec.h | 90 +++++++++++++++++++ include/linux/mfd/cros_ec_lpc_reg.h | 61 +++++++++++++ 7 files changed, 482 insertions(+), 51 deletions(-) create mode 100644 drivers/platform/chrome/cros_ec_lpc_mec.c create mode 100644 drivers/platform/chrome/cros_ec_lpc_reg.c create mode 100644 include/linux/mfd/cros_ec_lpc_mec.h create mode 100644 include/linux/mfd/cros_ec_lpc_reg.h--
2.7.4
Signature · 7 lines
Benson Leung Senior Software Engineer Chrome OS Kernel Google Inc. [email protected] Chromium OS Project [email protected]