I am using iMX6 to build a system based on Android Kit-Kat. On the system I have an external RTC chip which is powered by a separate battery. The external RTC chip does not have an interrupt line connected iMX. The external RTC chip is registered under /sys/class/rtc/rtc0.
I have also enabled the internal SRTC on iMX by enabling CONFIG_RTC_DRV_MXC_V2 to build the rtc-mxc_v2.o. The internal SRTC is under /proc/driver/rtc.
Two questions:
- When I have both an external RTC and SRTC on iMX enabled on the system, how do I synchronize the SRTC with the external RTC? The time will be kept on external RTC because it is powered by a separate battery so SRTC has to be synchronized with the external RTC.
- How do I configure Android so that when it needs to get time, it gets time from the external RTC; and when it needs to set an alarm to wake up the system in suspend, it sets the alarm using the SRTC on iMX not the external RTC?