alarmtimer: Provide accessor to alarmtimer rtc device

The Android alarm interface provides a settime call that sets both
the alarmtimer RTC device and CLOCK_REALTIME to the same value.

Since there may be multiple rtc devices, provide a hook to access the
one the alarmtimer infrastructure is using.

Signed-off-by: John Stultz <john.stultz@linaro.org>
This commit is contained in:
John Stultz 2011-12-09 18:44:02 -08:00 committed by Colin Cross
parent 1b16062778
commit bec4ab42f9
2 changed files with 9 additions and 2 deletions

View File

@ -76,4 +76,11 @@ static inline int alarmtimer_callback_running(struct alarm *timer)
}
/* Provide way to access the rtc device being used by alarmtimers */
#ifdef CONFIG_RTC_CLASS
struct rtc_device *alarmtimer_get_rtcdev(void);
#else
#define alarmtimer_get_rtcdev() (0)
#endif
#endif

View File

@ -59,7 +59,7 @@ static DEFINE_SPINLOCK(rtcdev_lock);
* If one has not already been chosen, it checks to see if a
* functional rtc device is available.
*/
static struct rtc_device *alarmtimer_get_rtcdev(void)
struct rtc_device *alarmtimer_get_rtcdev(void)
{
unsigned long flags;
struct rtc_device *ret;
@ -115,7 +115,7 @@ static void alarmtimer_rtc_interface_remove(void)
class_interface_unregister(&alarmtimer_rtc_interface);
}
#else
static inline struct rtc_device *alarmtimer_get_rtcdev(void)
struct rtc_device *alarmtimer_get_rtcdev(void)
{
return NULL;
}