Lines Matching refs:r_data
167 struct mmc_data *r_data = host->req->cmd->data; in tifm_sd_transfer_data() local
168 struct scatterlist *sg = r_data->sg; in tifm_sd_transfer_data()
181 if ((r_data->flags & MMC_DATA_WRITE) in tifm_sd_transfer_data()
199 if (r_data->flags & MMC_DATA_READ) in tifm_sd_transfer_data()
201 else if (r_data->flags & MMC_DATA_WRITE) in tifm_sd_transfer_data()
222 static void tifm_sd_bounce_block(struct tifm_sd *host, struct mmc_data *r_data) in tifm_sd_bounce_block() argument
224 struct scatterlist *sg = r_data->sg; in tifm_sd_bounce_block()
225 unsigned int t_size = r_data->blksz; in tifm_sd_bounce_block()
248 if (r_data->flags & MMC_DATA_WRITE) in tifm_sd_bounce_block()
250 r_data->blksz - t_size, in tifm_sd_bounce_block()
252 else if (r_data->flags & MMC_DATA_READ) in tifm_sd_bounce_block()
254 r_data->blksz - t_size, p_cnt); in tifm_sd_bounce_block()
261 static int tifm_sd_set_dma_data(struct tifm_sd *host, struct mmc_data *r_data) in tifm_sd_set_dma_data() argument
264 unsigned int t_size = TIFM_DMA_TSIZE * r_data->blksz; in tifm_sd_set_dma_data()
275 tifm_sd_bounce_block(host, r_data); in tifm_sd_set_dma_data()
281 dma_len = sg_dma_len(&r_data->sg[host->sg_pos]) - host->block_pos; in tifm_sd_set_dma_data()
287 dma_len = sg_dma_len(&r_data->sg[host->sg_pos]); in tifm_sd_set_dma_data()
291 dma_blk_cnt = dma_len / r_data->blksz; in tifm_sd_set_dma_data()
293 host->block_pos += dma_blk_cnt * r_data->blksz; in tifm_sd_set_dma_data()
301 sg = &r_data->sg[host->sg_pos]; in tifm_sd_set_dma_data()
303 if (r_data->flags & MMC_DATA_WRITE) { in tifm_sd_set_dma_data()
305 tifm_sd_bounce_block(host, r_data); in tifm_sd_set_dma_data()
318 if (r_data->flags & MMC_DATA_WRITE) in tifm_sd_set_dma_data()
479 struct mmc_data *r_data = NULL; in tifm_sd_data_event() local
488 r_data = host->req->cmd->data; in tifm_sd_data_event()
490 if (r_data && (fifo_status & TIFM_FIFO_READY)) { in tifm_sd_data_event()
491 if (tifm_sd_set_dma_data(host, r_data)) { in tifm_sd_data_event()
625 struct mmc_data *r_data = mrq->cmd->data; in tifm_sd_request() local
649 if (r_data) { in tifm_sd_request()
650 tifm_sd_set_data_timeout(host, r_data); in tifm_sd_request()
652 if ((r_data->flags & MMC_DATA_WRITE) && !mrq->stop) in tifm_sd_request()
665 host->sg_len = r_data->sg_len; in tifm_sd_request()
668 r_data->blksz); in tifm_sd_request()
671 r_data->flags & MMC_DATA_WRITE in tifm_sd_request()
679 host->sg_len = tifm_map_sg(sock, r_data->sg, in tifm_sd_request()
680 r_data->sg_len, in tifm_sd_request()
681 r_data->flags in tifm_sd_request()
689 r_data->flags & MMC_DATA_WRITE in tifm_sd_request()
698 writel(ilog2(r_data->blksz) - 2, in tifm_sd_request()
705 if (r_data->flags & MMC_DATA_WRITE) in tifm_sd_request()
712 tifm_sd_set_dma_data(host, r_data); in tifm_sd_request()
715 writel(r_data->blocks - 1, in tifm_sd_request()
717 writel(r_data->blksz - 1, in tifm_sd_request()
740 struct mmc_data *r_data = NULL; in tifm_sd_end_cmd() local
756 r_data = mrq->cmd->data; in tifm_sd_end_cmd()
757 if (r_data) { in tifm_sd_end_cmd()
764 (r_data->flags & MMC_DATA_WRITE) in tifm_sd_end_cmd()
766 tifm_unmap_sg(sock, r_data->sg, r_data->sg_len, in tifm_sd_end_cmd()
767 (r_data->flags & MMC_DATA_WRITE) in tifm_sd_end_cmd()
771 r_data->bytes_xfered = r_data->blocks in tifm_sd_end_cmd()
773 r_data->bytes_xfered *= r_data->blksz; in tifm_sd_end_cmd()
774 r_data->bytes_xfered += r_data->blksz in tifm_sd_end_cmd()