19 Apr
2015
19 Apr
'15
9:27 a.m.
At Fri, 17 Apr 2015 14:43:18 +0530, Vinod Koul wrote:
+irqreturn_t azx_interrupt(int irq, void *dev_id) +{
- struct hdac_bus *chip = dev_id;
- u32 status;
+#ifdef CONFIG_PM
- if (!pm_runtime_active(chip->dev))
return IRQ_NONE;
+#endif
- spin_lock(&chip->reg_lock);
- status = snd_hdac_chip_readl(chip, INTSTS);
- if (status == 0 || status == 0xffffffff) {
spin_unlock(&chip->reg_lock);
return IRQ_NONE;
- }
- spin_unlock(&chip->reg_lock);
- return IRQ_WAKE_THREAD;
+}
+irqreturn_t azx_threaded_handler(int irq, void *dev_id) +{
- struct hdac_bus *chip = dev_id;
- u32 status;
- unsigned long cookie;
- status = snd_hdac_chip_readl(chip, INTSTS);
- spin_lock_irqsave(&chip->reg_lock, cookie);
- snd_hdac_bus_handle_stream_irq(chip, status, &azx_position_check);
- /* clear rirb int */
- status = snd_hdac_chip_readb(chip, RIRBSTS);
- if (status & RIRB_INT_MASK) {
if (status & RIRB_INT_RESPONSE)
snd_hdac_bus_update_rirb(chip);
snd_hdac_chip_writeb(chip, RIRBSTS, RIRB_INT_MASK);
- }
- spin_unlock_irqrestore(&chip->reg_lock, cookie);
- return IRQ_HANDLED;
+}
BTW, you don't need to use a threaded irq for this task. Unlike DSP driver, the PCM and CORB/RIRB irq doesn't need a long time to handle.
Takashi