mfd: cros_ec: Support multiple EC in a system
authorGwendal Grignou <gwendal@chromium.org>
Tue, 9 Jun 2015 11:04:47 +0000 (13:04 +0200)
committerLee Jones <lee.jones@linaro.org>
Mon, 15 Jun 2015 12:18:23 +0000 (13:18 +0100)
commit57b33ff077beebb68481a2b6b8e5fe58ca998169
tree9ebb2bc1a6e413156f1409220c4328c72efbb1b9
parentd365407079d33106f76bd486a863de05eb5ae95d
mfd: cros_ec: Support multiple EC in a system

Chromebooks can have more than one Embedded Controller so the
cros_ec device id has to be incremented for each EC registered.

Add a new structure to represent multiple EC as different char
devices (e.g: /dev/cros_ec, /dev/cros_pd). It connects to
cros_ec_device and allows sysfs inferface for cros_pd.

Also reduce number of allocated objects, make chromeos sysfs
class object a static and add refcounting to prevent object
deletion while command is in progress.

Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Dmitry Torokhov <dtor@chromium.org>
Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/input/keyboard/cros_ec_keyb.c
drivers/mfd/cros_ec.c
drivers/mfd/cros_ec_i2c.c
drivers/mfd/cros_ec_spi.c
drivers/platform/chrome/cros_ec_dev.c
drivers/platform/chrome/cros_ec_dev.h
drivers/platform/chrome/cros_ec_lightbar.c
drivers/platform/chrome/cros_ec_lpc.c
drivers/platform/chrome/cros_ec_sysfs.c
include/linux/mfd/cros_ec.h