mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-04 09:34:12 +08:00
22c040fa21
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>
24 lines
991 B
Makefile
24 lines
991 B
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
# tell define_trace.h where to find the cros ec trace header
|
|
CFLAGS_cros_ec_trace.o:= -I$(src)
|
|
|
|
obj-$(CONFIG_CHROMEOS_LAPTOP) += chromeos_laptop.o
|
|
obj-$(CONFIG_CHROMEOS_PSTORE) += chromeos_pstore.o
|
|
obj-$(CONFIG_CHROMEOS_TBMC) += chromeos_tbmc.o
|
|
obj-$(CONFIG_CROS_EC_I2C) += cros_ec_i2c.o
|
|
obj-$(CONFIG_CROS_EC_ISHTP) += cros_ec_ishtp.o
|
|
obj-$(CONFIG_CROS_EC_RPMSG) += cros_ec_rpmsg.o
|
|
obj-$(CONFIG_CROS_EC_SPI) += cros_ec_spi.o
|
|
cros_ec_lpcs-objs := cros_ec_lpc.o cros_ec_lpc_mec.o
|
|
obj-$(CONFIG_CROS_EC_LPC) += cros_ec_lpcs.o
|
|
obj-$(CONFIG_CROS_EC_PROTO) += cros_ec_proto.o cros_ec_trace.o
|
|
obj-$(CONFIG_CROS_KBD_LED_BACKLIGHT) += cros_kbd_led_backlight.o
|
|
obj-$(CONFIG_CROS_EC_LIGHTBAR) += cros_ec_lightbar.o
|
|
obj-$(CONFIG_CROS_EC_VBC) += cros_ec_vbc.o
|
|
obj-$(CONFIG_CROS_EC_DEBUGFS) += cros_ec_debugfs.o
|
|
obj-$(CONFIG_CROS_EC_SYSFS) += cros_ec_sysfs.o
|
|
obj-$(CONFIG_CROS_USBPD_LOGGER) += cros_usbpd_logger.o
|
|
|
|
obj-$(CONFIG_WILCO_EC) += wilco_ec/
|