Lines Matching refs:dd

229 	struct iproc_i2c_data *dd = DEV_DATA(dev);  in iproc_i2c_target_init()  local
231 struct i2c_target_config *target_config = dd->target_cfg; in iproc_i2c_target_init()
266 dd->target_int_mask = val; in iproc_i2c_target_init()
304 struct iproc_i2c_data *dd = DEV_DATA(dev); in iproc_i2c_target_read() local
305 struct i2c_target_config *target_cfg = dd->target_cfg; in iproc_i2c_target_read()
319 dd->rx_start_rcvd = true; in iproc_i2c_target_read()
320 dd->target_read_complete = false; in iproc_i2c_target_read()
321 } else if ((rx_status == I2C_TARGET_RX_DATA) && dd->rx_start_rcvd) { in iproc_i2c_target_read()
324 } else if ((rx_status == I2C_TARGET_RX_END) && dd->rx_start_rcvd) { in iproc_i2c_target_read()
326 if (dd->target_rx_only) { in iproc_i2c_target_read()
331 dd->rx_start_rcvd = false; in iproc_i2c_target_read()
332 dd->target_read_complete = true; in iproc_i2c_target_read()
342 struct iproc_i2c_data *dd = DEV_DATA(dev); in iproc_i2c_target_rx() local
347 if (!dd->target_rx_only && dd->target_read_complete) { in iproc_i2c_target_rx()
358 dd->tx_underrun = 0; in iproc_i2c_target_rx()
359 dd->target_int_mask |= BIT(IE_S_TX_UNDERRUN_SHIFT); in iproc_i2c_target_rx()
366 sys_write32(dd->target_int_mask, base + IE_OFFSET); in iproc_i2c_target_rx()
371 struct iproc_i2c_data *dd = DEV_DATA(dev); in iproc_i2c_target_isr() local
372 struct i2c_target_config *target_cfg = dd->target_cfg; in iproc_i2c_target_isr()
383 val &= ~dd->target_int_mask; in iproc_i2c_target_isr()
388 dd->target_rx_only = false; in iproc_i2c_target_isr()
391 dd->target_rx_only = true; in iproc_i2c_target_isr()
408 dd->tx_underrun++; in iproc_i2c_target_isr()
409 if (dd->tx_underrun == 1) { in iproc_i2c_target_isr()
431 dd->target_int_mask &= ~BIT(IE_S_TX_UNDERRUN_SHIFT); in iproc_i2c_target_isr()
432 sys_write32(dd->target_int_mask, base + IE_OFFSET); in iproc_i2c_target_isr()
452 if (!dd->target_rx_only) { in iproc_i2c_target_isr()
460 struct iproc_i2c_data *dd = DEV_DATA(dev); in iproc_i2c_target_register() local
464 if (dd->target_cfg) { in iproc_i2c_target_register()
470 dd->target_cfg = target_config; in iproc_i2c_target_register()
486 struct iproc_i2c_data *dd = DEV_DATA(dev); in iproc_i2c_target_unregister() local
488 if (!dd->target_cfg) { in iproc_i2c_target_unregister()
500 dd->target_cfg = NULL; in iproc_i2c_target_unregister()
614 struct iproc_i2c_data *dd = DEV_DATA(dev); in iproc_i2c_read_valid_bytes() local
615 struct i2c_msg *msg = dd->msg; in iproc_i2c_read_valid_bytes()
619 while (dd->rx_bytes < msg->len) { in iproc_i2c_read_valid_bytes()
627 msg->buf[dd->rx_bytes] = (val >> M_RX_DATA_SHIFT) & M_RX_DATA_MASK; in iproc_i2c_read_valid_bytes()
628 dd->rx_bytes++; in iproc_i2c_read_valid_bytes()
634 struct iproc_i2c_data *dd = DEV_DATA(dev); in iproc_i2c_data_recv() local
636 struct i2c_msg *msg = dd->msg; in iproc_i2c_data_recv()
641 bytes_left = msg->len - dd->rx_bytes; in iproc_i2c_data_recv()
645 } else if (bytes_left < dd->thld_bytes) { in iproc_i2c_data_recv()
651 dd->thld_bytes = bytes_left; in iproc_i2c_data_recv()
664 struct iproc_i2c_data *dd = DEV_DATA(dev); in iproc_i2c_transfer_one() local
677 dd->msg = msg; in iproc_i2c_transfer_one()
694 dd->tx_bytes = tx_bytes; in iproc_i2c_transfer_one()
704 if (!(msg->flags & I2C_MSG_READ) && (msg->len > dd->tx_bytes)) { in iproc_i2c_transfer_one()
719 dd->rx_bytes = 0; in iproc_i2c_transfer_one()
726 dd->thld_bytes = M_RX_FIFO_THLD_VALUE; in iproc_i2c_transfer_one()
728 dd->thld_bytes = msg->len; in iproc_i2c_transfer_one()
734 tmp |= dd->thld_bytes << M_FIFO_RX_THLD_SHIFT; in iproc_i2c_transfer_one()
749 rc = k_sem_take(&dd->device_sync_sem, K_MSEC(I2C_TIMEOUT_MSEC)); in iproc_i2c_transfer_one()
803 struct iproc_i2c_data *dd = DEV_DATA(dev); in iproc_i2c_send_data() local
804 struct i2c_msg *msg = dd->msg; in iproc_i2c_send_data()
805 uint32_t tx_bytes = msg->len - dd->tx_bytes; in iproc_i2c_send_data()
811 uint32_t idx = dd->tx_bytes + i; in iproc_i2c_send_data()
835 dd->tx_bytes += tx_bytes; in iproc_i2c_send_data()
840 struct iproc_i2c_data *dd = DEV_DATA(dev); in iproc_i2c_master_isr() local
854 k_sem_give(&dd->device_sync_sem); in iproc_i2c_master_isr()
892 struct iproc_i2c_data *dd = DEV_DATA(dev); in iproc_i2c_init() local
896 k_sem_init(&dd->device_sync_sem, 0, 1); in iproc_i2c_init()
903 if (dd->target_cfg == NULL) { in iproc_i2c_init()