platform/chrome: cros_ec: Match implementation with headers
authorEnric Balletbo i Serra <enric.balletbo@collabora.com>
Wed, 22 Jan 2020 09:07:01 +0000 (10:07 +0100)
committerEnric Balletbo i Serra <enric.balletbo@collabora.com>
Mon, 3 Feb 2020 16:14:50 +0000 (17:14 +0100)
commit034dbec179e5d2820480f477c43acbc50245e56d
tree3d561fd541cb38b82ff2e5b5a67b602f234b5e30
parent943063b65d93fb396cab55764e1075e50e1cd331
platform/chrome: cros_ec: Match implementation with headers

The 'cros_ec' core driver is the common interface for the cros_ec
transport drivers to do the shared operations to register, unregister,
suspend, resume and handle_event. The interface is provided by including
the header 'include/linux/platform_data/cros_ec_proto.h', however, instead
of have the implementation of these functions in cros_ec_proto.c, it is in
'cros_ec.c', which is a different kernel module. Apart from being a bad
practice, this can induce confusions allowing the users of the cros_ec
protocol to call these functions.

The register, unregister, suspend, resume and handle_event functions
*should* only be called by the different transport drivers (i2c, spi, lpc,
etc.), so make this a bit less confusing by moving these functions from
the public in-kernel space to a private include in platform/chrome, and
then, the interface for cros_ec module and for the cros_ec_proto module is
clean.

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Signed-off-by: Benson Leung <bleung@chromium.org>
drivers/platform/chrome/cros_ec.c
drivers/platform/chrome/cros_ec.h [new file with mode: 0644]
drivers/platform/chrome/cros_ec_i2c.c
drivers/platform/chrome/cros_ec_ishtp.c
drivers/platform/chrome/cros_ec_lpc.c
drivers/platform/chrome/cros_ec_rpmsg.c
drivers/platform/chrome/cros_ec_spi.c
include/linux/platform_data/cros_ec_proto.h