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

Commit 0b145f91 authored by Steve Muckle's avatar Steve Muckle
Browse files

ANDROID: rtc: class: support hctosys from modular RTC drivers



In order to support setting the system time from modular RTC drivers
via the hctosys mechanism, check at the end of RTC device registration
for whether the time should be synced, rather than once at late init.

Bug: 144103362
Bug: 143046457
Change-Id: I65d2fd14e075a65f2a23e1268b02c907c5245fb8
Signed-off-by: default avatarSteve Muckle <smuckle@google.com>
parent b50d9aa3
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -527,6 +527,11 @@ int __rtc_register_device(struct module *owner, struct rtc_device *rtc)
	dev_info(rtc->dev.parent, "registered as %s\n",
		 dev_name(&rtc->dev));

#ifdef CONFIG_RTC_HCTOSYS_DEVICE
	if (!strcmp(dev_name(&rtc->dev), CONFIG_RTC_HCTOSYS_DEVICE))
		rtc_hctosys();
#endif

	return 0;
}
EXPORT_SYMBOL_GPL(__rtc_register_device);
+1 −3
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@
 * the best guess is to add 0.5s.
 */

static int __init rtc_hctosys(void)
int rtc_hctosys(void)
{
	int err = -ENODEV;
	struct rtc_time tm;
@@ -73,5 +73,3 @@ static int __init rtc_hctosys(void)

	return err;
}

late_initcall(rtc_hctosys);
+4 −0
Original line number Diff line number Diff line
@@ -60,3 +60,7 @@ int rtc_add_groups(struct rtc_device *rtc, const struct attribute_group **grps)
	return 0;
}
#endif

#ifdef CONFIG_RTC_HCTOSYS
extern int rtc_hctosys(void);
#endif