i2c: ibm_iic: Use i2c_*bit_addr*_from_msg() helpers
Use i2c_*bit_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-10-andriy.shevchenko@linux.intel.com Signed-off-by: Andi Shyti <andi.shyti@kernel.org>pull/1193/head
parent
dbb1c2edb5
commit
2ee4415274
|
|
@ -512,19 +512,17 @@ static int iic_xfer_bytes(struct ibm_iic_private* dev, struct i2c_msg* pm,
|
|||
static inline void iic_address(struct ibm_iic_private* dev, struct i2c_msg* msg)
|
||||
{
|
||||
volatile struct iic_regs __iomem *iic = dev->vaddr;
|
||||
u16 addr = msg->addr;
|
||||
|
||||
DBG2("%d: iic_address, 0x%03x (%d-bit)\n", dev->idx,
|
||||
addr, msg->flags & I2C_M_TEN ? 10 : 7);
|
||||
msg->addr, msg->flags & I2C_M_TEN ? 10 : 7);
|
||||
|
||||
if (msg->flags & I2C_M_TEN){
|
||||
if (msg->flags & I2C_M_TEN) {
|
||||
out_8(&iic->cntl, CNTL_AMD);
|
||||
out_8(&iic->lmadr, addr);
|
||||
out_8(&iic->hmadr, 0xf0 | ((addr >> 7) & 0x06));
|
||||
}
|
||||
else {
|
||||
out_8(&iic->lmadr, i2c_10bit_addr_lo_from_msg(msg));
|
||||
out_8(&iic->hmadr, i2c_10bit_addr_hi_from_msg(msg) & ~I2C_M_RD);
|
||||
} else {
|
||||
out_8(&iic->cntl, 0);
|
||||
out_8(&iic->lmadr, addr << 1);
|
||||
out_8(&iic->lmadr, i2c_8bit_addr_from_msg(msg) & ~I2C_M_RD);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue