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

Commit 939eed97 authored by Mohit Aggarwal's avatar Mohit Aggarwal
Browse files

rtc: qpnp-rtc: Set alarm control register properly



RTC Alarm enable bit does not get conserved during
RTC probe function. This patch fixes that issue.

Change-Id: I28203b8e301510d34d2e726c0bd25e78737f7524
CRs-Fixed: 636652
Signed-off-by: default avatarMohit Aggarwal <maggarwa@codeaurora.org>
parent 47d53bf2
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -563,8 +563,15 @@ static int qpnp_rtc_probe(struct spmi_device *spmi)
		goto fail_rtc_enable;
	}

	rc = qpnp_read_wrapper(rtc_dd, &rtc_dd->alarm_ctrl_reg1,
				rtc_dd->alarm_base + REG_OFFSET_ALARM_CTRL1, 1);
	if (rc) {
		dev_err(&spmi->dev,
			"Read from  Alarm control reg failed\n");
		goto fail_rtc_enable;
	}
	/* Enable abort enable feature */
	rtc_dd->alarm_ctrl_reg1 = BIT_RTC_ABORT_ENABLE;
	rtc_dd->alarm_ctrl_reg1 |= BIT_RTC_ABORT_ENABLE;
	rc = qpnp_write_wrapper(rtc_dd, &rtc_dd->alarm_ctrl_reg1,
			rtc_dd->alarm_base + REG_OFFSET_ALARM_CTRL1, 1);
	if (rc) {