Real Time Clock interface. More...
Functions | |
static void | rtc_write_sync_lp (void __iomem *ioaddr) |
static int | rtc_update_alarm (struct device *dev, struct rtc_time *alrm) |
static irqreturn_t | mxc_rtc_interrupt (int irq, void *dev_id) |
static int | mxc_rtc_open (struct device *dev) |
static void | mxc_rtc_release (struct device *dev) |
static int | mxc_rtc_ioctl (struct device *dev, unsigned int cmd, unsigned long arg) |
static int | mxc_rtc_read_time (struct device *dev, struct rtc_time *tm) |
static int | mxc_rtc_set_time (struct device *dev, struct rtc_time *tm) |
static int | mxc_rtc_read_alarm (struct device *dev, struct rtc_wkalrm *alrm) |
static int | mxc_rtc_set_alarm (struct device *dev, struct rtc_wkalrm *alrm) |
static int | mxc_rtc_proc (struct device *dev, struct seq_file *seq) |
static int | mxc_rtc_probe (struct platform_device *pdev) |
static int | mxc_rtc_suspend (struct platform_device *pdev, pm_message_t state) |
static int | mxc_rtc_resume (struct platform_device *pdev) |
static int __init | mxc_rtc_init (void) |
static void __exit | mxc_rtc_exit (void) |
Variables | |
static struct rtc_class_ops | mxc_rtc_ops |
static struct platform_driver | mxc_rtc_driver |
Real Time Clock interface.
This file contains Real Time Clock interface for Linux.
static void __exit mxc_rtc_exit | ( | void | ) | [static] |
This function removes the /proc/driver/rtc file and un-registers the device RTC from the /dev/misc directory.
static int __init mxc_rtc_init | ( | void | ) | [static] |
This function creates the /proc/driver/rtc file and registers the device RTC in the /dev/misc directory. It also reads the RTC value from external source and setup the internal RTC properly.
static irqreturn_t mxc_rtc_interrupt | ( | int | irq, | |
void * | dev_id | |||
) | [static] |
This function is the RTC interrupt service routine.
irq | RTC IRQ number | |
dev_id | device ID which is not used |
References IRQ_HANDLED, and rtc_write_sync_lp().
Referenced by mxc_rtc_probe().
static int mxc_rtc_ioctl | ( | struct device * | dev, | |
unsigned int | cmd, | |||
unsigned long | arg | |||
) | [static] |
This function is used to support some ioctl calls directly. Other ioctl calls are supported indirectly through the arm/common/rtctime.c file.
cmd | ioctl command as defined in include/linux/rtc.h | |
arg | value for the ioctl command |
static int mxc_rtc_open | ( | struct device * | dev | ) | [static] |
This function is used to open the RTC driver.
static int mxc_rtc_probe | ( | struct platform_device * | pdev | ) | [static] |
MXC RTC Power management control
References mxc_rtc_interrupt().
static int mxc_rtc_proc | ( | struct device * | dev, | |
struct seq_file * | seq | |||
) | [static] |
This function is used to provide the content for the /proc/driver/rtc file.
seq | buffer to hold the information that the driver wants to write |
static int mxc_rtc_read_alarm | ( | struct device * | dev, | |
struct rtc_wkalrm * | alrm | |||
) | [static] |
This function reads the current alarm value into the passed in alrm argument. It updates the alrm's pending field value based on the whether an alarm interrupt occurs or not.
alrm | contains the RTC alarm value upon return |
static int mxc_rtc_read_time | ( | struct device * | dev, | |
struct rtc_time * | tm | |||
) | [static] |
This function reads the current RTC time into tm in Gregorian date.
tm | contains the RTC time value upon return |
static void mxc_rtc_release | ( | struct device * | dev | ) | [static] |
clear all interrupts and release the IRQ
static int mxc_rtc_resume | ( | struct platform_device * | pdev | ) | [static] |
This function is called to correct the system time based on the current MXC RTC time relative to the time delta saved during suspend.
pdev | not used |
static int mxc_rtc_set_alarm | ( | struct device * | dev, | |
struct rtc_wkalrm * | alrm | |||
) | [static] |
This function sets the RTC alarm based on passed in alrm.
alrm | the alarm value to be set in the RTC |
References rtc_update_alarm(), and rtc_write_sync_lp().
static int mxc_rtc_set_time | ( | struct device * | dev, | |
struct rtc_time * | tm | |||
) | [static] |
This function sets the internal RTC time based on tm in Gregorian date.
tm | the time value to be set in the RTC |
References rtc_write_sync_lp().
static int mxc_rtc_suspend | ( | struct platform_device * | pdev, | |
pm_message_t | state | |||
) | [static] |
This function is called to save the system time delta relative to the MXC RTC when enterring a low power state. This time delta is then used on resume to adjust the system time to account for time loss while suspended.
pdev | not used | |
state | Power state to enter. |
static int rtc_update_alarm | ( | struct device * | dev, | |
struct rtc_time * | alrm | |||
) | [static] |
This function updates the RTC alarm registers and then clears all the interrupt status bits.
alrm | the new alarm value to be updated in the RTC |
Referenced by mxc_rtc_set_alarm().
static void rtc_write_sync_lp | ( | void __iomem * | ioaddr | ) | [inline, static] |
This function does write synchronization for writes to the lp srtc block. To take care of the asynchronous CKIL clock, all writes from the IP domain will be synchronized to the CKIL domain.
Referenced by mxc_rtc_interrupt(), mxc_rtc_set_alarm(), and mxc_rtc_set_time().
struct platform_driver mxc_rtc_driver [static] |
{ .driver = { .name = "mxc_rtc", }, .probe = mxc_rtc_probe, .remove = __exit_p(mxc_rtc_remove), .suspend = mxc_rtc_suspend, .resume = mxc_rtc_resume, }
Contains pointers to the power management callback functions.
struct rtc_class_ops mxc_rtc_ops [static] |
{ .open = mxc_rtc_open, .release = mxc_rtc_release, .ioctl = mxc_rtc_ioctl, .read_time = mxc_rtc_read_time, .set_time = mxc_rtc_set_time, .read_alarm = mxc_rtc_read_alarm, .set_alarm = mxc_rtc_set_alarm, .proc = mxc_rtc_proc, .alarm_irq_enable = mxc_rtc_alarm_irq_enable, }
The RTC driver structure
© Freescale Semiconductor, Inc., 2007.
All rights reserved. Freescale Confidential Proprietary NDA Required |
![]() |