Commit 2c9ee33d authored by Mark Brown's avatar Mark Brown

Merge branch 'for-2.6.32' into for-2.6.33

parents 766df6d9 539d3d8c
...@@ -76,12 +76,12 @@ static struct sport_param sport_params[2] = { ...@@ -76,12 +76,12 @@ static struct sport_param sport_params[2] = {
* TFS. When Port G is selected and EMAC then there is a conflict between * TFS. When Port G is selected and EMAC then there is a conflict between
* the PHY interrupt line and TFS. Current settings prevent the conflict * the PHY interrupt line and TFS. Current settings prevent the conflict
* by ignoring the TFS pin when Port G is selected. This allows both * by ignoring the TFS pin when Port G is selected. This allows both
* ssm2602 using Port G and EMAC concurrently. * codecs and EMAC using Port G concurrently.
*/ */
#ifdef CONFIG_BF527_SPORT0_PORTF #ifdef CONFIG_BF527_SPORT0_PORTG
#define LOCAL_SPORT0_TFS (P_SPORT0_TFS)
#else
#define LOCAL_SPORT0_TFS (0) #define LOCAL_SPORT0_TFS (0)
#else
#define LOCAL_SPORT0_TFS (P_SPORT0_TFS)
#endif #endif
static u16 sport_req[][7] = { {P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS, static u16 sport_req[][7] = { {P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
......
...@@ -70,12 +70,12 @@ static struct sport_param sport_params[2] = { ...@@ -70,12 +70,12 @@ static struct sport_param sport_params[2] = {
* TFS. When Port G is selected and EMAC then there is a conflict between * TFS. When Port G is selected and EMAC then there is a conflict between
* the PHY interrupt line and TFS. Current settings prevent the conflict * the PHY interrupt line and TFS. Current settings prevent the conflict
* by ignoring the TFS pin when Port G is selected. This allows both * by ignoring the TFS pin when Port G is selected. This allows both
* ssm2602 using Port G and EMAC concurrently. * codecs and EMAC using Port G concurrently.
*/ */
#ifdef CONFIG_BF527_SPORT0_PORTF #ifdef CONFIG_BF527_SPORT0_PORTG
#define LOCAL_SPORT0_TFS (P_SPORT0_TFS)
#else
#define LOCAL_SPORT0_TFS (0) #define LOCAL_SPORT0_TFS (0)
#else
#define LOCAL_SPORT0_TFS (P_SPORT0_TFS)
#endif #endif
static u16 sport_req[][7] = { {P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS, static u16 sport_req[][7] = { {P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
......
...@@ -251,8 +251,7 @@ static int __devexit ad1836_spi_remove(struct spi_device *spi) ...@@ -251,8 +251,7 @@ static int __devexit ad1836_spi_remove(struct spi_device *spi)
static struct spi_driver ad1836_spi_driver = { static struct spi_driver ad1836_spi_driver = {
.driver = { .driver = {
.name = "ad1836-spi", .name = "ad1836",
.bus = &spi_bus_type,
.owner = THIS_MODULE, .owner = THIS_MODULE,
}, },
.probe = ad1836_spi_probe, .probe = ad1836_spi_probe,
......
...@@ -456,7 +456,6 @@ static int __devexit ad1938_spi_remove(struct spi_device *spi) ...@@ -456,7 +456,6 @@ static int __devexit ad1938_spi_remove(struct spi_device *spi)
static struct spi_driver ad1938_spi_driver = { static struct spi_driver ad1938_spi_driver = {
.driver = { .driver = {
.name = "ad1938", .name = "ad1938",
.bus = &spi_bus_type,
.owner = THIS_MODULE, .owner = THIS_MODULE,
}, },
.probe = ad1938_spi_probe, .probe = ad1938_spi_probe,
...@@ -515,6 +514,7 @@ static int ad1938_register(struct ad1938_priv *ad1938) ...@@ -515,6 +514,7 @@ static int ad1938_register(struct ad1938_priv *ad1938)
codec->num_dai = 1; codec->num_dai = 1;
codec->write = ad1938_write_reg; codec->write = ad1938_write_reg;
codec->read = ad1938_read_reg_cache; codec->read = ad1938_read_reg_cache;
codec->set_bias_level = ad1938_set_bias_level;
INIT_LIST_HEAD(&codec->dapm_widgets); INIT_LIST_HEAD(&codec->dapm_widgets);
INIT_LIST_HEAD(&codec->dapm_paths); INIT_LIST_HEAD(&codec->dapm_paths);
......
...@@ -595,6 +595,7 @@ static const struct snd_soc_dapm_route audio_map[] = { ...@@ -595,6 +595,7 @@ static const struct snd_soc_dapm_route audio_map[] = {
/* Mono Capture mixer-mux */ /* Mono Capture mixer-mux */
{"Capture Right Mixer", "Stereo", "Capture Right Mux"}, {"Capture Right Mixer", "Stereo", "Capture Right Mux"},
{"Capture Left Mixer", "Stereo", "Capture Left Mux"},
{"Capture Left Mixer", "Analogue Mix Left", "Capture Left Mux"}, {"Capture Left Mixer", "Analogue Mix Left", "Capture Left Mux"},
{"Capture Left Mixer", "Analogue Mix Left", "Capture Right Mux"}, {"Capture Left Mixer", "Analogue Mix Left", "Capture Right Mux"},
{"Capture Right Mixer", "Analogue Mix Right", "Capture Left Mux"}, {"Capture Right Mixer", "Analogue Mix Right", "Capture Left Mux"},
......
...@@ -97,22 +97,19 @@ enum { ...@@ -97,22 +97,19 @@ enum {
DAVINCI_MCBSP_WORD_32, DAVINCI_MCBSP_WORD_32,
}; };
static struct davinci_pcm_dma_params davinci_i2s_pcm_out = {
.name = "I2S PCM Stereo out",
};
static struct davinci_pcm_dma_params davinci_i2s_pcm_in = {
.name = "I2S PCM Stereo in",
};
struct davinci_mcbsp_dev { struct davinci_mcbsp_dev {
/*
* dma_params must be first because rtd->dai->cpu_dai->private_data
* is cast to a pointer of an array of struct davinci_pcm_dma_params in
* davinci_pcm_open.
*/
struct davinci_pcm_dma_params dma_params[2];
void __iomem *base; void __iomem *base;
#define MOD_DSP_A 0 #define MOD_DSP_A 0
#define MOD_DSP_B 1 #define MOD_DSP_B 1
int mode; int mode;
u32 pcr; u32 pcr;
struct clk *clk; struct clk *clk;
struct davinci_pcm_dma_params *dma_params[2];
}; };
static inline void davinci_mcbsp_write_reg(struct davinci_mcbsp_dev *dev, static inline void davinci_mcbsp_write_reg(struct davinci_mcbsp_dev *dev,
...@@ -215,14 +212,6 @@ static void davinci_mcbsp_stop(struct davinci_mcbsp_dev *dev, int playback) ...@@ -215,14 +212,6 @@ static void davinci_mcbsp_stop(struct davinci_mcbsp_dev *dev, int playback)
toggle_clock(dev, playback); toggle_clock(dev, playback);
} }
static int davinci_i2s_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *cpu_dai)
{
struct davinci_mcbsp_dev *dev = cpu_dai->private_data;
cpu_dai->dma_data = dev->dma_params[substream->stream];
return 0;
}
#define DEFAULT_BITPERSAMPLE 16 #define DEFAULT_BITPERSAMPLE 16
static int davinci_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai, static int davinci_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai,
...@@ -353,8 +342,9 @@ static int davinci_i2s_hw_params(struct snd_pcm_substream *substream, ...@@ -353,8 +342,9 @@ static int davinci_i2s_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params, struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai) struct snd_soc_dai *dai)
{ {
struct davinci_pcm_dma_params *dma_params = dai->dma_data;
struct davinci_mcbsp_dev *dev = dai->private_data; struct davinci_mcbsp_dev *dev = dai->private_data;
struct davinci_pcm_dma_params *dma_params =
&dev->dma_params[substream->stream];
struct snd_interval *i = NULL; struct snd_interval *i = NULL;
int mcbsp_word_length; int mcbsp_word_length;
unsigned int rcr, xcr, srgr; unsigned int rcr, xcr, srgr;
...@@ -472,7 +462,6 @@ static void davinci_i2s_shutdown(struct snd_pcm_substream *substream, ...@@ -472,7 +462,6 @@ static void davinci_i2s_shutdown(struct snd_pcm_substream *substream,
#define DAVINCI_I2S_RATES SNDRV_PCM_RATE_8000_96000 #define DAVINCI_I2S_RATES SNDRV_PCM_RATE_8000_96000
static struct snd_soc_dai_ops davinci_i2s_dai_ops = { static struct snd_soc_dai_ops davinci_i2s_dai_ops = {
.startup = davinci_i2s_startup,
.shutdown = davinci_i2s_shutdown, .shutdown = davinci_i2s_shutdown,
.prepare = davinci_i2s_prepare, .prepare = davinci_i2s_prepare,
.trigger = davinci_i2s_trigger, .trigger = davinci_i2s_trigger,
...@@ -534,12 +523,10 @@ static int davinci_i2s_probe(struct platform_device *pdev) ...@@ -534,12 +523,10 @@ static int davinci_i2s_probe(struct platform_device *pdev)
dev->base = (void __iomem *)IO_ADDRESS(mem->start); dev->base = (void __iomem *)IO_ADDRESS(mem->start);
dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK] = &davinci_i2s_pcm_out; dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK].dma_addr =
dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK]->dma_addr =
(dma_addr_t)(io_v2p(dev->base) + DAVINCI_MCBSP_DXR_REG); (dma_addr_t)(io_v2p(dev->base) + DAVINCI_MCBSP_DXR_REG);
dev->dma_params[SNDRV_PCM_STREAM_CAPTURE] = &davinci_i2s_pcm_in; dev->dma_params[SNDRV_PCM_STREAM_CAPTURE].dma_addr =
dev->dma_params[SNDRV_PCM_STREAM_CAPTURE]->dma_addr =
(dma_addr_t)(io_v2p(dev->base) + DAVINCI_MCBSP_DRR_REG); (dma_addr_t)(io_v2p(dev->base) + DAVINCI_MCBSP_DRR_REG);
/* first TX, then RX */ /* first TX, then RX */
...@@ -549,7 +536,7 @@ static int davinci_i2s_probe(struct platform_device *pdev) ...@@ -549,7 +536,7 @@ static int davinci_i2s_probe(struct platform_device *pdev)
ret = -ENXIO; ret = -ENXIO;
goto err_free_mem; goto err_free_mem;
} }
dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK]->channel = res->start; dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK].channel = res->start;
res = platform_get_resource(pdev, IORESOURCE_DMA, 1); res = platform_get_resource(pdev, IORESOURCE_DMA, 1);
if (!res) { if (!res) {
...@@ -557,7 +544,7 @@ static int davinci_i2s_probe(struct platform_device *pdev) ...@@ -557,7 +544,7 @@ static int davinci_i2s_probe(struct platform_device *pdev)
ret = -ENXIO; ret = -ENXIO;
goto err_free_mem; goto err_free_mem;
} }
dev->dma_params[SNDRV_PCM_STREAM_CAPTURE]->channel = res->start; dev->dma_params[SNDRV_PCM_STREAM_CAPTURE].channel = res->start;
davinci_i2s_dai.private_data = dev; davinci_i2s_dai.private_data = dev;
ret = snd_soc_register_dai(&davinci_i2s_dai); ret = snd_soc_register_dai(&davinci_i2s_dai);
......
...@@ -332,14 +332,6 @@ static inline void mcasp_set_ctl_reg(void __iomem *regs, u32 val) ...@@ -332,14 +332,6 @@ static inline void mcasp_set_ctl_reg(void __iomem *regs, u32 val)
printk(KERN_ERR "GBLCTL write error\n"); printk(KERN_ERR "GBLCTL write error\n");
} }
static int davinci_mcasp_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *cpu_dai)
{
struct davinci_audio_dev *dev = cpu_dai->private_data;
cpu_dai->dma_data = dev->dma_params[substream->stream];
return 0;
}
static void mcasp_start_rx(struct davinci_audio_dev *dev) static void mcasp_start_rx(struct davinci_audio_dev *dev)
{ {
mcasp_set_ctl_reg(dev->base + DAVINCI_MCASP_GBLCTLR_REG, RXHCLKRST); mcasp_set_ctl_reg(dev->base + DAVINCI_MCASP_GBLCTLR_REG, RXHCLKRST);
...@@ -386,17 +378,17 @@ static void mcasp_start_tx(struct davinci_audio_dev *dev) ...@@ -386,17 +378,17 @@ static void mcasp_start_tx(struct davinci_audio_dev *dev)
static void davinci_mcasp_start(struct davinci_audio_dev *dev, int stream) static void davinci_mcasp_start(struct davinci_audio_dev *dev, int stream)
{ {
if (stream == SNDRV_PCM_STREAM_PLAYBACK) if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
if (dev->txnumevt) /* enable FIFO */
mcasp_set_bits(dev->base + DAVINCI_MCASP_WFIFOCTL,
FIFO_ENABLE);
mcasp_start_tx(dev); mcasp_start_tx(dev);
else } else {
if (dev->rxnumevt) /* enable FIFO */
mcasp_set_bits(dev->base + DAVINCI_MCASP_RFIFOCTL,
FIFO_ENABLE);
mcasp_start_rx(dev); mcasp_start_rx(dev);
}
/* enable FIFO */
if (dev->txnumevt)
mcasp_set_bits(dev->base + DAVINCI_MCASP_WFIFOCTL, FIFO_ENABLE);
if (dev->rxnumevt)
mcasp_set_bits(dev->base + DAVINCI_MCASP_RFIFOCTL, FIFO_ENABLE);
} }
static void mcasp_stop_rx(struct davinci_audio_dev *dev) static void mcasp_stop_rx(struct davinci_audio_dev *dev)
...@@ -413,17 +405,17 @@ static void mcasp_stop_tx(struct davinci_audio_dev *dev) ...@@ -413,17 +405,17 @@ static void mcasp_stop_tx(struct davinci_audio_dev *dev)
static void davinci_mcasp_stop(struct davinci_audio_dev *dev, int stream) static void davinci_mcasp_stop(struct davinci_audio_dev *dev, int stream)
{ {
if (stream == SNDRV_PCM_STREAM_PLAYBACK) if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
if (dev->txnumevt) /* disable FIFO */
mcasp_clr_bits(dev->base + DAVINCI_MCASP_WFIFOCTL,
FIFO_ENABLE);
mcasp_stop_tx(dev); mcasp_stop_tx(dev);
else } else {
if (dev->rxnumevt) /* disable FIFO */
mcasp_clr_bits(dev->base + DAVINCI_MCASP_RFIFOCTL,
FIFO_ENABLE);
mcasp_stop_rx(dev); mcasp_stop_rx(dev);
}
/* disable FIFO */
if (dev->txnumevt)
mcasp_clr_bits(dev->base + DAVINCI_MCASP_WFIFOCTL, FIFO_ENABLE);
if (dev->rxnumevt)
mcasp_clr_bits(dev->base + DAVINCI_MCASP_RFIFOCTL, FIFO_ENABLE);
} }
static int davinci_mcasp_set_dai_fmt(struct snd_soc_dai *cpu_dai, static int davinci_mcasp_set_dai_fmt(struct snd_soc_dai *cpu_dai,
...@@ -720,7 +712,7 @@ static int davinci_mcasp_hw_params(struct snd_pcm_substream *substream, ...@@ -720,7 +712,7 @@ static int davinci_mcasp_hw_params(struct snd_pcm_substream *substream,
{ {
struct davinci_audio_dev *dev = cpu_dai->private_data; struct davinci_audio_dev *dev = cpu_dai->private_data;
struct davinci_pcm_dma_params *dma_params = struct davinci_pcm_dma_params *dma_params =
dev->dma_params[substream->stream]; &dev->dma_params[substream->stream];
int word_length; int word_length;
u8 numevt; u8 numevt;
...@@ -798,7 +790,6 @@ static int davinci_mcasp_trigger(struct snd_pcm_substream *substream, ...@@ -798,7 +790,6 @@ static int davinci_mcasp_trigger(struct snd_pcm_substream *substream,
} }
static struct snd_soc_dai_ops davinci_mcasp_dai_ops = { static struct snd_soc_dai_ops davinci_mcasp_dai_ops = {
.startup = davinci_mcasp_startup,
.trigger = davinci_mcasp_trigger, .trigger = davinci_mcasp_trigger,
.hw_params = davinci_mcasp_hw_params, .hw_params = davinci_mcasp_hw_params,
.set_fmt = davinci_mcasp_set_dai_fmt, .set_fmt = davinci_mcasp_set_dai_fmt,
...@@ -849,20 +840,12 @@ static int davinci_mcasp_probe(struct platform_device *pdev) ...@@ -849,20 +840,12 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
struct resource *mem, *ioarea, *res; struct resource *mem, *ioarea, *res;
struct snd_platform_data *pdata; struct snd_platform_data *pdata;
struct davinci_audio_dev *dev; struct davinci_audio_dev *dev;
int count = 0;
int ret = 0; int ret = 0;
dev = kzalloc(sizeof(struct davinci_audio_dev), GFP_KERNEL); dev = kzalloc(sizeof(struct davinci_audio_dev), GFP_KERNEL);
if (!dev) if (!dev)
return -ENOMEM; return -ENOMEM;
dma_data = kzalloc(sizeof(struct davinci_pcm_dma_params) * 2,
GFP_KERNEL);
if (!dma_data) {
ret = -ENOMEM;
goto err_release_dev;
}
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!mem) { if (!mem) {
dev_err(&pdev->dev, "no mem resource?\n"); dev_err(&pdev->dev, "no mem resource?\n");
...@@ -897,11 +880,10 @@ static int davinci_mcasp_probe(struct platform_device *pdev) ...@@ -897,11 +880,10 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
dev->txnumevt = pdata->txnumevt; dev->txnumevt = pdata->txnumevt;
dev->rxnumevt = pdata->rxnumevt; dev->rxnumevt = pdata->rxnumevt;
dma_data[count].name = "I2S PCM Stereo out"; dma_data = &dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK];
dma_data[count].eventq_no = pdata->eventq_no; dma_data->eventq_no = pdata->eventq_no;
dma_data[count].dma_addr = (dma_addr_t) (pdata->tx_dma_offset + dma_data->dma_addr = (dma_addr_t) (pdata->tx_dma_offset +
io_v2p(dev->base)); io_v2p(dev->base));
dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK] = &dma_data[count];
/* first TX, then RX */ /* first TX, then RX */
res = platform_get_resource(pdev, IORESOURCE_DMA, 0); res = platform_get_resource(pdev, IORESOURCE_DMA, 0);
...@@ -910,13 +892,12 @@ static int davinci_mcasp_probe(struct platform_device *pdev) ...@@ -910,13 +892,12 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
goto err_release_region; goto err_release_region;
} }
dma_data[count].channel = res->start; dma_data->channel = res->start;
count++;
dma_data[count].name = "I2S PCM Stereo in"; dma_data = &dev->dma_params[SNDRV_PCM_STREAM_CAPTURE];
dma_data[count].eventq_no = pdata->eventq_no; dma_data->eventq_no = pdata->eventq_no;
dma_data[count].dma_addr = (dma_addr_t)(pdata->rx_dma_offset + dma_data->dma_addr = (dma_addr_t)(pdata->rx_dma_offset +
io_v2p(dev->base)); io_v2p(dev->base));
dev->dma_params[SNDRV_PCM_STREAM_CAPTURE] = &dma_data[count];
res = platform_get_resource(pdev, IORESOURCE_DMA, 1); res = platform_get_resource(pdev, IORESOURCE_DMA, 1);
if (!res) { if (!res) {
...@@ -924,7 +905,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev) ...@@ -924,7 +905,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
goto err_release_region; goto err_release_region;
} }
dma_data[count].channel = res->start; dma_data->channel = res->start;
davinci_mcasp_dai[pdata->op_mode].private_data = dev; davinci_mcasp_dai[pdata->op_mode].private_data = dev;
davinci_mcasp_dai[pdata->op_mode].dev = &pdev->dev; davinci_mcasp_dai[pdata->op_mode].dev = &pdev->dev;
ret = snd_soc_register_dai(&davinci_mcasp_dai[pdata->op_mode]); ret = snd_soc_register_dai(&davinci_mcasp_dai[pdata->op_mode]);
...@@ -936,8 +917,6 @@ static int davinci_mcasp_probe(struct platform_device *pdev) ...@@ -936,8 +917,6 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
err_release_region: err_release_region:
release_mem_region(mem->start, (mem->end - mem->start) + 1); release_mem_region(mem->start, (mem->end - mem->start) + 1);
err_release_data: err_release_data:
kfree(dma_data);
err_release_dev:
kfree(dev); kfree(dev);
return ret; return ret;
...@@ -946,7 +925,6 @@ static int davinci_mcasp_probe(struct platform_device *pdev) ...@@ -946,7 +925,6 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
static int davinci_mcasp_remove(struct platform_device *pdev) static int davinci_mcasp_remove(struct platform_device *pdev)
{ {
struct snd_platform_data *pdata = pdev->dev.platform_data; struct snd_platform_data *pdata = pdev->dev.platform_data;
struct davinci_pcm_dma_params *dma_data;
struct davinci_audio_dev *dev; struct davinci_audio_dev *dev;
struct resource *mem; struct resource *mem;
...@@ -959,8 +937,6 @@ static int davinci_mcasp_remove(struct platform_device *pdev) ...@@ -959,8 +937,6 @@ static int davinci_mcasp_remove(struct platform_device *pdev)
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
release_mem_region(mem->start, (mem->end - mem->start) + 1); release_mem_region(mem->start, (mem->end - mem->start) + 1);
dma_data = dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK];
kfree(dma_data);
kfree(dev); kfree(dev);
return 0; return 0;
......
...@@ -39,10 +39,15 @@ enum { ...@@ -39,10 +39,15 @@ enum {
}; };
struct davinci_audio_dev { struct davinci_audio_dev {
/*
* dma_params must be first because rtd->dai->cpu_dai->private_data
* is cast to a pointer of an array of struct davinci_pcm_dma_params in
* davinci_pcm_open.
*/
struct davinci_pcm_dma_params dma_params[2];
void __iomem *base; void __iomem *base;
int sample_rate; int sample_rate;
struct clk *clk; struct clk *clk;
struct davinci_pcm_dma_params *dma_params[2];
unsigned int codec_fmt; unsigned int codec_fmt;
/* McASP specific data */ /* McASP specific data */
......
...@@ -126,16 +126,9 @@ static void davinci_pcm_dma_irq(unsigned lch, u16 ch_status, void *data) ...@@ -126,16 +126,9 @@ static void davinci_pcm_dma_irq(unsigned lch, u16 ch_status, void *data)
static int davinci_pcm_dma_request(struct snd_pcm_substream *substream) static int davinci_pcm_dma_request(struct snd_pcm_substream *substream)
{ {
struct davinci_runtime_data *prtd = substream->runtime->private_data; struct davinci_runtime_data *prtd = substream->runtime->private_data;
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct davinci_pcm_dma_params *dma_data = rtd->dai->cpu_dai->dma_data;
struct edmacc_param p_ram; struct edmacc_param p_ram;
int ret; int ret;
if (!dma_data)
return -ENODEV;
prtd->params = dma_data;
/* Request master DMA channel */ /* Request master DMA channel */
ret = edma_alloc_channel(prtd->params->channel, ret = edma_alloc_channel(prtd->params->channel,
davinci_pcm_dma_irq, substream, davinci_pcm_dma_irq, substream,
...@@ -244,6 +237,11 @@ static int davinci_pcm_open(struct snd_pcm_substream *substream) ...@@ -244,6 +237,11 @@ static int davinci_pcm_open(struct snd_pcm_substream *substream)
struct snd_pcm_runtime *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
struct davinci_runtime_data *prtd; struct davinci_runtime_data *prtd;
int ret = 0; int ret = 0;
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct davinci_pcm_dma_params *pa = rtd->dai->cpu_dai->private_data;
struct davinci_pcm_dma_params *params = &pa[substream->stream];
if (!params)
return -ENODEV;
snd_soc_set_runtime_hwparams(substream, &davinci_pcm_hardware); snd_soc_set_runtime_hwparams(substream, &davinci_pcm_hardware);
/* ensure that buffer size is a multiple of period size */ /* ensure that buffer size is a multiple of period size */
...@@ -257,6 +255,7 @@ static int davinci_pcm_open(struct snd_pcm_substream *substream) ...@@ -257,6 +255,7 @@ static int davinci_pcm_open(struct snd_pcm_substream *substream)
return -ENOMEM; return -ENOMEM;
spin_lock_init(&prtd->lock); spin_lock_init(&prtd->lock);
prtd->params = params;
runtime->private_data = prtd; runtime->private_data = prtd;
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
struct davinci_pcm_dma_params { struct davinci_pcm_dma_params {
char *name; /* stream identifier */
int channel; /* sync dma channel ID */ int channel; /* sync dma channel ID */
unsigned short acnt; unsigned short acnt;
dma_addr_t dma_addr; /* device physical address for DMA */ dma_addr_t dma_addr; /* device physical address for DMA */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment