Lines Matching refs:i2c_bus
226 static int cdns_i2c_write_data(struct i2c_cdns_bus *i2c_bus, u32 addr, u8 *data, in cdns_i2c_write_data() argument
230 struct cdns_i2c_regs *regs = i2c_bus->regs; in cdns_i2c_write_data()
260 if (!i2c_bus->hold_flag) in cdns_i2c_write_data()
274 static int cdns_i2c_read_data(struct i2c_cdns_bus *i2c_bus, u32 addr, u8 *data, in cdns_i2c_read_data() argument
278 struct cdns_i2c_regs *regs = i2c_bus->regs; in cdns_i2c_read_data()
307 hold_quirk = (i2c_bus->quirks & CDNS_I2C_BROKEN_HOLD_BIT) && updatetx; in cdns_i2c_read_data()
312 !i2c_bus->hold_flag) { in cdns_i2c_read_data()
367 struct i2c_cdns_bus *i2c_bus = dev_get_priv(dev); in cdns_i2c_xfer() local
371 hold_quirk = !!(i2c_bus->quirks & CDNS_I2C_BROKEN_HOLD_BIT); in cdns_i2c_xfer()
388 i2c_bus->hold_flag = 1; in cdns_i2c_xfer()
389 setbits_le32(&i2c_bus->regs->control, CDNS_I2C_CONTROL_HOLD); in cdns_i2c_xfer()
391 i2c_bus->hold_flag = 0; in cdns_i2c_xfer()
398 ret = cdns_i2c_read_data(i2c_bus, msg->addr, msg->buf, in cdns_i2c_xfer()
401 ret = cdns_i2c_write_data(i2c_bus, msg->addr, msg->buf, in cdns_i2c_xfer()
415 struct i2c_cdns_bus *i2c_bus = dev_get_priv(dev); in cdns_i2c_ofdata_to_platdata() local
419 i2c_bus->regs = (struct cdns_i2c_regs *)devfdt_get_addr(dev); in cdns_i2c_ofdata_to_platdata()
420 if (!i2c_bus->regs) in cdns_i2c_ofdata_to_platdata()
424 i2c_bus->quirks = pdata->quirks; in cdns_i2c_ofdata_to_platdata()
426 i2c_bus->input_freq = 100000000; /* TODO hardcode input freq for now */ in cdns_i2c_ofdata_to_platdata()