summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorShiyu Sun <sshiyu@google.com>2020-03-19 16:59:52 +1100
committerEdward O'Callaghan <quasisec@chromium.org>2020-04-01 06:05:01 +0000
commitdc2c83bbc7dcf071af1a9ad80192fa1f80f09b14 (patch)
treed6a9af270befbc19734bc0781170d831d231ced0 /Makefile
parentfe6b98b91ccff0b96351a41d662933361fe29ebe (diff)
downloadflashrom-dc2c83bbc7dcf071af1a9ad80192fa1f80f09b14.tar.gz
flashrom-dc2c83bbc7dcf071af1a9ad80192fa1f80f09b14.tar.bz2
flashrom-dc2c83bbc7dcf071af1a9ad80192fa1f80f09b14.zip
i2c_helper: Add support for the Linux I2C subsystem
See https://www.kernel.org/doc/Documentation/i2c/ for details. This creates common interface for I2C access functions, and adds implementation for linux I2C functions. BUG=b:148746232 BRANCH=none TEST=build success Signed-off-by: Shiyu Sun <sshiyu@chromium.org> Change-Id: Ie0487824dfb71970bede17f617dbbb30ddf78c12 Reviewed-on: https://review.coreboot.org/c/flashrom/+/39686 Tested-by: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile9
1 files changed, 9 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 4c6c4cc43..433d8f76d 100644
--- a/Makefile
+++ b/Makefile
@@ -418,6 +418,10 @@ override CONFIG_RAYER_SPI = no
endif
endif
+ifeq ($(TARGET_OS), Linux)
+CONFIG_LINUX_I2C_HELPER = yes
+endif
+
###############################################################################
# General architecture-specific settings.
# Like above for the OS, below we verify user-supplied options depending on the target architecture.
@@ -1048,6 +1052,11 @@ LIBS += -lni845x
PROGRAMMER_OBJS += ni845x_spi.o
endif
+ifeq ($(CONFIG_LINUX_I2C_HELPER), yes)
+LIB_OBJS += i2c_helper_linux.o
+FEATURE_CFLAGS += -D'CONFIG_I2C_SUPPORT=1'
+endif
+
ifneq ($(NEED_SERIAL), )
LIB_OBJS += serial.o custom_baud.o
endif