Merge branches 'depends/asoc-dma', 'depends/dma-of' and 'depends/tegra-clk' into next/cleanup
Merging in external dependencies for the Tegra DMA and reset controller refactoring from external trees. Per Stephen Warren, the stability of these branches have been negotiated with the relevant parties (Vinod/Mark/Mike) * depends/asoc-dma: ASoC: dmaengine: fix deferred probe detection ASoC: dmaengine: support deferred probe for DMA channels dma: add channel request API that supports deferred probe ASoC: dmaengine: add custom DMA config to snd_dmaengine_pcm_config ASoC: don't leak on error in snd_dmaengine_pcm_register ASoC: restructure dmaengine_pcm_request_chan_of() ASoC: generic-dmaengine-pcm: Set BATCH flag when residue reporting is not supported ASoC: Add resource managed snd_dmaengine_pcm_register() * depends/dma-of: dma: add dma_get_any_slave_channel(), for use in of_xlate() * depends/tegra-clk: (42 commits) clk: tegra: fix __clk_lookup() return value checks clk: tegra: Do not print errors for clk_round_rate() clk: tegra: Initialize DSI low-power clocks clk: tegra: add FUSE clock device clk: tegra: Properly setup PWM clock on Tegra30 clk: tegra: Initialize secondary gr3d clock on Tegra30 clk: tegra114: Initialize clocks needed for HDMI clk: tegra124: add suspend/resume function for tegra_cpu_car_ops clk: tegra124: add wait_for_reset and disable_clock for tegra_cpu_car_ops clk: tegra124: Add support for Tegra124 clocks clk: tegra124: Add new peripheral clocks clk: tegra124: Add common clk IDs to clk-id.h clk: tegra: add TEGRA_PERIPH_NO_GATE clk: tegra: add locking to periph clks clk: tegra: Add periph regs bank X clk: tegra: Add support for PLLSS clk: tegra: move tegra20 to common infra clk: tegra: move tegra30 to common infra clk: tegra: introduce common gen4 super clock clk: tegra: move PMC, fixed clocks to common files ... Signed-off-by: Olof Johansson <olof@lixom.net>
This commit is contained in:
@@ -535,11 +535,41 @@ struct dma_chan *dma_get_slave_channel(struct dma_chan *chan)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(dma_get_slave_channel);
|
||||
|
||||
struct dma_chan *dma_get_any_slave_channel(struct dma_device *device)
|
||||
{
|
||||
dma_cap_mask_t mask;
|
||||
struct dma_chan *chan;
|
||||
int err;
|
||||
|
||||
dma_cap_zero(mask);
|
||||
dma_cap_set(DMA_SLAVE, mask);
|
||||
|
||||
/* lock against __dma_request_channel */
|
||||
mutex_lock(&dma_list_mutex);
|
||||
|
||||
chan = private_candidate(&mask, device, NULL, NULL);
|
||||
if (chan) {
|
||||
err = dma_chan_get(chan);
|
||||
if (err) {
|
||||
pr_debug("%s: failed to get %s: (%d)\n",
|
||||
__func__, dma_chan_name(chan), err);
|
||||
chan = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
mutex_unlock(&dma_list_mutex);
|
||||
|
||||
return chan;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(dma_get_any_slave_channel);
|
||||
|
||||
/**
|
||||
* __dma_request_channel - try to allocate an exclusive channel
|
||||
* @mask: capabilities that the channel must satisfy
|
||||
* @fn: optional callback to disposition available channels
|
||||
* @fn_param: opaque parameter to pass to dma_filter_fn
|
||||
*
|
||||
* Returns pointer to appropriate DMA channel on success or NULL.
|
||||
*/
|
||||
struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask,
|
||||
dma_filter_fn fn, void *fn_param)
|
||||
@@ -591,18 +621,43 @@ EXPORT_SYMBOL_GPL(__dma_request_channel);
|
||||
* dma_request_slave_channel - try to allocate an exclusive slave channel
|
||||
* @dev: pointer to client device structure
|
||||
* @name: slave channel name
|
||||
*
|
||||
* Returns pointer to appropriate DMA channel on success or an error pointer.
|
||||
*/
|
||||
struct dma_chan *dma_request_slave_channel(struct device *dev, const char *name)
|
||||
struct dma_chan *dma_request_slave_channel_reason(struct device *dev,
|
||||
const char *name)
|
||||
{
|
||||
struct dma_chan *chan;
|
||||
|
||||
/* If device-tree is present get slave info from here */
|
||||
if (dev->of_node)
|
||||
return of_dma_request_slave_channel(dev->of_node, name);
|
||||
|
||||
/* If device was enumerated by ACPI get slave info from here */
|
||||
if (ACPI_HANDLE(dev))
|
||||
return acpi_dma_request_slave_chan_by_name(dev, name);
|
||||
if (ACPI_HANDLE(dev)) {
|
||||
chan = acpi_dma_request_slave_chan_by_name(dev, name);
|
||||
if (chan)
|
||||
return chan;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return ERR_PTR(-ENODEV);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(dma_request_slave_channel_reason);
|
||||
|
||||
/**
|
||||
* dma_request_slave_channel - try to allocate an exclusive slave channel
|
||||
* @dev: pointer to client device structure
|
||||
* @name: slave channel name
|
||||
*
|
||||
* Returns pointer to appropriate DMA channel on success or NULL.
|
||||
*/
|
||||
struct dma_chan *dma_request_slave_channel(struct device *dev,
|
||||
const char *name)
|
||||
{
|
||||
struct dma_chan *ch = dma_request_slave_channel_reason(dev, name);
|
||||
if (IS_ERR(ch))
|
||||
return NULL;
|
||||
return ch;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(dma_request_slave_channel);
|
||||
|
||||
|
Reference in New Issue
Block a user