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

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


Functions

PMIC_STATUS pmic_batt_disable_eol (void)
PMIC_STATUS pmic_batt_set_out_control (t_control control)
PMIC_STATUS pmic_batt_set_threshold (int threshold)
PMIC_STATUS pmic_batt_led_control (bool on)
PMIC_STATUS pmic_batt_set_reverse_supply (bool enable)
PMIC_STATUS pmic_batt_set_unregulated (bool enable)
PMIC_STATUS pmic_batt_set_5k_pull (bool enable)
PMIC_STATUS mc13783_battery_event (t_batt_event event, void *callback, bool sub)
PMIC_STATUS pmic_batt_event_subscribe (t_batt_event event, void *callback)
PMIC_STATUS pmic_batt_event_unsubscribe (t_batt_event event, void *callback)
static int pmic_battery_ioctl (struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
static int pmic_battery_open (struct inode *inode, struct file *file)
static int pmic_battery_release (struct inode *inode, struct file *file)


Detailed Description

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


Function Documentation

PMIC_STATUS mc13783_battery_event ( t_batt_event  event,
void *  callback,
bool  sub 
)

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

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

PMIC_STATUS pmic_batt_disable_eol ( void   ) 

This function disables End-of-Life comparator.

Returns:
This function returns PMIC_SUCCESS if successful.

PMIC_STATUS pmic_batt_event_subscribe ( t_batt_event  event,
void *  callback 
)

This function is used to subscribe on battery event IT.

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

PMIC_STATUS pmic_batt_event_unsubscribe ( t_batt_event  event,
void *  callback 
)

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

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

PMIC_STATUS pmic_batt_led_control ( bool  on  ) 

This function controls charge LED.

Parameters:
on If on is ture, LED will be turned on, or otherwise, LED will be turned off.
Returns:
This function returns PMIC_SUCCESS if successful.

PMIC_STATUS pmic_batt_set_5k_pull ( bool  enable  ) 

This function sets a 5K pull down at CHRGRAW. To be used in the dual path charging configuration.

Parameters:
enable If enable is true, 5k pull down is enable, or otherwise, disabled.
Returns:
This function returns PMIC_SUCCESS if successful.

PMIC_STATUS pmic_batt_set_out_control ( t_control  control  ) 

This function sets the output controls. It sets the FETOVRD and FETCTRL bits of mc13783

Parameters:
control type of control.
Returns:
This function returns 0 if successful.

PMIC_STATUS pmic_batt_set_reverse_supply ( bool  enable  ) 

This function sets reverse supply mode.

Parameters:
enable If enable is ture, reverse supply mode is enable, or otherwise, reverse supply mode is disabled.
Returns:
This function returns PMIC_SUCCESS if successful.

PMIC_STATUS pmic_batt_set_threshold ( int  threshold  ) 

This function sets over voltage threshold.

Parameters:
threshold value of over voltage threshold.
Returns:
This function returns 0 if successful.

PMIC_STATUS pmic_batt_set_unregulated ( bool  enable  ) 

This function sets unregulatored charging mode on main battery.

Parameters:
enable If enable is ture, unregulated charging mode is enable, or otherwise, disabled.
Returns:
This function returns PMIC_SUCCESS if successful.

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

This function implements IOCTL controls on a PMIC Battery 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.

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

This function implements the open method on a Pmic battery device.

Parameters:
inode pointer on the node
file pointer on the file
Returns:
This function returns 0.

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

This function implements the release method on a Pmic battery device.

Parameters:
inode pointer on the node
file pointer on the file
Returns:
This function returns 0.

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