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

Commit f2b6aaf2 authored by c_xlin's avatar c_xlin
Browse files

qpnp-rtc.c : Generate the node wakealarm for RTC



If we execute function device_init_wakeup() after rtc_device_register()
It do not generate the wakealarm node at /sys/class/rtc/rtc0/, which is
used to set up wakealarm time.Because wakealarm node generates in function
rtc_device_register() and need device_init_wakeup() set the related flag 1,
the device_init_wakeup() must move before rtc_device_register().

Change-Id: I123770e3037bb51c0d0de5de6bcd5a1bd7780f91
Signed-off-by: default avatarc_xlin <xlin@codeaurora.org>
parent aa89b686
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
/* Copyright (c) 2012-2015,2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2015,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
@@ -593,7 +593,7 @@ static int qpnp_rtc_probe(struct spmi_device *spmi)
		qpnp_rtc_ops.set_time = qpnp_rtc_set_time;

	dev_set_drvdata(&spmi->dev, rtc_dd);

	device_init_wakeup(&spmi->dev, 1);
	/* Register the RTC device */
	rtc_dd->rtc = rtc_device_register("qpnp_rtc", &spmi->dev,
						&qpnp_rtc_ops, THIS_MODULE);
@@ -613,7 +613,6 @@ static int qpnp_rtc_probe(struct spmi_device *spmi)
		goto fail_req_irq;
	}

	device_init_wakeup(&spmi->dev, 1);
	enable_irq_wake(rtc_dd->rtc_alarm_irq);

	dev_dbg(&spmi->dev, "Probe success !!\n");
@@ -623,6 +622,7 @@ static int qpnp_rtc_probe(struct spmi_device *spmi)
fail_req_irq:
	rtc_device_unregister(rtc_dd->rtc);
fail_rtc_enable:
	device_init_wakeup(&spmi->dev, 0);
	dev_set_drvdata(&spmi->dev, NULL);

	return rc;