Merge branch 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma
Pull slave-dmaengine updates from Vinod Koul: - new drivers for: - Ingenic JZ4780 controller - APM X-Gene controller - Freescale RaidEngine device - Renesas USB Controller - remove device_alloc_chan_resources dummy handlers - sh driver cleanups for peri peri and related emmc and asoc patches as well - fixes and enhancements spread over the drivers * 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma: (59 commits) dmaengine: dw: don't prompt for DW_DMAC_CORE dmaengine: shdmac: avoid unused variable warnings dmaengine: fix platform_no_drv_owner.cocci warnings dmaengine: pch_dma: fix memory leak on failure path in pch_dma_probe() dmaengine: at_xdmac: unlock spin lock before return dmaengine: xgene: devm_ioremap() returns NULL on error dmaengine: xgene: buffer overflow in xgene_dma_init_channels() dmaengine: usb-dmac: Fix dereferencing freed memory 'desc' dmaengine: sa11x0: report slave capabilities to upper layers dmaengine: vdma: Fix compilation warnings dmaengine: fsl_raid: statify fsl_re_chan_probe dmaengine: Driver support for FSL RaidEngine device. dmaengine: xgene_dma_init_ring_mngr() can be static Documentation: dma: Add documentation for the APM X-Gene SoC DMA device DTS binding arm64: dts: Add APM X-Gene SoC DMA device and DMA clock DTS nodes dmaengine: Add support for APM X-Gene SoC DMA engine driver dmaengine: usb-dmac: Add Renesas USB DMA Controller (USB-DMAC) driver dmaengine: renesas,usb-dmac: Add device tree bindings documentation dmaengine: edma: fixed wrongly initialized data parameter to the edma callback dmaengine: ste_dma40: fix implicit conversion ...
This commit is contained in:
@@ -388,7 +388,7 @@ sh_mmcif_request_dma_one(struct sh_mmcif_host *host,
|
||||
{
|
||||
struct dma_slave_config cfg = { 0, };
|
||||
struct dma_chan *chan;
|
||||
unsigned int slave_id;
|
||||
void *slave_data = NULL;
|
||||
struct resource *res;
|
||||
dma_cap_mask_t mask;
|
||||
int ret;
|
||||
@@ -397,13 +397,12 @@ sh_mmcif_request_dma_one(struct sh_mmcif_host *host,
|
||||
dma_cap_set(DMA_SLAVE, mask);
|
||||
|
||||
if (pdata)
|
||||
slave_id = direction == DMA_MEM_TO_DEV
|
||||
? pdata->slave_id_tx : pdata->slave_id_rx;
|
||||
else
|
||||
slave_id = 0;
|
||||
slave_data = direction == DMA_MEM_TO_DEV ?
|
||||
(void *)pdata->slave_id_tx :
|
||||
(void *)pdata->slave_id_rx;
|
||||
|
||||
chan = dma_request_slave_channel_compat(mask, shdma_chan_filter,
|
||||
(void *)(unsigned long)slave_id, &host->pd->dev,
|
||||
slave_data, &host->pd->dev,
|
||||
direction == DMA_MEM_TO_DEV ? "tx" : "rx");
|
||||
|
||||
dev_dbg(&host->pd->dev, "%s: %s: got channel %p\n", __func__,
|
||||
@@ -414,8 +413,6 @@ sh_mmcif_request_dma_one(struct sh_mmcif_host *host,
|
||||
|
||||
res = platform_get_resource(host->pd, IORESOURCE_MEM, 0);
|
||||
|
||||
/* In the OF case the driver will get the slave ID from the DT */
|
||||
cfg.slave_id = slave_id;
|
||||
cfg.direction = direction;
|
||||
|
||||
if (direction == DMA_DEV_TO_MEM) {
|
||||
|
@@ -201,7 +201,7 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
|
||||
of_match_device(sh_mobile_sdhi_of_match, &pdev->dev);
|
||||
struct sh_mobile_sdhi *priv;
|
||||
struct tmio_mmc_data *mmc_data;
|
||||
struct sh_mobile_sdhi_info *p = pdev->dev.platform_data;
|
||||
struct tmio_mmc_data *mmd = pdev->dev.platform_data;
|
||||
struct tmio_mmc_host *host;
|
||||
struct resource *res;
|
||||
int irq, ret, i = 0;
|
||||
@@ -245,30 +245,14 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
|
||||
else
|
||||
host->bus_shift = 0;
|
||||
|
||||
mmc_data->capabilities = MMC_CAP_MMC_HIGHSPEED;
|
||||
if (p) {
|
||||
mmc_data->flags = p->tmio_flags;
|
||||
mmc_data->ocr_mask = p->tmio_ocr_mask;
|
||||
mmc_data->capabilities |= p->tmio_caps;
|
||||
mmc_data->capabilities2 |= p->tmio_caps2;
|
||||
mmc_data->cd_gpio = p->cd_gpio;
|
||||
if (mmd)
|
||||
*mmc_data = *mmd;
|
||||
|
||||
if (p->dma_slave_tx > 0 && p->dma_slave_rx > 0) {
|
||||
/*
|
||||
* Yes, we have to provide slave IDs twice to TMIO:
|
||||
* once as a filter parameter and once for channel
|
||||
* configuration as an explicit slave ID
|
||||
*/
|
||||
dma_priv->chan_priv_tx = (void *)p->dma_slave_tx;
|
||||
dma_priv->chan_priv_rx = (void *)p->dma_slave_rx;
|
||||
dma_priv->slave_id_tx = p->dma_slave_tx;
|
||||
dma_priv->slave_id_rx = p->dma_slave_rx;
|
||||
}
|
||||
}
|
||||
dma_priv->filter = shdma_chan_filter;
|
||||
dma_priv->enable = sh_mobile_sdhi_enable_dma;
|
||||
|
||||
mmc_data->alignment_shift = 1; /* 2-byte alignment */
|
||||
mmc_data->capabilities |= MMC_CAP_MMC_HIGHSPEED;
|
||||
|
||||
/*
|
||||
* All SDHI blocks support 2-byte and larger block sizes in 4-bit
|
||||
|
@@ -43,10 +43,6 @@ struct tmio_mmc_data;
|
||||
struct tmio_mmc_host;
|
||||
|
||||
struct tmio_mmc_dma {
|
||||
void *chan_priv_tx;
|
||||
void *chan_priv_rx;
|
||||
int slave_id_tx;
|
||||
int slave_id_rx;
|
||||
enum dma_slave_buswidth dma_buswidth;
|
||||
bool (*filter)(struct dma_chan *chan, void *arg);
|
||||
void (*enable)(struct tmio_mmc_host *host, bool enable);
|
||||
|
@@ -261,7 +261,7 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat
|
||||
{
|
||||
/* We can only either use DMA for both Tx and Rx or not use it at all */
|
||||
if (!host->dma || (!host->pdev->dev.of_node &&
|
||||
(!host->dma->chan_priv_tx || !host->dma->chan_priv_rx)))
|
||||
(!pdata->chan_priv_tx || !pdata->chan_priv_rx)))
|
||||
return;
|
||||
|
||||
if (!host->chan_tx && !host->chan_rx) {
|
||||
@@ -278,7 +278,7 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat
|
||||
dma_cap_set(DMA_SLAVE, mask);
|
||||
|
||||
host->chan_tx = dma_request_slave_channel_compat(mask,
|
||||
host->dma->filter, host->dma->chan_priv_tx,
|
||||
host->dma->filter, pdata->chan_priv_tx,
|
||||
&host->pdev->dev, "tx");
|
||||
dev_dbg(&host->pdev->dev, "%s: TX: got channel %p\n", __func__,
|
||||
host->chan_tx);
|
||||
@@ -286,8 +286,6 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat
|
||||
if (!host->chan_tx)
|
||||
return;
|
||||
|
||||
if (host->dma->chan_priv_tx)
|
||||
cfg.slave_id = host->dma->slave_id_tx;
|
||||
cfg.direction = DMA_MEM_TO_DEV;
|
||||
cfg.dst_addr = res->start + (CTL_SD_DATA_PORT << host->bus_shift);
|
||||
cfg.dst_addr_width = host->dma->dma_buswidth;
|
||||
@@ -299,7 +297,7 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat
|
||||
goto ecfgtx;
|
||||
|
||||
host->chan_rx = dma_request_slave_channel_compat(mask,
|
||||
host->dma->filter, host->dma->chan_priv_rx,
|
||||
host->dma->filter, pdata->chan_priv_rx,
|
||||
&host->pdev->dev, "rx");
|
||||
dev_dbg(&host->pdev->dev, "%s: RX: got channel %p\n", __func__,
|
||||
host->chan_rx);
|
||||
@@ -307,8 +305,6 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat
|
||||
if (!host->chan_rx)
|
||||
goto ereqrx;
|
||||
|
||||
if (host->dma->chan_priv_rx)
|
||||
cfg.slave_id = host->dma->slave_id_rx;
|
||||
cfg.direction = DMA_DEV_TO_MEM;
|
||||
cfg.src_addr = cfg.dst_addr + host->pdata->dma_rx_offset;
|
||||
cfg.src_addr_width = host->dma->dma_buswidth;
|
||||
|
Reference in New Issue
Block a user