Lines Matching refs:pcr

20 	struct rtsx_pcr		*pcr;  member
40 rtsx_pci_write_register(host->pcr, CARD_STOP, in ms_clear_error()
48 struct rtsx_pcr *pcr = host->pcr; in ms_print_debug_regs() local
53 rtsx_pci_init_cmd(pcr); in ms_print_debug_regs()
55 rtsx_pci_add_cmd(pcr, READ_REG_CMD, i, 0, 0); in ms_print_debug_regs()
57 rtsx_pci_add_cmd(pcr, READ_REG_CMD, i, 0, 0); in ms_print_debug_regs()
58 rtsx_pci_send_cmd(pcr, 100); in ms_print_debug_regs()
60 ptr = rtsx_pci_get_cmd_data(pcr); in ms_print_debug_regs()
75 struct rtsx_pcr *pcr = host->pcr; in ms_power_on() local
78 rtsx_pci_init_cmd(pcr); in ms_power_on()
79 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, CARD_SELECT, 0x07, MS_MOD_SEL); in ms_power_on()
80 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, CARD_SHARE_MODE, in ms_power_on()
82 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, CARD_CLK_EN, in ms_power_on()
84 err = rtsx_pci_send_cmd(pcr, 100); in ms_power_on()
88 err = rtsx_pci_card_pull_ctl_enable(pcr, RTSX_MS_CARD); in ms_power_on()
92 err = rtsx_pci_card_power_on(pcr, RTSX_MS_CARD); in ms_power_on()
99 err = rtsx_pci_write_register(pcr, CARD_OE, in ms_power_on()
109 struct rtsx_pcr *pcr = host->pcr; in ms_power_off() local
112 rtsx_pci_init_cmd(pcr); in ms_power_off()
114 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, CARD_CLK_EN, MS_CLK_EN, 0); in ms_power_off()
115 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, CARD_OE, MS_OUTPUT_EN, 0); in ms_power_off()
117 err = rtsx_pci_send_cmd(pcr, 100); in ms_power_off()
121 err = rtsx_pci_card_power_off(pcr, RTSX_MS_CARD); in ms_power_off()
125 return rtsx_pci_card_pull_ctl_disable(pcr, RTSX_MS_CARD); in ms_power_off()
131 struct rtsx_pcr *pcr = host->pcr; in ms_transfer_data() local
151 rtsx_pci_init_cmd(pcr); in ms_transfer_data()
153 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, MS_TPC, 0xFF, tpc); in ms_transfer_data()
155 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, MS_SECTOR_CNT_H, in ms_transfer_data()
157 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, MS_SECTOR_CNT_L, in ms_transfer_data()
160 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, MS_TRANS_CFG, 0xFF, cfg); in ms_transfer_data()
162 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, IRQSTAT0, in ms_transfer_data()
164 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, DMATC3, 0xFF, (u8)(length >> 24)); in ms_transfer_data()
165 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, DMATC2, 0xFF, (u8)(length >> 16)); in ms_transfer_data()
166 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, DMATC1, 0xFF, (u8)(length >> 8)); in ms_transfer_data()
167 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, DMATC0, 0xFF, (u8)length); in ms_transfer_data()
168 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, DMACTL, in ms_transfer_data()
170 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, CARD_DATA_SOURCE, in ms_transfer_data()
173 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, MS_TRANSFER, in ms_transfer_data()
175 rtsx_pci_add_cmd(pcr, CHECK_REG_CMD, MS_TRANSFER, in ms_transfer_data()
178 rtsx_pci_send_cmd_no_wait(pcr); in ms_transfer_data()
180 err = rtsx_pci_transfer_data(pcr, sg, 1, data_dir == READ, 10000); in ms_transfer_data()
186 rtsx_pci_read_register(pcr, MS_TRANS_CFG, &val); in ms_transfer_data()
202 struct rtsx_pcr *pcr = host->pcr; in ms_write_bytes() local
210 rtsx_pci_init_cmd(pcr); in ms_write_bytes()
213 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, in ms_write_bytes()
216 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, in ms_write_bytes()
219 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, MS_TPC, 0xFF, tpc); in ms_write_bytes()
220 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, MS_BYTE_CNT, 0xFF, cnt); in ms_write_bytes()
221 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, MS_TRANS_CFG, 0xFF, cfg); in ms_write_bytes()
222 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, CARD_DATA_SOURCE, in ms_write_bytes()
225 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, MS_TRANSFER, in ms_write_bytes()
227 rtsx_pci_add_cmd(pcr, CHECK_REG_CMD, MS_TRANSFER, in ms_write_bytes()
230 rtsx_pci_add_cmd(pcr, READ_REG_CMD, MS_TRANS_CFG, 0, 0); in ms_write_bytes()
232 err = rtsx_pci_send_cmd(pcr, 5000); in ms_write_bytes()
236 rtsx_pci_read_register(pcr, MS_TRANS_CFG, &val); in ms_write_bytes()
260 u8 *ptr = rtsx_pci_get_cmd_data(pcr) + 1; in ms_write_bytes()
270 struct rtsx_pcr *pcr = host->pcr; in ms_read_bytes() local
279 rtsx_pci_init_cmd(pcr); in ms_read_bytes()
281 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, MS_TPC, 0xFF, tpc); in ms_read_bytes()
282 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, MS_BYTE_CNT, 0xFF, cnt); in ms_read_bytes()
283 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, MS_TRANS_CFG, 0xFF, cfg); in ms_read_bytes()
284 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, CARD_DATA_SOURCE, in ms_read_bytes()
287 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, MS_TRANSFER, in ms_read_bytes()
289 rtsx_pci_add_cmd(pcr, CHECK_REG_CMD, MS_TRANSFER, in ms_read_bytes()
292 rtsx_pci_add_cmd(pcr, READ_REG_CMD, PPBUF_BASE2 + i, 0, 0); in ms_read_bytes()
294 rtsx_pci_add_cmd(pcr, READ_REG_CMD, PPBUF_BASE2 + cnt, 0, 0); in ms_read_bytes()
296 rtsx_pci_add_cmd(pcr, READ_REG_CMD, in ms_read_bytes()
299 rtsx_pci_add_cmd(pcr, READ_REG_CMD, MS_TRANS_CFG, 0, 0); in ms_read_bytes()
301 err = rtsx_pci_send_cmd(pcr, 5000); in ms_read_bytes()
305 rtsx_pci_read_register(pcr, MS_TRANS_CFG, &val); in ms_read_bytes()
328 ptr = rtsx_pci_get_cmd_data(pcr) + 1; in ms_read_bytes()
393 struct rtsx_pcr *pcr = host->pcr; in rtsx_pci_ms_handle_req() local
397 mutex_lock(&pcr->pcr_mutex); in rtsx_pci_ms_handle_req()
399 rtsx_pci_start_run(pcr); in rtsx_pci_ms_handle_req()
401 rtsx_pci_switch_clock(host->pcr, host->clock, host->ssc_depth, in rtsx_pci_ms_handle_req()
403 rtsx_pci_write_register(pcr, CARD_SELECT, 0x07, MS_MOD_SEL); in rtsx_pci_ms_handle_req()
404 rtsx_pci_write_register(pcr, CARD_SHARE_MODE, in rtsx_pci_ms_handle_req()
417 mutex_unlock(&pcr->pcr_mutex); in rtsx_pci_ms_handle_req()
426 if (rtsx_pci_card_exclusive_check(host->pcr, RTSX_MS_CARD)) in rtsx_pci_ms_request()
436 struct rtsx_pcr *pcr = host->pcr; in rtsx_pci_ms_set_param() local
444 err = rtsx_pci_card_exclusive_check(host->pcr, RTSX_MS_CARD); in rtsx_pci_ms_set_param()
463 err = rtsx_pci_write_register(pcr, MS_CFG, 0x58, in rtsx_pci_ms_set_param()
471 err = rtsx_pci_write_register(pcr, MS_CFG, in rtsx_pci_ms_set_param()
479 err = rtsx_pci_switch_clock(pcr, clock, in rtsx_pci_ms_set_param()
535 struct rtsx_pcr *pcr; in rtsx_pci_ms_drv_probe() local
542 pcr = handle->pcr; in rtsx_pci_ms_drv_probe()
543 if (!pcr) in rtsx_pci_ms_drv_probe()
554 host->pcr = pcr; in rtsx_pci_ms_drv_probe()
558 pcr->slots[RTSX_MS_CARD].p_dev = pdev; in rtsx_pci_ms_drv_probe()
559 pcr->slots[RTSX_MS_CARD].card_event = rtsx_pci_ms_card_event; in rtsx_pci_ms_drv_probe()
580 struct rtsx_pcr *pcr; in rtsx_pci_ms_drv_remove() local
587 pcr = host->pcr; in rtsx_pci_ms_drv_remove()
588 pcr->slots[RTSX_MS_CARD].p_dev = NULL; in rtsx_pci_ms_drv_remove()
589 pcr->slots[RTSX_MS_CARD].card_event = NULL; in rtsx_pci_ms_drv_remove()
600 rtsx_pci_complete_unfinished_transfer(pcr); in rtsx_pci_ms_drv_remove()