From c0fbbaefed2b82bacf4a202cda529658b5d6d058 Mon Sep 17 00:00:00 2001 From: Randall Spangler Date: Thu, 24 Oct 2013 15:50:53 -0700 Subject: cleanup: comments in i2c modules No code changes; just update comments with bug links BUG=none BRANCH=none TEST=build all platforms Change-Id: I8b845f9c43315b7db5a746a16c6618c3ee96979d Signed-off-by: Randall Spangler Reviewed-on: https://chromium-review.googlesource.com/174614 Reviewed-by: Bill Richardson --- common/i2c.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'common') diff --git a/common/i2c.c b/common/i2c.c index ed3a888872..2db40bdf21 100644 --- a/common/i2c.c +++ b/common/i2c.c @@ -114,7 +114,10 @@ int i2c_write8(int port, int slave_addr, int offset, int data) /*****************************************************************************/ /* Host commands */ -/* TODO: replace with single I2C passthru command */ +/* + * TODO(crosbug.com/p/23570): remove separate read and write commands, as soon + * as ectool supports EC_CMD_I2C_PASSTHRU. + */ static int i2c_command_read(struct host_cmd_handler_args *args) { @@ -163,9 +166,8 @@ static int i2c_command_write(struct host_cmd_handler_args *args) } DECLARE_HOST_COMMAND(EC_CMD_I2C_WRITE, i2c_command_write, EC_VER_MASK(0)); -/* TODO: remove temporary extra debugging for help host-side debugging */ #ifdef CONFIG_I2C_DEBUG_PASSTHRU -#define PTHRUPRINTF(format, args...) cprintf(CC_I2C, format, ## args) +#define PTHRUPRINTF(format, args...) CPRINTF(format, ## args) #else #define PTHRUPRINTF(format, args...) #endif @@ -343,11 +345,10 @@ static void scan_bus(int port, const char *desc) #ifdef CHIP_FAMILY_stm32f /* - * Hope that address 0 exists, because the i2c_xfer() - * implementation on STM32F can't read a byte without writing - * one first. - * - * TODO: remove when that limitation is fixed. + * TODO(crosbug.com/p/23569): The i2c_xfer() implementation on + * STM32F can't read a byte without writing one first. So + * write a byte and hope nothing bad happens. Remove this + * workaround when STM32F is fixed. */ tmp = 0; if (!i2c_xfer(port, a, &tmp, 1, &tmp, 1, I2C_XFER_SINGLE)) -- cgit v1.2.1