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

Configure Feed

Select the types of activity you want to include in your feed.

dmaengine: ti: k3-udma-glue: Add function to get device pointer for DMA API

Glue layer users should use the device of the DMA for DMA mapping and
allocations as it is the DMA which accesses to descriptors and buffers,
not the clients

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
Link: https://lore.kernel.org/r/20201208090440.31792-5-peter.ujfalusi@ti.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Peter Ujfalusi and committed by
Vinod Koul
426506a7 1609c15a

+25
+14
drivers/dma/ti/k3-udma-glue.c
··· 493 493 } 494 494 EXPORT_SYMBOL_GPL(k3_udma_glue_tx_get_irq); 495 495 496 + struct device * 497 + k3_udma_glue_tx_get_dma_device(struct k3_udma_glue_tx_channel *tx_chn) 498 + { 499 + return xudma_get_device(tx_chn->common.udmax); 500 + } 501 + EXPORT_SYMBOL_GPL(k3_udma_glue_tx_get_dma_device); 502 + 496 503 static int k3_udma_glue_cfg_rx_chn(struct k3_udma_glue_rx_channel *rx_chn) 497 504 { 498 505 const struct udma_tisci_rm *tisci_rm = rx_chn->common.tisci_rm; ··· 1208 1201 return flow->virq; 1209 1202 } 1210 1203 EXPORT_SYMBOL_GPL(k3_udma_glue_rx_get_irq); 1204 + 1205 + struct device * 1206 + k3_udma_glue_rx_get_dma_device(struct k3_udma_glue_rx_channel *rx_chn) 1207 + { 1208 + return xudma_get_device(rx_chn->common.udmax); 1209 + } 1210 + EXPORT_SYMBOL_GPL(k3_udma_glue_rx_get_dma_device);
+6
drivers/dma/ti/k3-udma-private.c
··· 50 50 } 51 51 EXPORT_SYMBOL(of_xudma_dev_get); 52 52 53 + struct device *xudma_get_device(struct udma_dev *ud) 54 + { 55 + return ud->dev; 56 + } 57 + EXPORT_SYMBOL(xudma_get_device); 58 + 53 59 u32 xudma_dev_get_psil_base(struct udma_dev *ud) 54 60 { 55 61 return ud->psil_base;
+1
drivers/dma/ti/k3-udma.h
··· 112 112 u32 dst_thread); 113 113 114 114 struct udma_dev *of_xudma_dev_get(struct device_node *np, const char *property); 115 + struct device *xudma_get_device(struct udma_dev *ud); 115 116 void xudma_dev_put(struct udma_dev *ud); 116 117 u32 xudma_dev_get_psil_base(struct udma_dev *ud); 117 118 struct udma_tisci_rm *xudma_dev_get_tisci_rm(struct udma_dev *ud);
+4
include/linux/dma/k3-udma-glue.h
··· 41 41 u32 k3_udma_glue_tx_get_hdesc_size(struct k3_udma_glue_tx_channel *tx_chn); 42 42 u32 k3_udma_glue_tx_get_txcq_id(struct k3_udma_glue_tx_channel *tx_chn); 43 43 int k3_udma_glue_tx_get_irq(struct k3_udma_glue_tx_channel *tx_chn); 44 + struct device * 45 + k3_udma_glue_tx_get_dma_device(struct k3_udma_glue_tx_channel *tx_chn); 44 46 45 47 enum { 46 48 K3_UDMA_GLUE_SRC_TAG_LO_KEEP = 0, ··· 132 130 u32 flow_idx); 133 131 int k3_udma_glue_rx_flow_disable(struct k3_udma_glue_rx_channel *rx_chn, 134 132 u32 flow_idx); 133 + struct device * 134 + k3_udma_glue_rx_get_dma_device(struct k3_udma_glue_rx_channel *rx_chn); 135 135 136 136 #endif /* K3_UDMA_GLUE_H_ */