summaryrefslogtreecommitdiff
path: root/drivers/rtc/rtc-tps65910.c
diff options
context:
space:
mode:
authormattis fjallstrom <mattis@acm.org>2016-04-28 19:54:36 -0700
committermattis fjallstrom <mattis@acm.org>2016-04-28 19:55:30 -0700
commit104bd36ed2d86c77a2d6949d3957a6c014c70f72 (patch)
treeba0f71798333cb197daf97a274f8186eb4798aa1 /drivers/rtc/rtc-tps65910.c
parente165e8cc62e787316ebf36322481b64312c37e0b (diff)
downloadolio-linux-3.10-104bd36ed2d86c77a2d6949d3957a6c014c70f72.tar.xz
olio-linux-3.10-104bd36ed2d86c77a2d6949d3957a6c014c70f72.zip
Removing code that enabled/disabled interrupts as a result of power management notifications, fixing pinmux and reading status register twice (per tps69510 TRM).
Change-Id: Idaac043ebe18229333bb7c090865e9ca3804f189
Diffstat (limited to 'drivers/rtc/rtc-tps65910.c')
-rw-r--r--drivers/rtc/rtc-tps65910.c20
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);