summaryrefslogtreecommitdiff
path: root/chip/stm32/i2c-stm32l.c
diff options
context:
space:
mode:
Diffstat (limited to 'chip/stm32/i2c-stm32l.c')
-rw-r--r--chip/stm32/i2c-stm32l.c35
1 files changed, 0 insertions, 35 deletions
diff --git a/chip/stm32/i2c-stm32l.c b/chip/stm32/i2c-stm32l.c
index 34a80c2b3e..e274207cb8 100644
--- a/chip/stm32/i2c-stm32l.c
+++ b/chip/stm32/i2c-stm32l.c
@@ -22,9 +22,6 @@
#define CPUTS(outstr) cputs(CC_I2C, outstr)
#define CPRINTS(format, args...) cprints(CC_I2C, format, ## args)
-/* Maximum transfer of a SMBUS block transfer */
-#define SMBUS_MAX_BLOCK 32
-
#define I2C_ERROR_FAILED_START EC_ERROR_INTERNAL_FIRST
/*
@@ -367,38 +364,6 @@ int i2c_get_line_levels(int port)
(i2c_raw_get_scl(port) ? I2C_LINE_SCL_HIGH : 0);
}
-int i2c_read_string(int port, int slave_addr, int offset, uint8_t *data,
- int len)
-{
- int rv;
- uint8_t reg, block_length;
-
- /*
- * TODO(crosbug.com/p/23569): when i2c_xfer() supports start/stop bits,
- * merge this with the LM4 implementation and move to i2c_common.c.
- */
-
- if ((len <= 0) || (len > SMBUS_MAX_BLOCK))
- return EC_ERROR_INVAL;
-
- i2c_lock(port, 1);
-
- /* Read the counted string into the output buffer */
- reg = offset;
- rv = i2c_xfer(port, slave_addr, &reg, 1, data, len, I2C_XFER_SINGLE);
- if (rv == EC_SUCCESS) {
- /* Block length is the first byte of the returned buffer */
- block_length = MIN(data[0], len - 1);
-
- /* Move data down, then null-terminate it */
- memmove(data, data + 1, block_length);
- data[block_length] = 0;
- }
-
- i2c_lock(port, 0);
- return rv;
-}
-
/*****************************************************************************/
/* Hooks */