Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 39de4010 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "rtc: qpnp-rtc: Read ALARM_EN and update to alarm enabled status"

parents 2a381b66 0b0987b9
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012-2015, 2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2015, 2017-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -374,6 +374,15 @@ qpnp_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm)
				alarm->time.tm_sec, alarm->time.tm_mday,
				alarm->time.tm_mon, alarm->time.tm_year);

	rc = qpnp_read_wrapper(rtc_dd, value,
		rtc_dd->alarm_base + REG_OFFSET_ALARM_CTRL1, 1);
	if (rc) {
		dev_err(dev, "Read from ALARM CTRL1 failed\n");
		return rc;
	}

	alarm->enabled = !!(value[0] & BIT_RTC_ALARM_ENABLE);

	return 0;
}