diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2014-12-30 09:10:32 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2014-12-30 11:44:11 -0500 |
commit | 5a1b8a80daa15e5b1920735133b80dd46975765f (patch) | |
tree | 4d8b61f14f8ab2a6d64a354c2acdb7a35499dcdb | |
parent | 97bf6af1f928216fd6c5a66e8a57bfa95a659672 (diff) |
ASoC: davinci-mcasp: Support for combined tx/rx interrupt line
Some SoC, like da850/OMAP-L138 uses one common interrupt request for TX/RX
events.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/davinci/davinci-mcasp.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c index 30b94d4f9c5d..95eef582331b 100644 --- a/sound/soc/davinci/davinci-mcasp.c +++ b/sound/soc/davinci/davinci-mcasp.c | |||
@@ -364,6 +364,20 @@ static irqreturn_t davinci_mcasp_rx_irq_handler(int irq, void *data) | |||
364 | return IRQ_RETVAL(handled_mask); | 364 | return IRQ_RETVAL(handled_mask); |
365 | } | 365 | } |
366 | 366 | ||
367 | static irqreturn_t davinci_mcasp_common_irq_handler(int irq, void *data) | ||
368 | { | ||
369 | struct davinci_mcasp *mcasp = (struct davinci_mcasp *)data; | ||
370 | irqreturn_t ret = IRQ_NONE; | ||
371 | |||
372 | if (mcasp->substreams[SNDRV_PCM_STREAM_PLAYBACK]) | ||
373 | ret = davinci_mcasp_tx_irq_handler(irq, data); | ||
374 | |||
375 | if (mcasp->substreams[SNDRV_PCM_STREAM_CAPTURE]) | ||
376 | ret |= davinci_mcasp_rx_irq_handler(irq, data); | ||
377 | |||
378 | return ret; | ||
379 | } | ||
380 | |||
367 | static int davinci_mcasp_set_dai_fmt(struct snd_soc_dai *cpu_dai, | 381 | static int davinci_mcasp_set_dai_fmt(struct snd_soc_dai *cpu_dai, |
368 | unsigned int fmt) | 382 | unsigned int fmt) |
369 | { | 383 | { |
@@ -1441,6 +1455,22 @@ static int davinci_mcasp_probe(struct platform_device *pdev) | |||
1441 | 1455 | ||
1442 | mcasp->dev = &pdev->dev; | 1456 | mcasp->dev = &pdev->dev; |
1443 | 1457 | ||
1458 | irq = platform_get_irq_byname(pdev, "common"); | ||
1459 | if (irq >= 0) { | ||
1460 | irq_name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%s_common\n", | ||
1461 | dev_name(&pdev->dev)); | ||
1462 | ret = devm_request_threaded_irq(&pdev->dev, irq, NULL, | ||
1463 | davinci_mcasp_common_irq_handler, | ||
1464 | IRQF_ONESHOT, irq_name, mcasp); | ||
1465 | if (ret) { | ||
1466 | dev_err(&pdev->dev, "common IRQ request failed\n"); | ||
1467 | goto err; | ||
1468 | } | ||
1469 | |||
1470 | mcasp->irq_request[SNDRV_PCM_STREAM_PLAYBACK] = XUNDRN; | ||
1471 | mcasp->irq_request[SNDRV_PCM_STREAM_CAPTURE] = ROVRN; | ||
1472 | } | ||
1473 | |||
1444 | irq = platform_get_irq_byname(pdev, "rx"); | 1474 | irq = platform_get_irq_byname(pdev, "rx"); |
1445 | if (irq >= 0) { | 1475 | if (irq >= 0) { |
1446 | irq_name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%s_rx\n", | 1476 | irq_name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%s_rx\n", |