Skip to content

Commit bc02f34

Browse files
committed
drivers: smbus: stm32: send block write byte count
Send "count" byte. The SMBus block write protocol requires this byte. Use I2C_MSG_WRITE named flag instead of 0. Signed-off-by: Andrew Lewycky <[email protected]> Signed-off-by: Chris Friedt <[email protected]>
1 parent 30ad0ee commit bc02f34

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

drivers/smbus/smbus_stm32.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,13 +235,18 @@ static int smbus_stm32_block_write(const struct device *dev, uint16_t periph_add
235235
{
236236
.buf = &command,
237237
.len = sizeof(command),
238-
.flags = 0,
238+
.flags = I2C_MSG_WRITE,
239+
},
240+
{
241+
.buf = &count,
242+
.len = sizeof(count),
243+
.flags = I2C_MSG_WRITE,
239244
},
240245
{
241246
.buf = buf,
242247
.len = count,
243-
.flags = 0,
244-
},
248+
.flags = I2C_MSG_WRITE,
249+
}
245250
};
246251

247252
return i2c_transfer(config->i2c_dev, messages, ARRAY_SIZE(messages), periph_addr);

0 commit comments

Comments
 (0)