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()
273 tifm_sd_bounce_block(host, r_data); in tifm_sd_set_dma_data()
278 dma_len = sg_dma_len(&r_data->sg[host->sg_pos]) - host->block_pos; in tifm_sd_set_dma_data()
284 dma_len = sg_dma_len(&r_data->sg[host->sg_pos]); in tifm_sd_set_dma_data()
288 dma_blk_cnt = dma_len / r_data->blksz; in tifm_sd_set_dma_data()
290 host->block_pos += dma_blk_cnt * r_data->blksz; in tifm_sd_set_dma_data()
298 sg = &r_data->sg[host->sg_pos]; in tifm_sd_set_dma_data()
300 if (r_data->flags & MMC_DATA_WRITE) in tifm_sd_set_dma_data()
301 tifm_sd_bounce_block(host, r_data); in tifm_sd_set_dma_data()
313 if (r_data->flags & MMC_DATA_WRITE) in tifm_sd_set_dma_data()
474 struct mmc_data *r_data = NULL; in tifm_sd_data_event() local
483 r_data = host->req->cmd->data; in tifm_sd_data_event()
485 if (r_data && (fifo_status & TIFM_FIFO_READY)) { in tifm_sd_data_event()
486 if (tifm_sd_set_dma_data(host, r_data)) { in tifm_sd_data_event()
617 struct mmc_data *r_data = mrq->cmd->data; in tifm_sd_request() local
641 if (r_data) { in tifm_sd_request()
642 tifm_sd_set_data_timeout(host, r_data); in tifm_sd_request()
644 if ((r_data->flags & MMC_DATA_WRITE) && !mrq->stop) in tifm_sd_request()
657 host->sg_len = r_data->sg_len; in tifm_sd_request()
660 r_data->blksz); in tifm_sd_request()
663 r_data->flags & MMC_DATA_WRITE in tifm_sd_request()
671 host->sg_len = tifm_map_sg(sock, r_data->sg, in tifm_sd_request()
672 r_data->sg_len, in tifm_sd_request()
673 r_data->flags in tifm_sd_request()
681 r_data->flags & MMC_DATA_WRITE in tifm_sd_request()
690 writel(ilog2(r_data->blksz) - 2, in tifm_sd_request()
697 if (r_data->flags & MMC_DATA_WRITE) in tifm_sd_request()
704 tifm_sd_set_dma_data(host, r_data); in tifm_sd_request()
707 writel(r_data->blocks - 1, in tifm_sd_request()
709 writel(r_data->blksz - 1, in tifm_sd_request()
732 struct mmc_data *r_data = NULL; in tifm_sd_end_cmd() local
748 r_data = mrq->cmd->data; in tifm_sd_end_cmd()
749 if (r_data) { in tifm_sd_end_cmd()
756 (r_data->flags & MMC_DATA_WRITE) in tifm_sd_end_cmd()
758 tifm_unmap_sg(sock, r_data->sg, r_data->sg_len, in tifm_sd_end_cmd()
759 (r_data->flags & MMC_DATA_WRITE) in tifm_sd_end_cmd()
763 r_data->bytes_xfered = r_data->blocks in tifm_sd_end_cmd()
765 r_data->bytes_xfered *= r_data->blksz; in tifm_sd_end_cmd()
766 r_data->bytes_xfered += r_data->blksz in tifm_sd_end_cmd()