}
#else
-#define omap_rtc_ioctl NULL
+#define twl4030_rtc_ioctl NULL
#endif
static irqreturn_t twl4030_rtc_interrupt(int irq, void *rtc)
int res;
u8 rd_reg;
+#ifdef CONFIG_LOCKDEP
+ /* WORKAROUND for lockdep forcing IRQF_DISABLED on us, which
+ * we don't want and can't tolerate. Although it might be
+ * friendlier not to borrow this thread context...
+ */
+ local_irq_enable();
+#endif
+
res = twl4030_rtc_read_u8(&rd_reg, REG_RTC_STATUS_REG);
if (res)
goto out;
goto out1;
ret = request_irq(irq, twl4030_rtc_interrupt,
- 0, rtc->dev.bus_id, rtc);
+ IRQF_TRIGGER_RISING,
+ rtc->dev.bus_id, rtc);
if (ret < 0) {
dev_err(&pdev->dev, "IRQ is not free.\n");
goto out1;
goto out2;
}
- /* FIXME stop touching MODULE_INT registers; there's already
- * driver code responsible for them.
- */
-
- /* use rising edge detection for RTC alarm */
- ret = twl4030_i2c_read_u8(TWL4030_MODULE_INT,
- &rd_reg, TWL4030_INT_PWR_EDR1);
- if (ret < 0)
- goto out2;
-
- rd_reg |= BIT(3);
- ret = twl4030_i2c_write_u8(TWL4030_MODULE_INT,
- rd_reg, TWL4030_INT_PWR_EDR1);
- if (ret < 0)
- goto out2;
-
/* init cached IRQ enable bits */
ret = twl4030_rtc_read_u8(&rtc_irq_bits, REG_RTC_INTERRUPTS_REG);
if (ret < 0)
static void twl4030_rtc_shutdown(struct platform_device *pdev)
{
- mask_rtc_irq_bit(BIT_RTC_INTERRUPTS_REG_IT_TIMER_M |
- BIT_RTC_INTERRUPTS_REG_IT_ALARM_M);
+ /* mask timer interrupts, but leave alarm interrupts on to enable
+ power-on when alarm is triggered */
+ mask_rtc_irq_bit(BIT_RTC_INTERRUPTS_REG_IT_TIMER_M);
}
#ifdef CONFIG_PM