glados_pd: oak_pd: add and enable option for i2c slave only

Add CONFIG_I2C_SLAVE_ONLY for boards that only operate as a slave
on i2c.

BUG=chrome-os-partner:41959
BRANCH=none
TEST=make BOARD=glados_pd and see 2kB flash savings

Change-Id: I30831ce48b391d985c25e266229d5c6f2312042b
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/306783
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
Alec Berg
2015-10-16 11:07:01 -07:00
committed by chrome-bot
parent 4c8553dfb1
commit 8acea1ec39
7 changed files with 11 additions and 4 deletions

View File

@@ -40,6 +40,7 @@
#undef CONFIG_HOSTCMD_EVENTS
#define CONFIG_HW_CRC
#define CONFIG_I2C
#define CONFIG_I2C_SLAVE_ONLY
#undef CONFIG_LID_SWITCH
#define CONFIG_LOW_POWER_IDLE
#define CONFIG_STM_HWTIMER32

View File

@@ -49,6 +49,7 @@
#undef CONFIG_HOSTCMD_EVENTS
#define CONFIG_HW_CRC
#define CONFIG_I2C
#define CONFIG_I2C_SLAVE_ONLY
#undef CONFIG_LID_SWITCH
#define CONFIG_LOW_POWER_IDLE
#define CONFIG_STM_HWTIMER32

View File

@@ -45,7 +45,9 @@ 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_INDUCTIVE_CHARGING)+=inductive_charging.o
common-$(CONFIG_KEYBOARD_PROTOCOL_8042)+=keyboard_8042.o \
keyboard_8042_sharedlib.o

View File

@@ -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
#ifdef CONFIG_I2C
#if defined(CONFIG_I2C) && !defined(CONFIG_I2C_SLAVE_ONLY)
| EC_FEATURE_MASK_0(EC_FEATURE_I2C)
#endif
#ifdef CONFIG_CHARGER

View File

@@ -444,7 +444,7 @@ static void jump_to_image(uintptr_t init_addr)
pd_prepare_reset();
#endif
#ifdef CONFIG_I2C
#if defined(CONFIG_I2C) && !defined(CONFIG_I2C_SLAVE_ONLY)
/* Prepare I2C module for sysjump */
i2c_prepare_sysjump();
#endif

View File

@@ -1043,6 +1043,9 @@
#undef CONFIG_I2C_PASSTHROUGH
#undef CONFIG_I2C_PASSTHRU_RESTRICTED
/* For EC that is only an I2C slave */
#undef CONFIG_I2C_SLAVE_ONLY
/* Defines I2C operation retry count when slave nack'd(EC_ERROR_BUSY) */
#define CONFIG_I2C_NACK_RETRY_COUNT 0
/*

View File

@@ -78,7 +78,7 @@ static int stress(const char *name,
/*****************************************************************************/
/* Tests */
#ifdef CONFIG_I2C
#if defined(CONFIG_I2C) && !defined(CONFIG_I2C_SLAVE_ONLY)
static int test_i2c(void)
{
int res = EC_ERROR_UNKNOWN;
@@ -135,7 +135,7 @@ void run_test(void)
{
test_reset();
#ifdef CONFIG_I2C
#if defined(CONFIG_I2C) && !defined(CONFIG_I2C_SLAVE_ONLY)
RUN_STRESS_TEST("I2C Stress Test", test_i2c, I2C_TEST_ITERATION);
#endif
#ifdef CONFIG_ADC