mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-24 05:01:03 +02:00
ASoC: pxa: use pdev resource for FIFO regs
The driver currently takes the hardwired FIFO address from a header file that we want to eliminate. Change it to use the mmio resource instead and stop including the here. Acked-by: Mark Brown <broonie@kernel.org> Cc: alsa-devel@alsa-project.org Acked-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
@@ -21,10 +21,12 @@
|
|||||||
#include <sound/pxa2xx-lib.h>
|
#include <sound/pxa2xx-lib.h>
|
||||||
#include <sound/dmaengine_pcm.h>
|
#include <sound/dmaengine_pcm.h>
|
||||||
|
|
||||||
#include <mach/pxa-regs.h>
|
|
||||||
#include <mach/regs-ac97.h>
|
|
||||||
#include <linux/platform_data/asoc-pxa.h>
|
#include <linux/platform_data/asoc-pxa.h>
|
||||||
|
|
||||||
|
#define PCDR 0x0040 /* PCM FIFO Data Register */
|
||||||
|
#define MODR 0x0140 /* Modem FIFO Data Register */
|
||||||
|
#define MCDR 0x0060 /* Mic-in FIFO Data Register */
|
||||||
|
|
||||||
static void pxa2xx_ac97_warm_reset(struct ac97_controller *adrv)
|
static void pxa2xx_ac97_warm_reset(struct ac97_controller *adrv)
|
||||||
{
|
{
|
||||||
pxa2xx_ac97_try_warm_reset();
|
pxa2xx_ac97_try_warm_reset();
|
||||||
@@ -59,35 +61,30 @@ static struct ac97_controller_ops pxa2xx_ac97_ops = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_stereo_in = {
|
static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_stereo_in = {
|
||||||
.addr = __PREG(PCDR),
|
|
||||||
.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES,
|
.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES,
|
||||||
.chan_name = "pcm_pcm_stereo_in",
|
.chan_name = "pcm_pcm_stereo_in",
|
||||||
.maxburst = 32,
|
.maxburst = 32,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_stereo_out = {
|
static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_stereo_out = {
|
||||||
.addr = __PREG(PCDR),
|
|
||||||
.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES,
|
.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES,
|
||||||
.chan_name = "pcm_pcm_stereo_out",
|
.chan_name = "pcm_pcm_stereo_out",
|
||||||
.maxburst = 32,
|
.maxburst = 32,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_aux_mono_out = {
|
static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_aux_mono_out = {
|
||||||
.addr = __PREG(MODR),
|
|
||||||
.addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES,
|
.addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES,
|
||||||
.chan_name = "pcm_aux_mono_out",
|
.chan_name = "pcm_aux_mono_out",
|
||||||
.maxburst = 16,
|
.maxburst = 16,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_aux_mono_in = {
|
static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_aux_mono_in = {
|
||||||
.addr = __PREG(MODR),
|
|
||||||
.addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES,
|
.addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES,
|
||||||
.chan_name = "pcm_aux_mono_in",
|
.chan_name = "pcm_aux_mono_in",
|
||||||
.maxburst = 16,
|
.maxburst = 16,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_mic_mono_in = {
|
static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_mic_mono_in = {
|
||||||
.addr = __PREG(MCDR),
|
|
||||||
.addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES,
|
.addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES,
|
||||||
.chan_name = "pcm_aux_mic_mono",
|
.chan_name = "pcm_aux_mic_mono",
|
||||||
.maxburst = 16,
|
.maxburst = 16,
|
||||||
@@ -226,6 +223,7 @@ static int pxa2xx_ac97_dev_probe(struct platform_device *pdev)
|
|||||||
int ret;
|
int ret;
|
||||||
struct ac97_controller *ctrl;
|
struct ac97_controller *ctrl;
|
||||||
pxa2xx_audio_ops_t *pdata = pdev->dev.platform_data;
|
pxa2xx_audio_ops_t *pdata = pdev->dev.platform_data;
|
||||||
|
struct resource *regs;
|
||||||
void **codecs_pdata;
|
void **codecs_pdata;
|
||||||
|
|
||||||
if (pdev->id != -1) {
|
if (pdev->id != -1) {
|
||||||
@@ -233,6 +231,16 @@ static int pxa2xx_ac97_dev_probe(struct platform_device *pdev)
|
|||||||
return -ENXIO;
|
return -ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||||
|
if (!regs)
|
||||||
|
return -ENXIO;
|
||||||
|
|
||||||
|
pxa2xx_ac97_pcm_stereo_in.addr = regs->start + PCDR;
|
||||||
|
pxa2xx_ac97_pcm_stereo_out.addr = regs->start + PCDR;
|
||||||
|
pxa2xx_ac97_pcm_aux_mono_out.addr = regs->start + MODR;
|
||||||
|
pxa2xx_ac97_pcm_aux_mono_in.addr = regs->start + MODR;
|
||||||
|
pxa2xx_ac97_pcm_mic_mono_in.addr = regs->start + MCDR;
|
||||||
|
|
||||||
ret = pxa2xx_ac97_hw_probe(pdev);
|
ret = pxa2xx_ac97_hw_probe(pdev);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_err(&pdev->dev, "PXA2xx AC97 hw probe error (%d)\n", ret);
|
dev_err(&pdev->dev, "PXA2xx AC97 hw probe error (%d)\n", ret);
|
||||||
|
Reference in New Issue
Block a user