linux/drivers/mxc/pmic/mc13783/pmic_rtc.c File Reference

This is the main file of PMIC(mc13783) RTC driver. More...

Functions

static void callback_alarm_asynchronous (void *)
static void callback_alarm_synchronous (void *)
static void callback_test_sub (void)
PMIC_STATUS pmic_rtc_wait_alarm (void)
PMIC_STATUS pmic_rtc_set_time (struct timeval *pmic_time)
PMIC_STATUS pmic_rtc_get_time (struct timeval *pmic_time)
PMIC_STATUS pmic_rtc_set_time_alarm (struct timeval *pmic_time)
PMIC_STATUS pmic_rtc_get_time_alarm (struct timeval *pmic_time)
PMIC_STATUS pmic_rtc_event (t_rtc_int event, void *callback, bool sub)
PMIC_STATUS pmic_rtc_event_sub (t_rtc_int event, void *callback)
PMIC_STATUS pmic_rtc_event_unsub (t_rtc_int event, void *callback)
static int pmic_rtc_ioctl (struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
static int pmic_rtc_open (struct inode *inode, struct file *file)
static int pmic_rtc_release (struct inode *inode, struct file *file)
static int pmic_rtc_suspend (struct platform_device *pdev, pm_message_t state)
static int pmic_rtc_resume (struct platform_device *pdev)

Variables

static struct file_operations pmic_rtc_fops

Detailed Description

This is the main file of PMIC(mc13783) RTC driver.


Function Documentation

static void callback_alarm_asynchronous ( void *  unused  )  [static]

This is the callback function called on TSI Pmic event, used in asynchronous call.

Referenced by pmic_rtc_ioctl().

static void callback_alarm_synchronous ( void *  unused  )  [static]

This is the callback function called on TSI Pmic event, used in synchronous call.

Referenced by pmic_rtc_wait_alarm().

static void callback_test_sub ( void   )  [static]

This is the callback function is used in test code for (un)sub.

Referenced by pmic_rtc_ioctl().

PMIC_STATUS pmic_rtc_event ( t_rtc_int  event,
void *  callback,
bool  sub 
)

This function is used to un/subscribe on RTC event IT.

Parameters:
event type of event.
callback event callback function.
sub define if Un/subscribe event.
Returns:
This function returns PMIC_SUCCESS if successful.

References pmic_event_callback_t::func, pmic_event_callback_t::param, pmic_event_subscribe(), and pmic_event_unsubscribe().

Referenced by pmic_rtc_event_sub(), and pmic_rtc_event_unsub().

PMIC_STATUS pmic_rtc_event_sub ( t_rtc_int  event,
void *  callback 
)

This function is used to subscribe on RTC event IT.

Parameters:
event type of event.
callback event callback function.
Returns:
This function returns PMIC_SUCCESS if successful.

References pmic_rtc_event().

Referenced by pmic_rtc_ioctl().

PMIC_STATUS pmic_rtc_event_unsub ( t_rtc_int  event,
void *  callback 
)

This function is used to un subscribe on RTC event IT.

Parameters:
event type of event.
callback event callback function.
Returns:
This function returns PMIC_SUCCESS if successful.

References pmic_rtc_event().

Referenced by pmic_rtc_ioctl().

PMIC_STATUS pmic_rtc_get_time ( struct timeval *  pmic_time  ) 

This function get the real time clock of PMIC

Parameters:
pmic_time return value of date and time
Returns:
This function returns PMIC_SUCCESS if successful.

References pmic_read_reg().

Referenced by pmic_rtc_ioctl().

PMIC_STATUS pmic_rtc_get_time_alarm ( struct timeval *  pmic_time  ) 

This function get the real time clock alarm of PMIC

Parameters:
pmic_time return value of date and time
Returns:
This function returns PMIC_SUCCESS if successful.

References pmic_read_reg().

Referenced by pmic_rtc_ioctl().

static int pmic_rtc_ioctl ( struct inode *  inode,
struct file *  file,
unsigned int  cmd,
unsigned long  arg 
) [static]

This function implements IOCTL controls on a PMIC RTC device.

Parameters:
inode pointer on the node
file pointer on the file
cmd the command
arg the parameter
Returns:
This function returns 0 if successful.

References callback_alarm_asynchronous(), callback_test_sub(), pmic_event_callback_t::func, pmic_event_callback_t::param, pmic_event_subscribe(), pmic_event_unsubscribe(), pmic_rtc_event_sub(), pmic_rtc_event_unsub(), pmic_rtc_get_time(), pmic_rtc_get_time_alarm(), pmic_rtc_set_time(), pmic_rtc_set_time_alarm(), and pmic_rtc_wait_alarm().

static int pmic_rtc_open ( struct inode *  inode,
struct file *  file 
) [static]

This function implements the open method on a PMIC RTC device.

Parameters:
inode pointer on the node
file pointer on the file
Returns:
This function returns 0.
static int pmic_rtc_release ( struct inode *  inode,
struct file *  file 
) [static]

This function implements the release method on a PMIC RTC device.

Parameters:
inode pointer on the node
file pointer on the file
Returns:
This function returns 0.
static int pmic_rtc_resume ( struct platform_device *  pdev  )  [static]

This function is called to resume the RTC from a low power state.

Parameters:
pdev the device structure used to give information on which RTC device (0 through 3 channels) to suspend
Returns:
The function always returns 0.
PMIC_STATUS pmic_rtc_set_time ( struct timeval *  pmic_time  ) 

This function set the real time clock of PMIC

Parameters:
pmic_time value of date and time
Returns:
This function returns PMIC_SUCCESS if successful.

References pmic_write_reg().

Referenced by pmic_rtc_ioctl().

PMIC_STATUS pmic_rtc_set_time_alarm ( struct timeval *  pmic_time  ) 

This function set the real time clock alarm of PMIC

Parameters:
pmic_time value of date and time
Returns:
This function returns PMIC_SUCCESS if successful.

References pmic_write_reg().

Referenced by pmic_rtc_ioctl().

static int pmic_rtc_suspend ( struct platform_device *  pdev,
pm_message_t  state 
) [static]

This function is called to put the RTC in a low power state. There is no need for power handlers for the RTC device. The RTC cannot be suspended.

Parameters:
pdev the device structure used to give information on which RTC device (0 through 3 channels) to suspend
state the power state the device is entering
Returns:
The function always returns 0.
PMIC_STATUS pmic_rtc_wait_alarm ( void   ) 

This function wait the Alarm event

Returns:
This function returns PMIC_SUCCESS if successful.

References callback_alarm_synchronous(), pmic_event_callback_t::func, pmic_event_callback_t::param, pmic_event_subscribe(), and pmic_event_unsubscribe().

Referenced by pmic_rtc_ioctl().


Variable Documentation

struct file_operations pmic_rtc_fops [static]
Initial value:
 {
        .owner = THIS_MODULE,
        .ioctl = pmic_rtc_ioctl,
        .poll = pmic_rtc_poll,
        .open = pmic_rtc_open,
        .release = pmic_rtc_release,
}

This structure contains pointers to the power management callback functions.

footer
©  Freescale Semiconductor, Inc., 2007.  All rights reserved.
Freescale Confidential Proprietary
NDA Required
doxygen