From 24316025756c6ccdccb06a35e0f343780ccfe0f0 Mon Sep 17 00:00:00 2001 From: Shawn Nematbakhsh Date: Fri, 30 Oct 2015 18:22:28 -0700 Subject: cleanup: Standardize use of CONFIG_I2C and add MASTER/SLAVE CONFIGs Some chips previously defined CONFIG_I2C and others didn't. Standardize the usage by removing CONFIG_I2C from all config_chip files and force it to be defined at the board level. Also, make boards define CONFIG_I2C_MASTER and/or CONFIG_I2C_SLAVE based on the I2C interfaces they will use - this will assist with some later cleanup. BUG=chromium:550206 TEST=`make buildall -j` BRANCH=None Change-Id: I2f0970e494ea49611abc315587c7c9aa0bc2d14a Signed-off-by: Shawn Nematbakhsh Reviewed-on: https://chromium-review.googlesource.com/310070 Commit-Ready: Shawn N Tested-by: Shawn N Reviewed-by: Alec Berg --- common/build.mk | 4 +--- common/host_command.c | 2 +- common/system.c | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) (limited to 'common') diff --git a/common/build.mk b/common/build.mk index c61c118c4d..f88e534fbb 100644 --- a/common/build.mk +++ b/common/build.mk @@ -45,9 +45,7 @@ common-$(CONFIG_FMAP)+=fmap.o common-$(CONFIG_GESTURE_SW_DETECTION)+=gesture.o common-$(CONFIG_HOSTCMD_EVENTS)+=host_event_commands.o common-$(CONFIG_HOSTCMD_PD)+=host_command_master.o -ifndef CONFIG_I2C_SLAVE_ONLY -common-$(CONFIG_I2C)+=i2c.o -endif +common-$(CONFIG_I2C_MASTER)+=i2c.o common-$(CONFIG_INDUCTIVE_CHARGING)+=inductive_charging.o common-$(CONFIG_KEYBOARD_PROTOCOL_8042)+=keyboard_8042.o \ keyboard_8042_sharedlib.o diff --git a/common/host_command.c b/common/host_command.c index b57d41c17b..40b4efd4af 100644 --- a/common/host_command.c +++ b/common/host_command.c @@ -720,7 +720,7 @@ static int host_command_get_features(struct host_cmd_handler_args *args) #ifdef CONFIG_COMMON_GPIO | EC_FEATURE_MASK_0(EC_FEATURE_GPIO) #endif -#if defined(CONFIG_I2C) && !defined(CONFIG_I2C_SLAVE_ONLY) +#ifdef CONFIG_I2C_MASTER | EC_FEATURE_MASK_0(EC_FEATURE_I2C) #endif #ifdef CONFIG_CHARGER diff --git a/common/system.c b/common/system.c index fa3a557d8b..0cecb18dc3 100644 --- a/common/system.c +++ b/common/system.c @@ -439,7 +439,7 @@ static void jump_to_image(uintptr_t init_addr) usleep(MSEC); gpio_set_level(GPIO_ENTERING_RW, 0); -#if defined(CONFIG_I2C) && !defined(CONFIG_I2C_SLAVE_ONLY) +#ifdef CONFIG_I2C_MASTER /* Prepare I2C module for sysjump */ i2c_prepare_sysjump(); #endif -- cgit v1.2.1