Lines Matching full:blk
245 struct qup_i2c_block blk; member
291 struct qup_i2c_block *blk = &qup->blk; in qup_i2c_interrupt() local
342 blk->tx_fifo_free += qup->out_blk_sz; in qup_i2c_interrupt()
353 if (!blk->is_rx_blk_mode) { in qup_i2c_interrupt()
354 blk->fifo_available += qup->in_fifo_sz; in qup_i2c_interrupt()
357 blk->fifo_available += qup->in_blk_sz; in qup_i2c_interrupt()
363 if (!blk->rx_bytes_read) in qup_i2c_interrupt()
373 if (blk->is_tx_blk_mode && !(opflags & QUP_MX_OUTPUT_DONE)) in qup_i2c_interrupt()
485 struct qup_i2c_block *blk = &qup->blk; in qup_i2c_write_tx_fifo_v1() local
495 blk->tx_fifo_free--; in qup_i2c_write_tx_fifo_v1()
501 while (blk->tx_fifo_free && qup->pos < msg->len) { in qup_i2c_write_tx_fifo_v1()
518 blk->tx_fifo_free--; in qup_i2c_write_tx_fifo_v1()
525 qup->blk.pos = 0; in qup_i2c_set_blk_data()
526 qup->blk.data_len = msg->len; in qup_i2c_set_blk_data()
527 qup->blk.count = DIV_ROUND_UP(msg->len, qup->blk_xfer_limit); in qup_i2c_set_blk_data()
534 if (qup->blk.data_len > qup->blk_xfer_limit) in qup_i2c_get_data_len()
537 data_len = qup->blk.data_len; in qup_i2c_get_data_len()
576 int last = (qup->blk.pos == (qup->blk.count - 1)) && (qup->is_last); in qup_i2c_set_tags()
582 if (qup->blk.pos == 0) { in qup_i2c_set_tags()
598 tags[len++] = qup->blk.pos == (qup->blk.count - 1) ? in qup_i2c_set_tags()
685 blocks = qup->blk.count; in qup_i2c_bam_make_desc()
689 while (qup->blk.pos < blocks) { in qup_i2c_bam_make_desc()
693 qup->blk.data_len -= tlen; in qup_i2c_bam_make_desc()
711 qup->blk.pos = i; in qup_i2c_bam_make_desc()
721 while (qup->blk.pos < blocks) { in qup_i2c_bam_make_desc()
725 qup->blk.data_len -= tlen; in qup_i2c_bam_make_desc()
740 qup->blk.pos = i; in qup_i2c_bam_make_desc()
950 struct qup_i2c_block *blk = &qup->blk; in qup_i2c_read_rx_fifo_v1() local
955 while (blk->fifo_available && qup->pos < msg->len) { in qup_i2c_read_rx_fifo_v1()
964 blk->fifo_available--; in qup_i2c_read_rx_fifo_v1()
968 blk->rx_bytes_read = true; in qup_i2c_read_rx_fifo_v1()
987 struct qup_i2c_block *blk = &qup->blk; in qup_i2c_conf_v1() local
991 blk->is_tx_blk_mode = blk->total_tx_len > qup->out_fifo_sz; in qup_i2c_conf_v1()
992 blk->is_rx_blk_mode = blk->total_rx_len > qup->in_fifo_sz; in qup_i2c_conf_v1()
994 if (blk->is_tx_blk_mode) { in qup_i2c_conf_v1()
997 writel(blk->total_tx_len, qup->base + QUP_MX_OUTPUT_CNT); in qup_i2c_conf_v1()
1000 writel(blk->total_tx_len, qup->base + QUP_MX_WRITE_CNT); in qup_i2c_conf_v1()
1003 if (blk->total_rx_len) { in qup_i2c_conf_v1()
1004 if (blk->is_rx_blk_mode) { in qup_i2c_conf_v1()
1007 writel(blk->total_rx_len, qup->base + QUP_MX_INPUT_CNT); in qup_i2c_conf_v1()
1010 writel(blk->total_rx_len, qup->base + QUP_MX_READ_CNT); in qup_i2c_conf_v1()
1020 static void qup_i2c_clear_blk_v1(struct qup_i2c_block *blk) in qup_i2c_clear_blk_v1() argument
1022 blk->tx_fifo_free = 0; in qup_i2c_clear_blk_v1()
1023 blk->fifo_available = 0; in qup_i2c_clear_blk_v1()
1024 blk->rx_bytes_read = false; in qup_i2c_clear_blk_v1()
1029 struct qup_i2c_block *blk = &qup->blk; in qup_i2c_conf_xfer_v1() local
1032 qup_i2c_clear_blk_v1(blk); in qup_i2c_conf_xfer_v1()
1046 if (!blk->is_tx_blk_mode) { in qup_i2c_conf_xfer_v1()
1047 blk->tx_fifo_free = qup->out_fifo_sz; in qup_i2c_conf_xfer_v1()
1073 struct qup_i2c_block *blk = &qup->blk; in qup_i2c_write_one() local
1076 blk->total_tx_len = msg->len + 1; in qup_i2c_write_one()
1077 blk->total_rx_len = 0; in qup_i2c_write_one()
1084 struct qup_i2c_block *blk = &qup->blk; in qup_i2c_read_one() local
1087 blk->total_tx_len = 2; in qup_i2c_read_one()
1088 blk->total_rx_len = qup->msg->len; in qup_i2c_read_one()
1156 struct qup_i2c_block *blk = &qup->blk; in qup_i2c_conf_count_v2() local
1159 if (blk->is_tx_blk_mode) in qup_i2c_conf_count_v2()
1160 writel(qup->config_run | blk->total_tx_len, in qup_i2c_conf_count_v2()
1163 writel(qup->config_run | blk->total_tx_len, in qup_i2c_conf_count_v2()
1166 if (blk->total_rx_len) { in qup_i2c_conf_count_v2()
1167 if (blk->is_rx_blk_mode) in qup_i2c_conf_count_v2()
1168 writel(qup->config_run | blk->total_rx_len, in qup_i2c_conf_count_v2()
1171 writel(qup->config_run | blk->total_rx_len, in qup_i2c_conf_count_v2()
1187 struct qup_i2c_block *blk = &qup->blk; in qup_i2c_conf_mode_v2() local
1190 if (blk->is_tx_blk_mode) { in qup_i2c_conf_mode_v2()
1197 if (blk->is_rx_blk_mode) { in qup_i2c_conf_mode_v2()
1208 static void qup_i2c_clear_blk_v2(struct qup_i2c_block *blk) in qup_i2c_clear_blk_v2() argument
1210 blk->send_last_word = false; in qup_i2c_clear_blk_v2()
1211 blk->tx_tags_sent = false; in qup_i2c_clear_blk_v2()
1212 blk->tx_fifo_data = 0; in qup_i2c_clear_blk_v2()
1213 blk->tx_fifo_data_pos = 0; in qup_i2c_clear_blk_v2()
1214 blk->tx_fifo_free = 0; in qup_i2c_clear_blk_v2()
1216 blk->rx_tags_fetched = false; in qup_i2c_clear_blk_v2()
1217 blk->rx_bytes_read = false; in qup_i2c_clear_blk_v2()
1218 blk->rx_fifo_data = 0; in qup_i2c_clear_blk_v2()
1219 blk->rx_fifo_data_pos = 0; in qup_i2c_clear_blk_v2()
1220 blk->fifo_available = 0; in qup_i2c_clear_blk_v2()
1226 struct qup_i2c_block *blk = &qup->blk; in qup_i2c_recv_data() local
1229 for (j = blk->rx_fifo_data_pos; in qup_i2c_recv_data()
1230 blk->cur_blk_len && blk->fifo_available; in qup_i2c_recv_data()
1231 blk->cur_blk_len--, blk->fifo_available--) { in qup_i2c_recv_data()
1233 blk->rx_fifo_data = readl(qup->base + QUP_IN_FIFO_BASE); in qup_i2c_recv_data()
1235 *(blk->cur_data++) = blk->rx_fifo_data; in qup_i2c_recv_data()
1236 blk->rx_fifo_data >>= 8; in qup_i2c_recv_data()
1244 blk->rx_fifo_data_pos = j; in qup_i2c_recv_data()
1250 struct qup_i2c_block *blk = &qup->blk; in qup_i2c_recv_tags() local
1252 blk->rx_fifo_data = readl(qup->base + QUP_IN_FIFO_BASE); in qup_i2c_recv_tags()
1253 blk->rx_fifo_data >>= blk->rx_tag_len * 8; in qup_i2c_recv_tags()
1254 blk->rx_fifo_data_pos = blk->rx_tag_len; in qup_i2c_recv_tags()
1255 blk->fifo_available -= blk->rx_tag_len; in qup_i2c_recv_tags()
1268 struct qup_i2c_block *blk = &qup->blk; in qup_i2c_read_rx_fifo_v2() local
1270 if (!blk->rx_tags_fetched) { in qup_i2c_read_rx_fifo_v2()
1272 blk->rx_tags_fetched = true; in qup_i2c_read_rx_fifo_v2()
1276 if (!blk->cur_blk_len) in qup_i2c_read_rx_fifo_v2()
1277 blk->rx_bytes_read = true; in qup_i2c_read_rx_fifo_v2()
1288 struct qup_i2c_block *blk = &qup->blk; in qup_i2c_write_blk_data() local
1291 for (j = blk->tx_fifo_data_pos; *len && blk->tx_fifo_free; in qup_i2c_write_blk_data()
1292 (*len)--, blk->tx_fifo_free--) { in qup_i2c_write_blk_data()
1293 blk->tx_fifo_data |= *(*data)++ << (j * 8); in qup_i2c_write_blk_data()
1295 writel(blk->tx_fifo_data, in qup_i2c_write_blk_data()
1297 blk->tx_fifo_data = 0x0; in qup_i2c_write_blk_data()
1304 blk->tx_fifo_data_pos = j; in qup_i2c_write_blk_data()
1310 struct qup_i2c_block *blk = &qup->blk; in qup_i2c_write_rx_tags_v2() local
1312 qup_i2c_write_blk_data(qup, &blk->cur_tx_tags, &blk->tx_tag_len); in qup_i2c_write_rx_tags_v2()
1313 if (blk->tx_fifo_data_pos) in qup_i2c_write_rx_tags_v2()
1314 writel(blk->tx_fifo_data, qup->base + QUP_OUT_FIFO_BASE); in qup_i2c_write_rx_tags_v2()
1341 struct qup_i2c_block *blk = &qup->blk; in qup_i2c_write_tx_fifo_v2() local
1343 if (!blk->tx_tags_sent) { in qup_i2c_write_tx_fifo_v2()
1344 qup_i2c_write_blk_data(qup, &blk->cur_tx_tags, in qup_i2c_write_tx_fifo_v2()
1345 &blk->tx_tag_len); in qup_i2c_write_tx_fifo_v2()
1346 blk->tx_tags_sent = true; in qup_i2c_write_tx_fifo_v2()
1349 if (blk->send_last_word) in qup_i2c_write_tx_fifo_v2()
1352 qup_i2c_write_blk_data(qup, &blk->cur_data, &blk->cur_blk_len); in qup_i2c_write_tx_fifo_v2()
1353 if (!blk->cur_blk_len) { in qup_i2c_write_tx_fifo_v2()
1354 if (!blk->tx_fifo_data_pos) in qup_i2c_write_tx_fifo_v2()
1357 if (blk->tx_fifo_free) in qup_i2c_write_tx_fifo_v2()
1360 blk->send_last_word = true; in qup_i2c_write_tx_fifo_v2()
1366 writel(blk->tx_fifo_data, qup->base + QUP_OUT_FIFO_BASE); in qup_i2c_write_tx_fifo_v2()
1378 struct qup_i2c_block *blk = &qup->blk; in qup_i2c_conf_xfer_v2() local
1394 blk->cur_data += 1; in qup_i2c_conf_xfer_v2()
1403 qup_i2c_clear_blk_v2(blk); in qup_i2c_conf_xfer_v2()
1425 if (!blk->is_tx_blk_mode) { in qup_i2c_conf_xfer_v2()
1426 blk->tx_fifo_free = qup->out_fifo_sz; in qup_i2c_conf_xfer_v2()
1464 struct qup_i2c_block *blk = &qup->blk; in qup_i2c_xfer_v2_msg() local
1470 for (i = 0; i < blk->count; i++) { in qup_i2c_xfer_v2_msg()
1472 blk->pos = i; in qup_i2c_xfer_v2_msg()
1473 blk->cur_tx_tags = blk->tags; in qup_i2c_xfer_v2_msg()
1474 blk->cur_blk_len = data_len; in qup_i2c_xfer_v2_msg()
1475 blk->tx_tag_len = in qup_i2c_xfer_v2_msg()
1476 qup_i2c_set_tags(blk->cur_tx_tags, qup, qup->msg); in qup_i2c_xfer_v2_msg()
1478 blk->cur_data = msg_buf; in qup_i2c_xfer_v2_msg()
1481 blk->total_tx_len = blk->tx_tag_len; in qup_i2c_xfer_v2_msg()
1482 blk->rx_tag_len = 2; in qup_i2c_xfer_v2_msg()
1483 blk->total_rx_len = blk->rx_tag_len + data_len; in qup_i2c_xfer_v2_msg()
1485 blk->total_tx_len = blk->tx_tag_len + data_len; in qup_i2c_xfer_v2_msg()
1486 blk->total_rx_len = 0; in qup_i2c_xfer_v2_msg()
1490 !qup->is_last || i < blk->count - 1); in qup_i2c_xfer_v2_msg()
1511 blk->data_len -= qup->blk_xfer_limit; in qup_i2c_xfer_v2_msg()
1560 qup->blk.is_tx_blk_mode = max_tx_len > qup->out_fifo_sz - in qup_i2c_determine_mode_v2()
1562 qup->blk.is_rx_blk_mode = max_rx_len > qup->in_fifo_sz - in qup_i2c_determine_mode_v2()