Lines Matching refs:cq_host

36 static inline u8 *get_desc(struct cqhci_host *cq_host, u8 tag)  in get_desc()  argument
38 return cq_host->desc_base + (tag * cq_host->slot_sz); in get_desc()
41 static inline u8 *get_link_desc(struct cqhci_host *cq_host, u8 tag) in get_link_desc() argument
43 u8 *desc = get_desc(cq_host, tag); in get_link_desc()
45 return desc + cq_host->task_desc_len; in get_link_desc()
48 static inline size_t get_trans_desc_offset(struct cqhci_host *cq_host, u8 tag) in get_trans_desc_offset() argument
50 return cq_host->trans_desc_len * cq_host->mmc->max_segs * tag; in get_trans_desc_offset()
53 static inline dma_addr_t get_trans_desc_dma(struct cqhci_host *cq_host, u8 tag) in get_trans_desc_dma() argument
55 size_t offset = get_trans_desc_offset(cq_host, tag); in get_trans_desc_dma()
57 return cq_host->trans_desc_dma_base + offset; in get_trans_desc_dma()
60 static inline u8 *get_trans_desc(struct cqhci_host *cq_host, u8 tag) in get_trans_desc() argument
62 size_t offset = get_trans_desc_offset(cq_host, tag); in get_trans_desc()
64 return cq_host->trans_desc_base + offset; in get_trans_desc()
67 static void setup_trans_desc(struct cqhci_host *cq_host, u8 tag) in setup_trans_desc() argument
72 link_temp = get_link_desc(cq_host, tag); in setup_trans_desc()
73 trans_temp = get_trans_desc_dma(cq_host, tag); in setup_trans_desc()
75 memset(link_temp, 0, cq_host->link_desc_len); in setup_trans_desc()
76 if (cq_host->link_desc_len > 8) in setup_trans_desc()
79 if (tag == DCMD_SLOT && (cq_host->mmc->caps2 & MMC_CAP2_CQE_DCMD)) { in setup_trans_desc()
86 if (cq_host->dma64) { in setup_trans_desc()
97 static void cqhci_set_irqs(struct cqhci_host *cq_host, u32 set) in cqhci_set_irqs() argument
99 cqhci_writel(cq_host, set, CQHCI_ISTE); in cqhci_set_irqs()
100 cqhci_writel(cq_host, set, CQHCI_ISGE); in cqhci_set_irqs()
108 static void cqhci_dumpregs(struct cqhci_host *cq_host) in cqhci_dumpregs() argument
110 struct mmc_host *mmc = cq_host->mmc; in cqhci_dumpregs()
115 cqhci_readl(cq_host, CQHCI_CAP), in cqhci_dumpregs()
116 cqhci_readl(cq_host, CQHCI_VER)); in cqhci_dumpregs()
118 cqhci_readl(cq_host, CQHCI_CFG), in cqhci_dumpregs()
119 cqhci_readl(cq_host, CQHCI_CTL)); in cqhci_dumpregs()
121 cqhci_readl(cq_host, CQHCI_IS), in cqhci_dumpregs()
122 cqhci_readl(cq_host, CQHCI_ISTE)); in cqhci_dumpregs()
124 cqhci_readl(cq_host, CQHCI_ISGE), in cqhci_dumpregs()
125 cqhci_readl(cq_host, CQHCI_IC)); in cqhci_dumpregs()
127 cqhci_readl(cq_host, CQHCI_TDLBA), in cqhci_dumpregs()
128 cqhci_readl(cq_host, CQHCI_TDLBAU)); in cqhci_dumpregs()
130 cqhci_readl(cq_host, CQHCI_TDBR), in cqhci_dumpregs()
131 cqhci_readl(cq_host, CQHCI_TCN)); in cqhci_dumpregs()
133 cqhci_readl(cq_host, CQHCI_DQS), in cqhci_dumpregs()
134 cqhci_readl(cq_host, CQHCI_DPT)); in cqhci_dumpregs()
136 cqhci_readl(cq_host, CQHCI_TCLR), in cqhci_dumpregs()
137 cqhci_readl(cq_host, CQHCI_SSC1)); in cqhci_dumpregs()
139 cqhci_readl(cq_host, CQHCI_SSC2), in cqhci_dumpregs()
140 cqhci_readl(cq_host, CQHCI_CRDCT)); in cqhci_dumpregs()
142 cqhci_readl(cq_host, CQHCI_RMEM), in cqhci_dumpregs()
143 cqhci_readl(cq_host, CQHCI_TERRI)); in cqhci_dumpregs()
145 cqhci_readl(cq_host, CQHCI_CRI), in cqhci_dumpregs()
146 cqhci_readl(cq_host, CQHCI_CRA)); in cqhci_dumpregs()
148 if (cq_host->ops->dumpregs) in cqhci_dumpregs()
149 cq_host->ops->dumpregs(mmc); in cqhci_dumpregs()
169 static int cqhci_host_alloc_tdl(struct cqhci_host *cq_host) in cqhci_host_alloc_tdl() argument
174 if (cq_host->caps & CQHCI_TASK_DESC_SZ_128) { in cqhci_host_alloc_tdl()
175 cqhci_writel(cq_host, cqhci_readl(cq_host, CQHCI_CFG) | in cqhci_host_alloc_tdl()
177 cq_host->task_desc_len = 16; in cqhci_host_alloc_tdl()
179 cq_host->task_desc_len = 8; in cqhci_host_alloc_tdl()
187 if (cq_host->dma64) { in cqhci_host_alloc_tdl()
188 if (cq_host->quirks & CQHCI_QUIRK_SHORT_TXFR_DESC_SZ) in cqhci_host_alloc_tdl()
189 cq_host->trans_desc_len = 12; in cqhci_host_alloc_tdl()
191 cq_host->trans_desc_len = 16; in cqhci_host_alloc_tdl()
192 cq_host->link_desc_len = 16; in cqhci_host_alloc_tdl()
194 cq_host->trans_desc_len = 8; in cqhci_host_alloc_tdl()
195 cq_host->link_desc_len = 8; in cqhci_host_alloc_tdl()
199 cq_host->slot_sz = cq_host->task_desc_len + cq_host->link_desc_len; in cqhci_host_alloc_tdl()
201 cq_host->desc_size = cq_host->slot_sz * cq_host->num_slots; in cqhci_host_alloc_tdl()
203 cq_host->data_size = get_trans_desc_offset(cq_host, cq_host->mmc->cqe_qdepth); in cqhci_host_alloc_tdl()
206 mmc_hostname(cq_host->mmc), cq_host->desc_size, cq_host->data_size, in cqhci_host_alloc_tdl()
207 cq_host->slot_sz); in cqhci_host_alloc_tdl()
215 cq_host->desc_base = dmam_alloc_coherent(mmc_dev(cq_host->mmc), in cqhci_host_alloc_tdl()
216 cq_host->desc_size, in cqhci_host_alloc_tdl()
217 &cq_host->desc_dma_base, in cqhci_host_alloc_tdl()
219 if (!cq_host->desc_base) in cqhci_host_alloc_tdl()
222 cq_host->trans_desc_base = dmam_alloc_coherent(mmc_dev(cq_host->mmc), in cqhci_host_alloc_tdl()
223 cq_host->data_size, in cqhci_host_alloc_tdl()
224 &cq_host->trans_desc_dma_base, in cqhci_host_alloc_tdl()
226 if (!cq_host->trans_desc_base) { in cqhci_host_alloc_tdl()
227 dmam_free_coherent(mmc_dev(cq_host->mmc), cq_host->desc_size, in cqhci_host_alloc_tdl()
228 cq_host->desc_base, in cqhci_host_alloc_tdl()
229 cq_host->desc_dma_base); in cqhci_host_alloc_tdl()
230 cq_host->desc_base = NULL; in cqhci_host_alloc_tdl()
231 cq_host->desc_dma_base = 0; in cqhci_host_alloc_tdl()
236 mmc_hostname(cq_host->mmc), cq_host->desc_base, cq_host->trans_desc_base, in cqhci_host_alloc_tdl()
237 (unsigned long long)cq_host->desc_dma_base, in cqhci_host_alloc_tdl()
238 (unsigned long long)cq_host->trans_desc_dma_base); in cqhci_host_alloc_tdl()
240 for (; i < (cq_host->num_slots); i++) in cqhci_host_alloc_tdl()
241 setup_trans_desc(cq_host, i); in cqhci_host_alloc_tdl()
246 static void __cqhci_enable(struct cqhci_host *cq_host) in __cqhci_enable() argument
248 struct mmc_host *mmc = cq_host->mmc; in __cqhci_enable()
251 cqcfg = cqhci_readl(cq_host, CQHCI_CFG); in __cqhci_enable()
256 cqhci_writel(cq_host, cqcfg, CQHCI_CFG); in __cqhci_enable()
264 if (cq_host->caps & CQHCI_TASK_DESC_SZ_128) in __cqhci_enable()
270 cqhci_writel(cq_host, cqcfg, CQHCI_CFG); in __cqhci_enable()
272 cqhci_writel(cq_host, lower_32_bits(cq_host->desc_dma_base), in __cqhci_enable()
274 cqhci_writel(cq_host, upper_32_bits(cq_host->desc_dma_base), in __cqhci_enable()
277 cqhci_writel(cq_host, cq_host->rca, CQHCI_SSC2); in __cqhci_enable()
279 cqhci_set_irqs(cq_host, 0); in __cqhci_enable()
283 cqhci_writel(cq_host, cqcfg, CQHCI_CFG); in __cqhci_enable()
285 if (cqhci_readl(cq_host, CQHCI_CTL) & CQHCI_HALT) in __cqhci_enable()
286 cqhci_writel(cq_host, 0, CQHCI_CTL); in __cqhci_enable()
290 if (cq_host->ops->enable) in __cqhci_enable()
291 cq_host->ops->enable(mmc); in __cqhci_enable()
296 cqhci_set_irqs(cq_host, CQHCI_IS_MASK); in __cqhci_enable()
298 cq_host->activated = true; in __cqhci_enable()
301 static void __cqhci_disable(struct cqhci_host *cq_host) in __cqhci_disable() argument
305 cqcfg = cqhci_readl(cq_host, CQHCI_CFG); in __cqhci_disable()
307 cqhci_writel(cq_host, cqcfg, CQHCI_CFG); in __cqhci_disable()
309 cq_host->mmc->cqe_on = false; in __cqhci_disable()
311 cq_host->activated = false; in __cqhci_disable()
316 struct cqhci_host *cq_host = mmc->cqe_private; in cqhci_deactivate() local
318 if (cq_host->enabled && cq_host->activated) in cqhci_deactivate()
319 __cqhci_disable(cq_host); in cqhci_deactivate()
334 struct cqhci_host *cq_host = mmc->cqe_private; in cqhci_enable() local
340 if (cq_host->enabled) in cqhci_enable()
343 cq_host->rca = card->rca; in cqhci_enable()
345 err = cqhci_host_alloc_tdl(cq_host); in cqhci_enable()
352 __cqhci_enable(cq_host); in cqhci_enable()
354 cq_host->enabled = true; in cqhci_enable()
357 cqhci_dumpregs(cq_host); in cqhci_enable()
365 static u32 cqhci_read_ctl(struct cqhci_host *cq_host) in cqhci_read_ctl() argument
367 return cqhci_readl(cq_host, CQHCI_CTL); in cqhci_read_ctl()
372 struct cqhci_host *cq_host = mmc->cqe_private; in cqhci_off() local
376 if (!cq_host->enabled || !mmc->cqe_on || cq_host->recovery_halt) in cqhci_off()
379 if (cq_host->ops->disable) in cqhci_off()
380 cq_host->ops->disable(mmc, false); in cqhci_off()
382 cqhci_writel(cq_host, CQHCI_HALT, CQHCI_CTL); in cqhci_off()
384 err = readx_poll_timeout(cqhci_read_ctl, cq_host, reg, in cqhci_off()
391 if (cq_host->ops->post_disable) in cqhci_off()
392 cq_host->ops->post_disable(mmc); in cqhci_off()
399 struct cqhci_host *cq_host = mmc->cqe_private; in cqhci_disable() local
401 if (!cq_host->enabled) in cqhci_disable()
406 __cqhci_disable(cq_host); in cqhci_disable()
408 dmam_free_coherent(mmc_dev(mmc), cq_host->data_size, in cqhci_disable()
409 cq_host->trans_desc_base, in cqhci_disable()
410 cq_host->trans_desc_dma_base); in cqhci_disable()
412 dmam_free_coherent(mmc_dev(mmc), cq_host->desc_size, in cqhci_disable()
413 cq_host->desc_base, in cqhci_disable()
414 cq_host->desc_dma_base); in cqhci_disable()
416 cq_host->trans_desc_base = NULL; in cqhci_disable()
417 cq_host->desc_base = NULL; in cqhci_disable()
419 cq_host->enabled = false; in cqhci_disable()
423 struct cqhci_host *cq_host, int tag) in cqhci_prep_task_desc() argument
425 __le64 *task_desc = (__le64 __force *)get_desc(cq_host, tag); in cqhci_prep_task_desc()
444 if (cq_host->caps & CQHCI_TASK_DESC_SZ_128) { in cqhci_prep_task_desc()
500 struct cqhci_host *cq_host, int tag) in cqhci_prep_tran_desc() argument
505 bool dma64 = cq_host->dma64; in cqhci_prep_tran_desc()
517 desc = get_trans_desc(cq_host, tag); in cqhci_prep_tran_desc()
526 desc += cq_host->trans_desc_len; in cqhci_prep_tran_desc()
540 struct cqhci_host *cq_host = mmc->cqe_private; in cqhci_prep_dcmd_desc() local
556 task_desc = (__le64 __force *)get_desc(cq_host, cq_host->dcmd_slot); in cqhci_prep_dcmd_desc()
557 memset(task_desc, 0, cq_host->task_desc_len); in cqhci_prep_dcmd_desc()
565 if (cq_host->ops->update_dcmd_desc) in cqhci_prep_dcmd_desc()
566 cq_host->ops->update_dcmd_desc(mmc, mrq, &data); in cqhci_prep_dcmd_desc()
596 struct cqhci_host *cq_host = mmc->cqe_private; in cqhci_request() local
599 if (!cq_host->enabled) { in cqhci_request()
605 if (!cq_host->activated) in cqhci_request()
606 __cqhci_enable(cq_host); in cqhci_request()
609 if (cq_host->ops->pre_enable) in cqhci_request()
610 cq_host->ops->pre_enable(mmc); in cqhci_request()
612 cqhci_writel(cq_host, 0, CQHCI_CTL); in cqhci_request()
615 if (cqhci_readl(cq_host, CQHCI_CTL) && CQHCI_HALT) { in cqhci_request()
619 if (cq_host->ops->enable) in cqhci_request()
620 cq_host->ops->enable(mmc); in cqhci_request()
624 cqhci_prep_task_desc(mrq, cq_host, tag); in cqhci_request()
626 err = cqhci_prep_tran_desc(mrq, cq_host, tag); in cqhci_request()
636 spin_lock_irqsave(&cq_host->lock, flags); in cqhci_request()
638 if (cq_host->recovery_halt) { in cqhci_request()
643 cq_host->slot[tag].mrq = mrq; in cqhci_request()
644 cq_host->slot[tag].flags = 0; in cqhci_request()
646 cq_host->qcnt += 1; in cqhci_request()
649 cqhci_writel(cq_host, 1 << tag, CQHCI_TDBR); in cqhci_request()
650 if (!(cqhci_readl(cq_host, CQHCI_TDBR) & (1 << tag))) in cqhci_request()
654 spin_unlock_irqrestore(&cq_host->lock, flags); in cqhci_request()
665 struct cqhci_host *cq_host = mmc->cqe_private; in cqhci_recovery_needed() local
667 if (!cq_host->recovery_halt) { in cqhci_recovery_needed()
668 cq_host->recovery_halt = true; in cqhci_recovery_needed()
670 wake_up(&cq_host->wait_queue); in cqhci_recovery_needed()
693 struct cqhci_host *cq_host = mmc->cqe_private; in cqhci_error_irq() local
699 spin_lock(&cq_host->lock); in cqhci_error_irq()
701 terri = cqhci_readl(cq_host, CQHCI_TERRI); in cqhci_error_irq()
707 if (cq_host->recovery_halt) in cqhci_error_irq()
710 if (!cq_host->qcnt) { in cqhci_error_irq()
719 slot = &cq_host->slot[tag]; in cqhci_error_irq()
728 slot = &cq_host->slot[tag]; in cqhci_error_irq()
744 tdpe = cqhci_readl(cq_host, CQHCI_TDPE); in cqhci_error_irq()
751 slot = &cq_host->slot[tag]; in cqhci_error_irq()
759 if (!cq_host->recovery_halt) { in cqhci_error_irq()
765 slot = &cq_host->slot[tag]; in cqhci_error_irq()
775 spin_unlock(&cq_host->lock); in cqhci_error_irq()
780 struct cqhci_host *cq_host = mmc->cqe_private; in cqhci_finish_mrq() local
781 struct cqhci_slot *slot = &cq_host->slot[tag]; in cqhci_finish_mrq()
792 if (cq_host->recovery_halt) { in cqhci_finish_mrq()
799 cq_host->qcnt -= 1; in cqhci_finish_mrq()
817 struct cqhci_host *cq_host = mmc->cqe_private; in cqhci_irq() local
819 status = cqhci_readl(cq_host, CQHCI_IS); in cqhci_irq()
820 cqhci_writel(cq_host, status, CQHCI_IS); in cqhci_irq()
837 comp_status = cqhci_readl(cq_host, CQHCI_TCN); in cqhci_irq()
838 cqhci_writel(cq_host, comp_status, CQHCI_TCN); in cqhci_irq()
842 spin_lock(&cq_host->lock); in cqhci_irq()
844 for_each_set_bit(tag, &comp_status, cq_host->num_slots) { in cqhci_irq()
851 if (cq_host->waiting_for_idle && !cq_host->qcnt) { in cqhci_irq()
852 cq_host->waiting_for_idle = false; in cqhci_irq()
853 wake_up(&cq_host->wait_queue); in cqhci_irq()
856 spin_unlock(&cq_host->lock); in cqhci_irq()
860 wake_up(&cq_host->wait_queue); in cqhci_irq()
863 wake_up(&cq_host->wait_queue); in cqhci_irq()
869 static bool cqhci_is_idle(struct cqhci_host *cq_host, int *ret) in cqhci_is_idle() argument
874 spin_lock_irqsave(&cq_host->lock, flags); in cqhci_is_idle()
875 is_idle = !cq_host->qcnt || cq_host->recovery_halt; in cqhci_is_idle()
876 *ret = cq_host->recovery_halt ? -EBUSY : 0; in cqhci_is_idle()
877 cq_host->waiting_for_idle = !is_idle; in cqhci_is_idle()
878 spin_unlock_irqrestore(&cq_host->lock, flags); in cqhci_is_idle()
885 struct cqhci_host *cq_host = mmc->cqe_private; in cqhci_wait_for_idle() local
888 wait_event(cq_host->wait_queue, cqhci_is_idle(cq_host, &ret)); in cqhci_wait_for_idle()
896 struct cqhci_host *cq_host = mmc->cqe_private; in cqhci_timeout() local
898 struct cqhci_slot *slot = &cq_host->slot[tag]; in cqhci_timeout()
902 spin_lock_irqsave(&cq_host->lock, flags); in cqhci_timeout()
907 *recovery_needed = cq_host->recovery_halt; in cqhci_timeout()
909 spin_unlock_irqrestore(&cq_host->lock, flags); in cqhci_timeout()
913 mmc_hostname(mmc), tag, cq_host->qcnt); in cqhci_timeout()
914 cqhci_dumpregs(cq_host); in cqhci_timeout()
920 static bool cqhci_tasks_cleared(struct cqhci_host *cq_host) in cqhci_tasks_cleared() argument
922 return !(cqhci_readl(cq_host, CQHCI_CTL) & CQHCI_CLEAR_ALL_TASKS); in cqhci_tasks_cleared()
927 struct cqhci_host *cq_host = mmc->cqe_private; in cqhci_clear_all_tasks() local
931 cqhci_set_irqs(cq_host, CQHCI_IS_TCL); in cqhci_clear_all_tasks()
933 ctl = cqhci_readl(cq_host, CQHCI_CTL); in cqhci_clear_all_tasks()
935 cqhci_writel(cq_host, ctl, CQHCI_CTL); in cqhci_clear_all_tasks()
937 wait_event_timeout(cq_host->wait_queue, cqhci_tasks_cleared(cq_host), in cqhci_clear_all_tasks()
940 cqhci_set_irqs(cq_host, 0); in cqhci_clear_all_tasks()
942 ret = cqhci_tasks_cleared(cq_host); in cqhci_clear_all_tasks()
951 static bool cqhci_halted(struct cqhci_host *cq_host) in cqhci_halted() argument
953 return cqhci_readl(cq_host, CQHCI_CTL) & CQHCI_HALT; in cqhci_halted()
958 struct cqhci_host *cq_host = mmc->cqe_private; in cqhci_halt() local
962 if (cqhci_halted(cq_host)) in cqhci_halt()
965 cqhci_set_irqs(cq_host, CQHCI_IS_HAC); in cqhci_halt()
967 ctl = cqhci_readl(cq_host, CQHCI_CTL); in cqhci_halt()
969 cqhci_writel(cq_host, ctl, CQHCI_CTL); in cqhci_halt()
971 wait_event_timeout(cq_host->wait_queue, cqhci_halted(cq_host), in cqhci_halt()
974 cqhci_set_irqs(cq_host, 0); in cqhci_halt()
976 ret = cqhci_halted(cq_host); in cqhci_halt()
994 struct cqhci_host *cq_host = mmc->cqe_private; in cqhci_recovery_start() local
998 WARN_ON(!cq_host->recovery_halt); in cqhci_recovery_start()
1002 if (cq_host->ops->disable) in cqhci_recovery_start()
1003 cq_host->ops->disable(mmc, true); in cqhci_recovery_start()
1023 static void cqhci_recover_mrq(struct cqhci_host *cq_host, unsigned int tag) in cqhci_recover_mrq() argument
1025 struct cqhci_slot *slot = &cq_host->slot[tag]; in cqhci_recover_mrq()
1034 cq_host->qcnt -= 1; in cqhci_recover_mrq()
1044 mmc_cqe_request_done(cq_host->mmc, mrq); in cqhci_recover_mrq()
1047 static void cqhci_recover_mrqs(struct cqhci_host *cq_host) in cqhci_recover_mrqs() argument
1051 for (i = 0; i < cq_host->num_slots; i++) in cqhci_recover_mrqs()
1052 cqhci_recover_mrq(cq_host, i); in cqhci_recover_mrqs()
1067 struct cqhci_host *cq_host = mmc->cqe_private; in cqhci_recovery_finish() local
1074 WARN_ON(!cq_host->recovery_halt); in cqhci_recovery_finish()
1089 cqcfg = cqhci_readl(cq_host, CQHCI_CFG); in cqhci_recovery_finish()
1091 cqhci_writel(cq_host, cqcfg, CQHCI_CFG); in cqhci_recovery_finish()
1093 cqhci_writel(cq_host, cqcfg, CQHCI_CFG); in cqhci_recovery_finish()
1101 cqhci_recover_mrqs(cq_host); in cqhci_recovery_finish()
1103 WARN_ON(cq_host->qcnt); in cqhci_recovery_finish()
1105 spin_lock_irqsave(&cq_host->lock, flags); in cqhci_recovery_finish()
1106 cq_host->qcnt = 0; in cqhci_recovery_finish()
1107 cq_host->recovery_halt = false; in cqhci_recovery_finish()
1109 spin_unlock_irqrestore(&cq_host->lock, flags); in cqhci_recovery_finish()
1114 cqhci_writel(cq_host, CQHCI_IS_HAC | CQHCI_IS_TCL, CQHCI_IS); in cqhci_recovery_finish()
1116 cqhci_set_irqs(cq_host, CQHCI_IS_MASK); in cqhci_recovery_finish()
1135 struct cqhci_host *cq_host; in cqhci_pltfm_init() local
1146 cq_host = devm_kzalloc(&pdev->dev, sizeof(*cq_host), GFP_KERNEL); in cqhci_pltfm_init()
1147 if (!cq_host) in cqhci_pltfm_init()
1149 cq_host->mmio = devm_ioremap(&pdev->dev, in cqhci_pltfm_init()
1152 if (!cq_host->mmio) { in cqhci_pltfm_init()
1158 return cq_host; in cqhci_pltfm_init()
1162 static unsigned int cqhci_ver_major(struct cqhci_host *cq_host) in cqhci_ver_major() argument
1164 return CQHCI_VER_MAJOR(cqhci_readl(cq_host, CQHCI_VER)); in cqhci_ver_major()
1167 static unsigned int cqhci_ver_minor(struct cqhci_host *cq_host) in cqhci_ver_minor() argument
1169 u32 ver = cqhci_readl(cq_host, CQHCI_VER); in cqhci_ver_minor()
1174 int cqhci_init(struct cqhci_host *cq_host, struct mmc_host *mmc, in cqhci_init() argument
1179 cq_host->dma64 = dma64; in cqhci_init()
1180 cq_host->mmc = mmc; in cqhci_init()
1181 cq_host->mmc->cqe_private = cq_host; in cqhci_init()
1183 cq_host->num_slots = NUM_SLOTS; in cqhci_init()
1184 cq_host->dcmd_slot = DCMD_SLOT; in cqhci_init()
1192 cq_host->slot = devm_kcalloc(mmc_dev(mmc), cq_host->num_slots, in cqhci_init()
1193 sizeof(*cq_host->slot), GFP_KERNEL); in cqhci_init()
1194 if (!cq_host->slot) { in cqhci_init()
1199 err = cqhci_crypto_init(cq_host); in cqhci_init()
1206 spin_lock_init(&cq_host->lock); in cqhci_init()
1208 init_completion(&cq_host->halt_comp); in cqhci_init()
1209 init_waitqueue_head(&cq_host->wait_queue); in cqhci_init()
1212 mmc_hostname(mmc), cqhci_ver_major(cq_host), in cqhci_init()
1213 cqhci_ver_minor(cq_host)); in cqhci_init()
1219 mmc_hostname(mmc), cqhci_ver_major(cq_host), in cqhci_init()
1220 cqhci_ver_minor(cq_host), err); in cqhci_init()