summaryrefslogtreecommitdiff
path: root/sound/soc/meson/axg-fifo.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/meson/axg-fifo.c')
-rw-r--r--sound/soc/meson/axg-fifo.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/sound/soc/meson/axg-fifo.c b/sound/soc/meson/axg-fifo.c
index bebee0ca8e38..75909196b769 100644
--- a/sound/soc/meson/axg-fifo.c
+++ b/sound/soc/meson/axg-fifo.c
@@ -23,7 +23,7 @@
* These differences are handled in the respective DAI drivers
*/
-static struct snd_pcm_hardware axg_fifo_hw = {
+static const struct snd_pcm_hardware axg_fifo_hw = {
.info = (SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID |
@@ -32,7 +32,7 @@ static struct snd_pcm_hardware axg_fifo_hw = {
SNDRV_PCM_INFO_NO_PERIOD_WAKEUP),
.formats = AXG_FIFO_FORMATS,
.rate_min = 5512,
- .rate_max = 384000,
+ .rate_max = 768000,
.channels_min = 1,
.channels_max = AXG_FIFO_CH_MAX,
.period_bytes_min = AXG_FIFO_BURST,
@@ -46,7 +46,7 @@ static struct snd_pcm_hardware axg_fifo_hw = {
static struct snd_soc_dai *axg_fifo_dai(struct snd_pcm_substream *ss)
{
- struct snd_soc_pcm_runtime *rtd = ss->private_data;
+ struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(ss);
return snd_soc_rtd_to_cpu(rtd, 0);
}
@@ -204,18 +204,19 @@ static irqreturn_t axg_fifo_pcm_irq_block(int irq, void *dev_id)
unsigned int status;
regmap_read(fifo->map, FIFO_STATUS1, &status);
-
status = FIELD_GET(STATUS1_INT_STS, status);
- if (status & FIFO_INT_COUNT_REPEAT)
- snd_pcm_period_elapsed(ss);
- else
+ axg_fifo_ack_irq(fifo, status);
+
+ if (status & ~FIFO_INT_COUNT_REPEAT)
dev_dbg(axg_fifo_dev(ss), "unexpected irq - STS 0x%02x\n",
status);
- /* Ack irqs */
- axg_fifo_ack_irq(fifo, status);
+ if (status & FIFO_INT_COUNT_REPEAT) {
+ snd_pcm_period_elapsed(ss);
+ return IRQ_HANDLED;
+ }
- return IRQ_RETVAL(status);
+ return IRQ_NONE;
}
int axg_fifo_pcm_open(struct snd_soc_component *component,
@@ -243,8 +244,10 @@ int axg_fifo_pcm_open(struct snd_soc_component *component,
if (ret)
return ret;
- ret = request_irq(fifo->irq, axg_fifo_pcm_irq_block, 0,
- dev_name(dev), ss);
+ /* Use the threaded irq handler only with non-atomic links */
+ ret = request_threaded_irq(fifo->irq, NULL,
+ axg_fifo_pcm_irq_block,
+ IRQF_ONESHOT, dev_name(dev), ss);
if (ret)
return ret;