Lines Matching refs:i2c_bus
244 static int cdns_i2c_write_data(struct i2c_cdns_bus *i2c_bus, u32 addr, u8 *data, in cdns_i2c_write_data() argument
248 struct cdns_i2c_regs *regs = i2c_bus->regs; in cdns_i2c_write_data()
286 if (!i2c_bus->hold_flag) in cdns_i2c_write_data()
306 static int cdns_i2c_read_data(struct i2c_cdns_bus *i2c_bus, u32 addr, u8 *data, in cdns_i2c_read_data() argument
310 struct cdns_i2c_regs *regs = i2c_bus->regs; in cdns_i2c_read_data()
336 hold_quirk = (i2c_bus->quirks & CDNS_I2C_BROKEN_HOLD_BIT) && updatetx; in cdns_i2c_read_data()
341 !i2c_bus->hold_flag) { in cdns_i2c_read_data()
401 struct i2c_cdns_bus *i2c_bus = dev_get_priv(dev); in cdns_i2c_xfer() local
408 hold_quirk = !!(i2c_bus->quirks & CDNS_I2C_BROKEN_HOLD_BIT); in cdns_i2c_xfer()
425 i2c_bus->hold_flag = 1; in cdns_i2c_xfer()
426 setbits_le32(&i2c_bus->regs->control, CDNS_I2C_CONTROL_HOLD); in cdns_i2c_xfer()
428 i2c_bus->hold_flag = 0; in cdns_i2c_xfer()
436 ret = cdns_i2c_read_data(i2c_bus, msg->addr, msg->buf, in cdns_i2c_xfer()
439 ret = cdns_i2c_write_data(i2c_bus, msg->addr, msg->buf, in cdns_i2c_xfer()
462 struct i2c_cdns_bus *i2c_bus = dev_get_priv(dev); in cdns_i2c_ofdata_to_platdata() local
468 i2c_bus->regs = (struct cdns_i2c_regs *)dev_read_addr(dev); in cdns_i2c_ofdata_to_platdata()
469 if (!i2c_bus->regs) in cdns_i2c_ofdata_to_platdata()
473 i2c_bus->quirks = pdata->quirks; in cdns_i2c_ofdata_to_platdata()
479 i2c_bus->input_freq = clk_get_rate(&clk); in cdns_i2c_ofdata_to_platdata()