Re: [PATCH 06/13] ASoC: amd: add acp6x irq handler

From: Joe Perches
Date: Mon Oct 11 2021 - 04:58:41 EST


On Mon, 2021-10-11 at 11:26 +0530, Vijendar Mukunda wrote:
> Add ACP6x irq handler for handling irq events for ACP IP.
> Add pdm irq events handling.
> Whenever audio data equal to the PDM watermark level are consumed,
> interrupt is generated. Acknowledge the interrupt.

> diff --git a/sound/soc/amd/yc/pci-acp6x.c b/sound/soc/amd/yc/pci-acp6x.c
[]
> @@ -116,6 +118,33 @@ static int acp6x_deinit(void __iomem *acp_base)
>   return 0;
>  }
>
> +static irqreturn_t acp6x_irq_handler(int irq, void *dev_id)
> +{
> + struct acp6x_dev_data *adata;
> + struct pdm_dev_data *yc_pdm_data;
> + u16 irq_flag;

irq_flag seems unnecessary.

> + u32 val;
> +
> + adata = dev_id;
> + if (!adata)
> + return IRQ_NONE;
> +
> + irq_flag = 0;
> + val = acp6x_readl(adata->acp6x_base + ACP_EXTERNAL_INTR_STAT);
> + if (val & BIT(PDM_DMA_STAT)) {
> + yc_pdm_data = dev_get_drvdata(&adata->pdev[0]->dev);
> + acp6x_writel(BIT(PDM_DMA_STAT), adata->acp6x_base + ACP_EXTERNAL_INTR_STAT);
> + if (yc_pdm_data->capture_stream)
> + snd_pcm_period_elapsed(yc_pdm_data->capture_stream);
> + irq_flag = 1;

Could be:

return IRQ_HANDLED;

> + }
> +
> + if (irq_flag)
> + return IRQ_HANDLED;
> + else
> + return IRQ_NONE;

and
return IRQ_NONE;

> +}