Skip to content

Commit

Permalink
ASoC: samsung: use irq resource for idma
Browse files Browse the repository at this point in the history
With multiplatform kernels, we cannot use hardwired IRQ
numbers in device drivers. This changes the idma driver
to use a proper resource, like all other drivers do.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Arnd Bergmann authored and Mark Brown committed Apr 11, 2013
1 parent a7c1a64 commit cb00e3a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
6 changes: 6 additions & 0 deletions arch/arm/plat-samsung/devs.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,20 @@ struct platform_device s3c_device_camif = {

/* ASOC DMA */

#ifdef CONFIG_PLAT_S5P
static struct resource samsung_asoc_idma_resource = DEFINE_RES_IRQ(IRQ_I2S0);

struct platform_device samsung_asoc_idma = {
.name = "samsung-idma",
.id = -1,
.num_resources = 1,
.resource = &samsung_asoc_idma_resource,
.dev = {
.dma_mask = &samsung_device_dma_mask,
.coherent_dma_mask = DMA_BIT_MASK(32),
}
};
#endif

/* FB */

Expand Down
10 changes: 8 additions & 2 deletions sound/soc/samsung/idma.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ static struct idma_info {
dma_addr_t lp_tx_addr;
} idma;

static int idma_irq;

static void idma_getpos(dma_addr_t *src)
{
*src = idma.lp_tx_addr +
Expand Down Expand Up @@ -305,7 +307,7 @@ static int idma_open(struct snd_pcm_substream *substream)
if (prtd == NULL)
return -ENOMEM;

ret = request_irq(IRQ_I2S0, iis_irq, 0, "i2s", prtd);
ret = request_irq(idma_irq, iis_irq, 0, "i2s", prtd);
if (ret < 0) {
pr_err("fail to claim i2s irq , ret = %d\n", ret);
kfree(prtd);
Expand All @@ -324,7 +326,7 @@ static int idma_close(struct snd_pcm_substream *substream)
struct snd_pcm_runtime *runtime = substream->runtime;
struct idma_ctrl *prtd = runtime->private_data;

free_irq(IRQ_I2S0, prtd);
free_irq(idma_irq, prtd);

if (!prtd)
pr_err("idma_close called with prtd == NULL\n");
Expand Down Expand Up @@ -418,6 +420,10 @@ static struct snd_soc_platform_driver asoc_idma_platform = {

static int asoc_idma_platform_probe(struct platform_device *pdev)
{
idma_irq = platform_get_irq(pdev, 0);
if (idma_irq < 0)
return idma_irq;

return snd_soc_register_platform(&pdev->dev, &asoc_idma_platform);
}

Expand Down

0 comments on commit cb00e3a

Please sign in to comment.