mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
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 <[email protected]>
This commit is contained in:
commit
1c7af42fe5
27 changed files with 5298 additions and 3068 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -893,33 +893,17 @@ static struct dma_chan *mmp_pdma_dma_xlate(struct of_phandle_args *dma_spec,
|
|||
struct of_dma *ofdma)
|
||||
{
|
||||
struct mmp_pdma_device *d = ofdma->of_dma_data;
|
||||
struct dma_chan *chan, *candidate;
|
||||
struct dma_chan *chan;
|
||||
struct mmp_pdma_chan *c;
|
||||
|
||||
retry:
|
||||
candidate = NULL;
|
||||
|
||||
/* walk the list of channels registered with the current instance and
|
||||
* find one that is currently unused */
|
||||
list_for_each_entry(chan, &d->device.channels, device_node)
|
||||
if (chan->client_count == 0) {
|
||||
candidate = chan;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!candidate)
|
||||
chan = dma_get_any_slave_channel(&d->device);
|
||||
if (!chan)
|
||||
return NULL;
|
||||
|
||||
/* dma_get_slave_channel will return NULL if we lost a race between
|
||||
* the lookup and the reservation */
|
||||
chan = dma_get_slave_channel(candidate);
|
||||
c = to_mmp_pdma_chan(chan);
|
||||
c->drcmr = dma_spec->args[0];
|
||||
|
||||
if (chan) {
|
||||
struct mmp_pdma_chan *c = to_mmp_pdma_chan(chan);
|
||||
c->drcmr = dma_spec->args[0];
|
||||
return chan;
|
||||
}
|
||||
|
||||
goto retry;
|
||||
return chan;
|
||||
}
|
||||
|
||||
static int mmp_pdma_probe(struct platform_device *op)
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ static int of_dma_match_channel(struct device_node *np, const char *name,
|
|||
* @np: device node to get DMA request from
|
||||
* @name: name of desired channel
|
||||
*
|
||||
* Returns pointer to appropriate dma channel on success or NULL on error.
|
||||
* Returns pointer to appropriate DMA channel on success or an error pointer.
|
||||
*/
|
||||
struct dma_chan *of_dma_request_slave_channel(struct device_node *np,
|
||||
const char *name)
|
||||
|
|
@ -152,17 +152,18 @@ struct dma_chan *of_dma_request_slave_channel(struct device_node *np,
|
|||
struct of_dma *ofdma;
|
||||
struct dma_chan *chan;
|
||||
int count, i;
|
||||
int ret_no_channel = -ENODEV;
|
||||
|
||||
if (!np || !name) {
|
||||
pr_err("%s: not enough information provided\n", __func__);
|
||||
return NULL;
|
||||
return ERR_PTR(-ENODEV);
|
||||
}
|
||||
|
||||
count = of_property_count_strings(np, "dma-names");
|
||||
if (count < 0) {
|
||||
pr_err("%s: dma-names property of node '%s' missing or empty\n",
|
||||
__func__, np->full_name);
|
||||
return NULL;
|
||||
return ERR_PTR(-ENODEV);
|
||||
}
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
|
|
@ -172,10 +173,12 @@ struct dma_chan *of_dma_request_slave_channel(struct device_node *np,
|
|||
mutex_lock(&of_dma_lock);
|
||||
ofdma = of_dma_find_controller(&dma_spec);
|
||||
|
||||
if (ofdma)
|
||||
if (ofdma) {
|
||||
chan = ofdma->of_dma_xlate(&dma_spec, ofdma);
|
||||
else
|
||||
} else {
|
||||
ret_no_channel = -EPROBE_DEFER;
|
||||
chan = NULL;
|
||||
}
|
||||
|
||||
mutex_unlock(&of_dma_lock);
|
||||
|
||||
|
|
@ -185,7 +188,7 @@ struct dma_chan *of_dma_request_slave_channel(struct device_node *np,
|
|||
return chan;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return ERR_PTR(ret_no_channel);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue