Lines Matching full:blk

241 	struct qup_i2c_block	blk;  member
283 struct qup_i2c_block *blk = &qup->blk; in qup_i2c_interrupt() local
334 blk->tx_fifo_free += qup->out_blk_sz; in qup_i2c_interrupt()
345 if (!blk->is_rx_blk_mode) { in qup_i2c_interrupt()
346 blk->fifo_available += qup->in_fifo_sz; in qup_i2c_interrupt()
349 blk->fifo_available += qup->in_blk_sz; in qup_i2c_interrupt()
355 if (!blk->rx_bytes_read) in qup_i2c_interrupt()
365 if (blk->is_tx_blk_mode && !(opflags & QUP_MX_OUTPUT_DONE)) in qup_i2c_interrupt()
458 struct qup_i2c_block *blk = &qup->blk; in qup_i2c_write_tx_fifo_v1() local
468 blk->tx_fifo_free--; in qup_i2c_write_tx_fifo_v1()
474 while (blk->tx_fifo_free && qup->pos < msg->len) { in qup_i2c_write_tx_fifo_v1()
491 blk->tx_fifo_free--; in qup_i2c_write_tx_fifo_v1()
498 qup->blk.pos = 0; in qup_i2c_set_blk_data()
499 qup->blk.data_len = msg->len; in qup_i2c_set_blk_data()
500 qup->blk.count = DIV_ROUND_UP(msg->len, qup->blk_xfer_limit); in qup_i2c_set_blk_data()
507 if (qup->blk.data_len > qup->blk_xfer_limit) in qup_i2c_get_data_len()
510 data_len = qup->blk.data_len; in qup_i2c_get_data_len()
549 int last = (qup->blk.pos == (qup->blk.count - 1)) && (qup->is_last); in qup_i2c_set_tags()
555 if (qup->blk.pos == 0) { in qup_i2c_set_tags()
571 tags[len++] = qup->blk.pos == (qup->blk.count - 1) ? in qup_i2c_set_tags()
658 blocks = qup->blk.count; in qup_i2c_bam_make_desc()
662 while (qup->blk.pos < blocks) { in qup_i2c_bam_make_desc()
666 qup->blk.data_len -= tlen; in qup_i2c_bam_make_desc()
684 qup->blk.pos = i; in qup_i2c_bam_make_desc()
694 while (qup->blk.pos < blocks) { in qup_i2c_bam_make_desc()
698 qup->blk.data_len -= tlen; in qup_i2c_bam_make_desc()
713 qup->blk.pos = i; in qup_i2c_bam_make_desc()
919 struct qup_i2c_block *blk = &qup->blk; in qup_i2c_read_rx_fifo_v1() local
924 while (blk->fifo_available && qup->pos < msg->len) { in qup_i2c_read_rx_fifo_v1()
933 blk->fifo_available--; in qup_i2c_read_rx_fifo_v1()
937 blk->rx_bytes_read = true; in qup_i2c_read_rx_fifo_v1()
956 struct qup_i2c_block *blk = &qup->blk; in qup_i2c_conf_v1() local
960 blk->is_tx_blk_mode = blk->total_tx_len > qup->out_fifo_sz; in qup_i2c_conf_v1()
961 blk->is_rx_blk_mode = blk->total_rx_len > qup->in_fifo_sz; in qup_i2c_conf_v1()
963 if (blk->is_tx_blk_mode) { in qup_i2c_conf_v1()
966 writel(blk->total_tx_len, qup->base + QUP_MX_OUTPUT_CNT); in qup_i2c_conf_v1()
969 writel(blk->total_tx_len, qup->base + QUP_MX_WRITE_CNT); in qup_i2c_conf_v1()
972 if (blk->total_rx_len) { in qup_i2c_conf_v1()
973 if (blk->is_rx_blk_mode) { in qup_i2c_conf_v1()
976 writel(blk->total_rx_len, qup->base + QUP_MX_INPUT_CNT); in qup_i2c_conf_v1()
979 writel(blk->total_rx_len, qup->base + QUP_MX_READ_CNT); in qup_i2c_conf_v1()
989 static void qup_i2c_clear_blk_v1(struct qup_i2c_block *blk) in qup_i2c_clear_blk_v1() argument
991 blk->tx_fifo_free = 0; in qup_i2c_clear_blk_v1()
992 blk->fifo_available = 0; in qup_i2c_clear_blk_v1()
993 blk->rx_bytes_read = false; in qup_i2c_clear_blk_v1()
998 struct qup_i2c_block *blk = &qup->blk; in qup_i2c_conf_xfer_v1() local
1001 qup_i2c_clear_blk_v1(blk); in qup_i2c_conf_xfer_v1()
1015 if (!blk->is_tx_blk_mode) { in qup_i2c_conf_xfer_v1()
1016 blk->tx_fifo_free = qup->out_fifo_sz; in qup_i2c_conf_xfer_v1()
1042 struct qup_i2c_block *blk = &qup->blk; in qup_i2c_write_one() local
1045 blk->total_tx_len = msg->len + 1; in qup_i2c_write_one()
1046 blk->total_rx_len = 0; in qup_i2c_write_one()
1053 struct qup_i2c_block *blk = &qup->blk; in qup_i2c_read_one() local
1056 blk->total_tx_len = 2; in qup_i2c_read_one()
1057 blk->total_rx_len = qup->msg->len; in qup_i2c_read_one()
1125 struct qup_i2c_block *blk = &qup->blk; in qup_i2c_conf_count_v2() local
1128 if (blk->is_tx_blk_mode) in qup_i2c_conf_count_v2()
1129 writel(qup->config_run | blk->total_tx_len, in qup_i2c_conf_count_v2()
1132 writel(qup->config_run | blk->total_tx_len, in qup_i2c_conf_count_v2()
1135 if (blk->total_rx_len) { in qup_i2c_conf_count_v2()
1136 if (blk->is_rx_blk_mode) in qup_i2c_conf_count_v2()
1137 writel(qup->config_run | blk->total_rx_len, in qup_i2c_conf_count_v2()
1140 writel(qup->config_run | blk->total_rx_len, in qup_i2c_conf_count_v2()
1156 struct qup_i2c_block *blk = &qup->blk; in qup_i2c_conf_mode_v2() local
1159 if (blk->is_tx_blk_mode) { in qup_i2c_conf_mode_v2()
1166 if (blk->is_rx_blk_mode) { in qup_i2c_conf_mode_v2()
1177 static void qup_i2c_clear_blk_v2(struct qup_i2c_block *blk) in qup_i2c_clear_blk_v2() argument
1179 blk->send_last_word = false; in qup_i2c_clear_blk_v2()
1180 blk->tx_tags_sent = false; in qup_i2c_clear_blk_v2()
1181 blk->tx_fifo_data = 0; in qup_i2c_clear_blk_v2()
1182 blk->tx_fifo_data_pos = 0; in qup_i2c_clear_blk_v2()
1183 blk->tx_fifo_free = 0; in qup_i2c_clear_blk_v2()
1185 blk->rx_tags_fetched = false; in qup_i2c_clear_blk_v2()
1186 blk->rx_bytes_read = false; in qup_i2c_clear_blk_v2()
1187 blk->rx_fifo_data = 0; in qup_i2c_clear_blk_v2()
1188 blk->rx_fifo_data_pos = 0; in qup_i2c_clear_blk_v2()
1189 blk->fifo_available = 0; in qup_i2c_clear_blk_v2()
1195 struct qup_i2c_block *blk = &qup->blk; in qup_i2c_recv_data() local
1198 for (j = blk->rx_fifo_data_pos; in qup_i2c_recv_data()
1199 blk->cur_blk_len && blk->fifo_available; in qup_i2c_recv_data()
1200 blk->cur_blk_len--, blk->fifo_available--) { in qup_i2c_recv_data()
1202 blk->rx_fifo_data = readl(qup->base + QUP_IN_FIFO_BASE); in qup_i2c_recv_data()
1204 *(blk->cur_data++) = blk->rx_fifo_data; in qup_i2c_recv_data()
1205 blk->rx_fifo_data >>= 8; in qup_i2c_recv_data()
1213 blk->rx_fifo_data_pos = j; in qup_i2c_recv_data()
1219 struct qup_i2c_block *blk = &qup->blk; in qup_i2c_recv_tags() local
1221 blk->rx_fifo_data = readl(qup->base + QUP_IN_FIFO_BASE); in qup_i2c_recv_tags()
1222 blk->rx_fifo_data >>= blk->rx_tag_len * 8; in qup_i2c_recv_tags()
1223 blk->rx_fifo_data_pos = blk->rx_tag_len; in qup_i2c_recv_tags()
1224 blk->fifo_available -= blk->rx_tag_len; in qup_i2c_recv_tags()
1237 struct qup_i2c_block *blk = &qup->blk; in qup_i2c_read_rx_fifo_v2() local
1239 if (!blk->rx_tags_fetched) { in qup_i2c_read_rx_fifo_v2()
1241 blk->rx_tags_fetched = true; in qup_i2c_read_rx_fifo_v2()
1245 if (!blk->cur_blk_len) in qup_i2c_read_rx_fifo_v2()
1246 blk->rx_bytes_read = true; in qup_i2c_read_rx_fifo_v2()
1257 struct qup_i2c_block *blk = &qup->blk; in qup_i2c_write_blk_data() local
1260 for (j = blk->tx_fifo_data_pos; *len && blk->tx_fifo_free; in qup_i2c_write_blk_data()
1261 (*len)--, blk->tx_fifo_free--) { in qup_i2c_write_blk_data()
1262 blk->tx_fifo_data |= *(*data)++ << (j * 8); in qup_i2c_write_blk_data()
1264 writel(blk->tx_fifo_data, in qup_i2c_write_blk_data()
1266 blk->tx_fifo_data = 0x0; in qup_i2c_write_blk_data()
1273 blk->tx_fifo_data_pos = j; in qup_i2c_write_blk_data()
1279 struct qup_i2c_block *blk = &qup->blk; in qup_i2c_write_rx_tags_v2() local
1281 qup_i2c_write_blk_data(qup, &blk->cur_tx_tags, &blk->tx_tag_len); in qup_i2c_write_rx_tags_v2()
1282 if (blk->tx_fifo_data_pos) in qup_i2c_write_rx_tags_v2()
1283 writel(blk->tx_fifo_data, qup->base + QUP_OUT_FIFO_BASE); in qup_i2c_write_rx_tags_v2()
1310 struct qup_i2c_block *blk = &qup->blk; in qup_i2c_write_tx_fifo_v2() local
1312 if (!blk->tx_tags_sent) { in qup_i2c_write_tx_fifo_v2()
1313 qup_i2c_write_blk_data(qup, &blk->cur_tx_tags, in qup_i2c_write_tx_fifo_v2()
1314 &blk->tx_tag_len); in qup_i2c_write_tx_fifo_v2()
1315 blk->tx_tags_sent = true; in qup_i2c_write_tx_fifo_v2()
1318 if (blk->send_last_word) in qup_i2c_write_tx_fifo_v2()
1321 qup_i2c_write_blk_data(qup, &blk->cur_data, &blk->cur_blk_len); in qup_i2c_write_tx_fifo_v2()
1322 if (!blk->cur_blk_len) { in qup_i2c_write_tx_fifo_v2()
1323 if (!blk->tx_fifo_data_pos) in qup_i2c_write_tx_fifo_v2()
1326 if (blk->tx_fifo_free) in qup_i2c_write_tx_fifo_v2()
1329 blk->send_last_word = true; in qup_i2c_write_tx_fifo_v2()
1335 writel(blk->tx_fifo_data, qup->base + QUP_OUT_FIFO_BASE); in qup_i2c_write_tx_fifo_v2()
1347 struct qup_i2c_block *blk = &qup->blk; in qup_i2c_conf_xfer_v2() local
1363 blk->cur_data += 1; in qup_i2c_conf_xfer_v2()
1372 qup_i2c_clear_blk_v2(blk); in qup_i2c_conf_xfer_v2()
1394 if (!blk->is_tx_blk_mode) { in qup_i2c_conf_xfer_v2()
1395 blk->tx_fifo_free = qup->out_fifo_sz; in qup_i2c_conf_xfer_v2()
1433 struct qup_i2c_block *blk = &qup->blk; in qup_i2c_xfer_v2_msg() local
1439 for (i = 0; i < blk->count; i++) { in qup_i2c_xfer_v2_msg()
1441 blk->pos = i; in qup_i2c_xfer_v2_msg()
1442 blk->cur_tx_tags = blk->tags; in qup_i2c_xfer_v2_msg()
1443 blk->cur_blk_len = data_len; in qup_i2c_xfer_v2_msg()
1444 blk->tx_tag_len = in qup_i2c_xfer_v2_msg()
1445 qup_i2c_set_tags(blk->cur_tx_tags, qup, qup->msg); in qup_i2c_xfer_v2_msg()
1447 blk->cur_data = msg_buf; in qup_i2c_xfer_v2_msg()
1450 blk->total_tx_len = blk->tx_tag_len; in qup_i2c_xfer_v2_msg()
1451 blk->rx_tag_len = 2; in qup_i2c_xfer_v2_msg()
1452 blk->total_rx_len = blk->rx_tag_len + data_len; in qup_i2c_xfer_v2_msg()
1454 blk->total_tx_len = blk->tx_tag_len + data_len; in qup_i2c_xfer_v2_msg()
1455 blk->total_rx_len = 0; in qup_i2c_xfer_v2_msg()
1459 !qup->is_last || i < blk->count - 1); in qup_i2c_xfer_v2_msg()
1480 blk->data_len -= qup->blk_xfer_limit; in qup_i2c_xfer_v2_msg()
1529 qup->blk.is_tx_blk_mode = max_tx_len > qup->out_fifo_sz - in qup_i2c_determine_mode_v2()
1531 qup->blk.is_rx_blk_mode = max_rx_len > qup->in_fifo_sz - in qup_i2c_determine_mode_v2()