linux/drivers/platform/chrome
Enric Balletbo i Serra 22c040fa21 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>
2019-06-20 12:00:32 +02:00
..
wilco_ec platform/chrome: cros_ec_lpc: Choose Microchip EC at runtime 2019-06-20 12:00:32 +02:00
chromeos_laptop.c platform/chrome: chromeos_laptop: use pci_dev_id() helper 2019-04-29 16:13:06 -05:00
chromeos_pstore.c platform/chrome: cromeos_pstore: switch to SPDX identifier 2019-02-01 10:13:05 +01:00
chromeos_tbmc.c platform/chrome: chromeos_tbmc - Remove unneeded const 2018-10-09 22:40:12 -07:00
cros_ec_debugfs.c platform/chrome: cros_ec_debugfs: cros_ec_uptime_fops can be static 2019-06-18 10:32:31 +02:00
cros_ec_i2c.c platform/chrome: cros_ec_i2c: switch to SPDX identifier 2019-02-01 10:13:06 +01:00
cros_ec_ishtp.c platform/chrome: Add ChromeOS EC ISHTP driver 2019-05-20 10:18:10 +02:00
cros_ec_lightbar.c platform/chrome: cros_ec: Make some symbols static 2019-06-05 17:28:53 +02:00
cros_ec_lpc_mec.c platform/chrome: cros_ec: Remove cros_ec dependency in lpc_mec 2019-02-11 10:07:40 +01:00
cros_ec_lpc_mec.h platform/chrome: cros_ec: Remove cros_ec dependency in lpc_mec 2019-02-11 10:07:40 +01:00
cros_ec_lpc.c platform/chrome: cros_ec_lpc: Choose Microchip EC at runtime 2019-06-20 12:00:32 +02:00
cros_ec_proto.c - Core Frameworks 2019-05-14 10:39:08 -07:00
cros_ec_rpmsg.c platform/chrome: cros_ec: Add EC host command support using rpmsg 2019-04-16 11:00:36 +02:00
cros_ec_spi.c platform/chrome: cros_ec_spi: Request the SPI thread be realtime 2019-05-24 11:35:30 +02:00
cros_ec_sysfs.c platform/chrome: cros_ec: Make some symbols static 2019-06-05 17:28:53 +02:00
cros_ec_trace.c platform/chrome: cros_ec_proto: Add trace event to trace EC commands 2019-04-17 10:29:34 +02:00
cros_ec_trace.h platform/chrome: cros_ec_proto: Add trace event to trace EC commands 2019-04-17 10:29:34 +02:00
cros_ec_vbc.c platform/chrome: cros_ec: Make some symbols static 2019-06-05 17:28:53 +02:00
cros_kbd_led_backlight.c platform/chrome: cros_kbd_led_backlight: switch to SPDX identifier 2019-02-01 10:13:06 +01:00
cros_usbpd_logger.c platform/chrome: Add CrOS USB PD logging driver 2019-04-15 12:13:24 +02:00
Kconfig platform/chrome: cros_ec_lpc: Choose Microchip EC at runtime 2019-06-20 12:00:32 +02:00
Makefile platform/chrome: cros_ec_lpc: Choose Microchip EC at runtime 2019-06-20 12:00:32 +02:00