diff mbox series

[3/3] rtc: pcf2127: reset alarm interrupt at power on

Message ID 20200607170610.24534-4-liambeguin@gmail.com
State Changes Requested
Headers show
Series rtc: pcf2127: add alarm support | expand

Commit Message

Liam Beguin June 7, 2020, 5:06 p.m. UTC
From: Liam Beguin <lvb@xiphos.com>

From: Liam Beguin <lvb@xiphos.com>

Signed-off-by: Liam Beguin <lvb@xiphos.com>
---
 drivers/rtc/rtc-pcf2127.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Alexandre Belloni June 9, 2020, 9:07 p.m. UTC | #1
On 07/06/2020 13:06:10-0400, liambeguin@gmail.com wrote:
> From: Liam Beguin <lvb@xiphos.com>
> 
> From: Liam Beguin <lvb@xiphos.com>

Always include a commit message.

> 
> Signed-off-by: Liam Beguin <lvb@xiphos.com>
> ---
>  drivers/rtc/rtc-pcf2127.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/rtc/rtc-pcf2127.c b/drivers/rtc/rtc-pcf2127.c
> index 3eeb085a7c72..f004a4030970 100644
> --- a/drivers/rtc/rtc-pcf2127.c
> +++ b/drivers/rtc/rtc-pcf2127.c
> @@ -546,6 +546,14 @@ static int pcf2127_probe(struct device *dev, struct regmap *regmap,
>  
>  	pcf2127->rtc->ops = &pcf2127_rtc_ops;
>  
> +	ret = regmap_update_bits(pcf2127->regmap, PCF2127_REG_CTRL2,
> +				 PCF2127_BIT_CTRL2_AIE, 0);
> +	if (ret) {
> +		dev_err(dev, "%s: failed to clear interrupt enable bit (%d)",
> +			__func__, ret);
> +		return ret;
> +	}
> +

The driver simply must not do that or alarms will be missed.
diff mbox series

Patch

diff --git a/drivers/rtc/rtc-pcf2127.c b/drivers/rtc/rtc-pcf2127.c
index 3eeb085a7c72..f004a4030970 100644
--- a/drivers/rtc/rtc-pcf2127.c
+++ b/drivers/rtc/rtc-pcf2127.c
@@ -546,6 +546,14 @@  static int pcf2127_probe(struct device *dev, struct regmap *regmap,
 
 	pcf2127->rtc->ops = &pcf2127_rtc_ops;
 
+	ret = regmap_update_bits(pcf2127->regmap, PCF2127_REG_CTRL2,
+				 PCF2127_BIT_CTRL2_AIE, 0);
+	if (ret) {
+		dev_err(dev, "%s: failed to clear interrupt enable bit (%d)",
+			__func__, ret);
+		return ret;
+	}
+
 	device_init_wakeup(dev, true);
 
 	pcf2127->wdd.parent = dev;