Skip to content

Commit

Permalink
alarmtimer: Provide accessor to alarmtimer rtc device
Browse files Browse the repository at this point in the history
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.

CC: Colin Cross <ccross@android.com>
CC: Thomas Gleixner <tglx@linutronix.de>
CC: Android Kernel Team <kernel-team@android.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
John Stultz authored and Greg Kroah-Hartman committed Apr 20, 2012
1 parent e2d8cce commit 57c498f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions include/linux/alarmtimer.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,7 @@ static inline int alarmtimer_callback_running(struct alarm *timer)
}


/* Provide way to access the rtc device being used by alarmtimers */
struct rtc_device *alarmtimer_get_rtcdev(void);

#endif
4 changes: 2 additions & 2 deletions kernel/time/alarmtimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 57c498f

Please sign in to comment.