mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 04:12:04 -04:00
Merge "rtc-pm8xxx: Clear Alarm register on resume"
This commit is contained in:
commit
462ccc5bb6
1 changed files with 12 additions and 1 deletions
|
|
@ -1,5 +1,5 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/* Copyright (c) 2010-2011, 2019, The Linux Foundation. All rights reserved. */
|
||||
/* Copyright (c) 2010-2011, 2019-2020, The Linux Foundation. All rights reserved. */
|
||||
|
||||
#include <linux/of.h>
|
||||
#include <linux/module.h>
|
||||
|
|
@ -301,6 +301,7 @@ static int pm8xxx_rtc_alarm_irq_enable(struct device *dev, unsigned int enable)
|
|||
struct pm8xxx_rtc *rtc_dd = dev_get_drvdata(dev);
|
||||
const struct pm8xxx_rtc_regs *regs = rtc_dd->regs;
|
||||
unsigned int ctrl_reg;
|
||||
u8 value[NUM_8_BIT_RTC_REGS] = {0};
|
||||
|
||||
spin_lock_irqsave(&rtc_dd->ctrl_reg_lock, irq_flags);
|
||||
|
||||
|
|
@ -319,6 +320,16 @@ static int pm8xxx_rtc_alarm_irq_enable(struct device *dev, unsigned int enable)
|
|||
goto rtc_rw_fail;
|
||||
}
|
||||
|
||||
/* Clear Alarm register */
|
||||
if (!enable) {
|
||||
rc = regmap_bulk_write(rtc_dd->regmap, regs->alarm_rw, value,
|
||||
sizeof(value));
|
||||
if (rc) {
|
||||
dev_err(dev, "Write to RTC ALARM register failed\n");
|
||||
goto rtc_rw_fail;
|
||||
}
|
||||
}
|
||||
|
||||
rtc_rw_fail:
|
||||
spin_unlock_irqrestore(&rtc_dd->ctrl_reg_lock, irq_flags);
|
||||
return rc;
|
||||
|
|
|
|||
Loading…
Reference in a new issue