Skip to content

Commit dbb1c2e

Browse files
andy-shevAndi Shyti
authored andcommitted
i2c: rzv2m: Use i2c_10bit_addr_*_from_msg() helpers
Use i2c_10bit_addr_*_from_msg() helpers instead of local copy. No functional change intended. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20250213141045.2716943-9-andriy.shevchenko@linux.intel.com Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
1 parent 6cdc8fe commit dbb1c2e

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

drivers/i2c/busses/i2c-rzv2m.c

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -287,20 +287,15 @@ static int rzv2m_i2c_send_address(struct rzv2m_i2c_priv *priv,
287287
int ret;
288288

289289
if (msg->flags & I2C_M_TEN) {
290-
/*
291-
* 10-bit address
292-
* addr_1: 5'b11110 | addr[9:8] | (R/nW)
293-
* addr_2: addr[7:0]
294-
*/
295-
addr = 0xf0 | ((msg->addr & GENMASK(9, 8)) >> 7);
296-
addr |= !!(msg->flags & I2C_M_RD);
297-
/* Send 1st address(extend code) */
290+
/* 10-bit address: Send 1st address(extend code) */
291+
addr = i2c_10bit_addr_hi_from_msg(msg);
298292
ret = rzv2m_i2c_write_with_ack(priv, addr);
299293
if (ret)
300294
return ret;
301295

302-
/* Send 2nd address */
303-
ret = rzv2m_i2c_write_with_ack(priv, msg->addr & 0xff);
296+
/* 10-bit address: Send 2nd address */
297+
addr = i2c_10bit_addr_lo_from_msg(msg);
298+
ret = rzv2m_i2c_write_with_ack(priv, addr);
304299
} else {
305300
/* 7-bit address */
306301
addr = i2c_8bit_addr_from_msg(msg);

0 commit comments

Comments
 (0)