mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-07 16:11:43 +00:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
/*
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user