};
#define MADERA_IRQ(_irq, _reg) \
- [MADERA_IRQ_ ## _irq] = { .reg_offset = (_reg) - MADERA_IRQ1_STATUS_2, \
+ [MADERA_IRQ_ ## _irq] = { .reg_offset = (_reg) - MADERA_IRQ1_STATUS_1, \
.mask = MADERA_ ## _irq ## _EINT1 }
static const struct regmap_irq madera_irqs[MADERA_NUM_IRQ] = {
MADERA_IRQ(DSP5_BUS_ERR, MADERA_IRQ1_STATUS_33),
MADERA_IRQ(DSP6_BUS_ERR, MADERA_IRQ1_STATUS_33),
MADERA_IRQ(DSP7_BUS_ERR, MADERA_IRQ1_STATUS_33),
+
+ MADERA_IRQ(BOOT_DONE, MADERA_IRQ1_STATUS_1),
};
static const struct regmap_irq_chip madera_irq = {
.name = "madera IRQ",
- .status_base = MADERA_IRQ1_STATUS_2,
- .mask_base = MADERA_IRQ1_MASK_2,
- .ack_base = MADERA_IRQ1_STATUS_2,
+ .status_base = MADERA_IRQ1_STATUS_1,
+ .mask_base = MADERA_IRQ1_MASK_1,
+ .ack_base = MADERA_IRQ1_STATUS_1,
.runtime_pm = true,
- .num_regs = 32,
+ .num_regs = 33,
.irqs = madera_irqs,
.num_irqs = ARRAY_SIZE(madera_irqs),
};
}
#endif
+static irqreturn_t madera_boot_done(int irq, void *data)
+{
+ struct madera *madera = data;
+
+ dev_warn(madera->dev, "BOOT_DONE\n");
+
+ return IRQ_HANDLED;
+}
+
static const struct dev_pm_ops madera_irq_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(madera_suspend, madera_resume)
SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(madera_suspend_noirq,
platform_set_drvdata(pdev, priv);
madera->irq_dev = priv->dev;
+ madera_request_irq(madera, MADERA_IRQ_BOOT_DONE, "BOOT_DONE",
+ madera_boot_done, madera);
+
return 0;
}
priv->madera->irq_dev = NULL;
+ madera_free_irq(priv->madera, MADERA_IRQ_BOOT_DONE, priv->madera);
+
regmap_del_irq_chip(priv->irq, priv->irq_data);
free_irq(priv->irq, priv);