diff options
Diffstat (limited to 'drivers/rtc/rtc-tps65910.c')
| -rw-r--r-- | drivers/rtc/rtc-tps65910.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/rtc/rtc-tps65910.c b/drivers/rtc/rtc-tps65910.c index 2e4894b4732..c81f14a3ed1 100644 --- a/drivers/rtc/rtc-tps65910.c +++ b/drivers/rtc/rtc-tps65910.c @@ -201,6 +201,12 @@ static irqreturn_t tps65910_rtc_interrupt(int irq, void *rtc) u32 rtc_reg; wake_lock_timeout(&rtc_wake_lock, msecs_to_jiffies(2000)); + + /* OLIO: The tps65910 manual states that this needs to be + * read twice, to get proper values. + */ + + ret = regmap_read(tps->regmap, TPS65910_RTC_STATUS, &rtc_reg); ret = regmap_read(tps->regmap, TPS65910_RTC_STATUS, &rtc_reg); if (ret) return IRQ_NONE; @@ -247,11 +253,11 @@ static int tps65910_rtc_probe(struct platform_device *pdev) /* Clear pending interrupts */ ret = regmap_read(tps65910->regmap, TPS65910_RTC_STATUS, &rtc_reg); if (ret < 0) - goto fail_end; + goto fail_end; ret = regmap_write(tps65910->regmap, TPS65910_RTC_STATUS, rtc_reg); if (ret < 0) - goto fail_end; + goto fail_end; dev_dbg(&pdev->dev, "Enabling rtc-tps65910.\n"); @@ -259,19 +265,19 @@ static int tps65910_rtc_probe(struct platform_device *pdev) ret = regmap_update_bits(tps65910->regmap, TPS65910_DEVCTRL, DEVCTRL_RTC_PWDN_MASK, 0 << DEVCTRL_RTC_PWDN_SHIFT); if (ret < 0) - goto fail_end; + goto fail_end; rtc_reg = TPS65910_RTC_CTRL_STOP_RTC; ret = regmap_write(tps65910->regmap, TPS65910_RTC_CTRL, rtc_reg); if (ret < 0) - goto fail_end; + goto fail_end; irq = platform_get_irq(pdev, 0); if (irq <= 0) { dev_warn(&pdev->dev, "Wake up is not possible as irq = %d\n", irq); - ret = -ENXIO; - goto fail_end; + ret = -ENXIO; + goto fail_end; } ret = devm_request_threaded_irq(&pdev->dev, irq, NULL, @@ -283,7 +289,7 @@ static int tps65910_rtc_probe(struct platform_device *pdev) } tps_rtc->irq = irq; - device_init_wakeup(&pdev->dev, 1); + device_init_wakeup(&pdev->dev, 1); tps_rtc->rtc = devm_rtc_device_register(&pdev->dev, pdev->name, &tps65910_rtc_ops, THIS_MODULE); |