chip/stm32/i2c-stm32l.c: Format with clang-format
BRANCH=none
TEST=none
static void dump_i2c_reg(int port, const char *what)
{
CPRINTS("i2c CR1=%04x CR2=%04x SR1=%04x SR2=%04x %s",
- STM32_I2C_CR1(port),
- STM32_I2C_CR2(port),
- STM32_I2C_SR1(port),
- STM32_I2C_SR2(port),
- what);
+ STM32_I2C_CR1(port), STM32_I2C_CR2(port), STM32_I2C_SR1(port),
+ STM32_I2C_SR2(port), what);
}
#else
static inline void dump_i2c_reg(int port, const char *what)
@@ -164,10 +161,8 @@ static void i2c_init_port(const struct i2c_port_t *p)
/*****************************************************************************/
/* Interface */
-int chip_i2c_xfer(const int port,
- const uint16_t addr_flags,
- const uint8_t *out, int out_bytes,
- uint8_t *in, int in_bytes, int flags)
+int chip_i2c_xfer(const int port, const uint16_t addr_flags, const uint8_t *out,
+ int out_bytes, uint8_t *in, int in_bytes, int flags)
{
int addr_8bit = I2C_STRIP_FLAGS(addr_flags) << 1;
int started = (flags & I2C_XFER_START) ? 0 : 1;
@@ -188,10 +183,8 @@ int chip_i2c_xfer(const int port,
STM32_I2C_SR1(port) = 0;
/* Clear start, stop, POS, ACK bits to get us in a known state */
- STM32_I2C_CR1(port) &= ~(STM32_I2C_CR1_START |
- STM32_I2C_CR1_STOP |
- STM32_I2C_CR1_POS |
- STM32_I2C_CR1_ACK);
+ STM32_I2C_CR1(port) &= ~(STM32_I2C_CR1_START | STM32_I2C_CR1_STOP |
+ STM32_I2C_CR1_POS | STM32_I2C_CR1_ACK);
/* No out bytes and no in bytes means just check for active */
if (out_bytes || !in_bytes) {
@@ -305,7 +298,8 @@ int chip_i2c_xfer(const int port,
if (rv == I2C_ERROR_FAILED_START) {
const struct i2c_port_t *p = i2c_ports;
CPRINTS("chip_i2c_xfer start error; "
- "unwedging and resetting i2c %d", port);
+ "unwedging and resetting i2c %d",
+ port);
i2c_unwedge(port);
@@ -419,6 +413,4 @@ static int command_i2cdump(int argc, char **argv)
dump_i2c_reg(I2C_PORT_MASTER, "dump");
return EC_SUCCESS;
}
-DECLARE_CONSOLE_COMMAND(i2cdump, command_i2cdump,
- NULL,
- "Dump I2C regs");
+DECLARE_CONSOLE_COMMAND(i2cdump, command_i2cdump, NULL, "Dump I2C regs");
