Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: cqhci: Add cqhci set_tran_desc() callback

There are could be specific limitations for some mmc
controllers for setting cqhci transfer descriptors.
So add callback to allow implement driver specific function.

Signed-off-by: Sergey Khimich <serghox@gmail.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/20240319115932.4108904-2-serghox@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Sergey Khimich and committed by
Ulf Hansson
52bf134f f4a5dddd

+12 -3
+8 -3
drivers/mmc/host/cqhci-core.c
··· 474 474 return sg_count; 475 475 } 476 476 477 - static void cqhci_set_tran_desc(u8 *desc, dma_addr_t addr, int len, bool end, 478 - bool dma64) 477 + void cqhci_set_tran_desc(u8 *desc, dma_addr_t addr, int len, bool end, 478 + bool dma64) 479 479 { 480 480 __le32 *attr = (__le32 __force *)desc; 481 481 ··· 495 495 dataddr[0] = cpu_to_le32(addr); 496 496 } 497 497 } 498 + EXPORT_SYMBOL(cqhci_set_tran_desc); 498 499 499 500 static int cqhci_prep_tran_desc(struct mmc_request *mrq, 500 501 struct cqhci_host *cq_host, int tag) ··· 523 522 524 523 if ((i+1) == sg_count) 525 524 end = true; 526 - cqhci_set_tran_desc(desc, addr, len, end, dma64); 525 + if (cq_host->ops->set_tran_desc) 526 + cq_host->ops->set_tran_desc(cq_host, &desc, addr, len, end, dma64); 527 + else 528 + cqhci_set_tran_desc(desc, addr, len, end, dma64); 529 + 527 530 desc += cq_host->trans_desc_len; 528 531 } 529 532
+4
drivers/mmc/host/cqhci.h
··· 293 293 int (*program_key)(struct cqhci_host *cq_host, 294 294 const union cqhci_crypto_cfg_entry *cfg, int slot); 295 295 #endif 296 + void (*set_tran_desc)(struct cqhci_host *cq_host, u8 **desc, 297 + dma_addr_t addr, int len, bool end, bool dma64); 298 + 296 299 }; 297 300 298 301 static inline void cqhci_writel(struct cqhci_host *host, u32 val, int reg) ··· 321 318 int cqhci_init(struct cqhci_host *cq_host, struct mmc_host *mmc, bool dma64); 322 319 struct cqhci_host *cqhci_pltfm_init(struct platform_device *pdev); 323 320 int cqhci_deactivate(struct mmc_host *mmc); 321 + void cqhci_set_tran_desc(u8 *desc, dma_addr_t addr, int len, bool end, bool dma64); 324 322 static inline int cqhci_suspend(struct mmc_host *mmc) 325 323 { 326 324 return cqhci_deactivate(mmc);