summaryrefslogtreecommitdiff
path: root/drivers/platform/chrome/wilco_ec
diff options
context:
space:
mode:
authorEnric Balletbo i Serra <enric.balletbo@collabora.com>2019-06-14 23:43:01 +0200
committerEnric Balletbo i Serra <enric.balletbo@collabora.com>2019-06-20 12:00:32 +0200
commit22c040fa21b604b9b3d88645e108fb2f0a74474b (patch)
treef03e0f4c4be98c4f1ad2f8c680ec2af9c813c9de /drivers/platform/chrome/wilco_ec
parent4116fd25c5262e90427f9840e861a8553374a867 (diff)
platform/chrome: cros_ec_lpc: Choose Microchip EC at runtime
On many boards, communication between the kernel and the Embedded Controller happens over an LPC bus. In these cases, the kernel config CONFIG_CROS_EC_LPC is enabled. Some of these LPC boards contain a Microchip Embedded Controller (MEC) that is different from the regular EC. On these devices, the same LPC bus is used, but the protocol is a little different. In these cases, the CONFIG_CROS_EC_LPC_MEC kernel config is enabled. Currently, the kernel decides at compile-time whether or not to use the MEC variant, and, when that kernel option is selected it breaks the other boards. We would like a kind of runtime detection to avoid this. This patch adds that detection mechanism by probing the protocol at runtime, first we assume that a MEC variant is connected, and if the protocol fails it fallbacks to the regular EC. This adds a bit of overload because we try to read twice on those LPC boards that doesn't contain a MEC variant, but is a better solution than having to select the EC variant at compile-time. While here also fix the alignment in Kconfig file for this config option replacing the spaces by tabs. Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com> Tested-by: Nick Crews <ncrews@chromium.org> Reviewed-by: Nick Crews <ncrews@chromium.org>
Diffstat (limited to 'drivers/platform/chrome/wilco_ec')
-rw-r--r--drivers/platform/chrome/wilco_ec/Kconfig2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/platform/chrome/wilco_ec/Kconfig b/drivers/platform/chrome/wilco_ec/Kconfig
index 90336874af59..5b7e1801980c 100644
--- a/drivers/platform/chrome/wilco_ec/Kconfig
+++ b/drivers/platform/chrome/wilco_ec/Kconfig
@@ -1,6 +1,6 @@
config WILCO_EC
tristate "ChromeOS Wilco Embedded Controller"
- depends on ACPI && X86 && CROS_EC_LPC && CROS_EC_LPC_MEC
+ depends on ACPI && X86 && CROS_EC_LPC
help
If you say Y here, you get support for talking to the ChromeOS
Wilco EC over an eSPI bus. This uses a simple byte-level protocol