This is the main file of PMIC(mc13783) Battery driver. More...
Functions | |
static void | callback_chg_detect (void) |
static int | pmic_battery_suspend (struct platform_device *pdev, pm_message_t state) |
static int | pmic_battery_resume (struct platform_device *pdev) |
PMIC_STATUS | pmic_batt_enable_charger (t_batt_charger chgr, unsigned char c_voltage, unsigned char c_current) |
PMIC_STATUS | pmic_batt_disable_charger (t_batt_charger chgr) |
PMIC_STATUS | pmic_batt_set_charger (t_batt_charger chgr, unsigned char c_voltage, unsigned char c_current) |
PMIC_STATUS | pmic_batt_get_charger_setting (t_batt_charger chgr, unsigned char *c_voltage, unsigned char *c_current) |
PMIC_STATUS | pmic_batt_get_batt_voltage (unsigned short *b_voltage) |
PMIC_STATUS | pmic_batt_get_batt_current (unsigned short *b_current) |
PMIC_STATUS | pmic_batt_get_batt_temperature (unsigned short *b_temper) |
PMIC_STATUS | pmic_batt_get_charge_voltage (unsigned short *c_voltage) |
PMIC_STATUS | pmic_batt_get_charge_current (unsigned short *c_current) |
PMIC_STATUS | pmic_batt_enable_eol (unsigned char threshold) |
Variables | |
static int | swait |
static int | suspend_flag |
static wait_queue_head_t | suspendq |
This is the main file of PMIC(mc13783) Battery driver.
static void callback_chg_detect | ( | void | ) | [static] |
Callback function for events, we want on MGN board
References pmic_get_sensors().
PMIC_STATUS pmic_batt_disable_charger | ( | t_batt_charger | chgr | ) |
This function turns off a charger.
chgr | Charger as defined in t_batt_charger. |
References pmic_write_reg(), and suspend_flag.
PMIC_STATUS pmic_batt_enable_charger | ( | t_batt_charger | chgr, | |
unsigned char | c_voltage, | |||
unsigned char | c_current | |||
) |
This function is used to start charging a battery. For different charger, different voltage and current range are supported.
chgr | Charger as defined in t_batt_charger. | |
c_voltage | Charging voltage. | |
c_current | Charging current. |
References pmic_write_reg(), and suspend_flag.
PMIC_STATUS pmic_batt_enable_eol | ( | unsigned char | threshold | ) |
This function enables End-of-Life comparator. Not supported on mc13783. Use pmic_batt_bp_enable_eol function.
threshold | End-of-Life threshold. |
PMIC_STATUS pmic_batt_get_batt_current | ( | unsigned short * | b_current | ) |
This function is retrives the main battery current.
b_current | Output parameter for current setting. |
References pmic_adc_convert(), and suspend_flag.
PMIC_STATUS pmic_batt_get_batt_temperature | ( | unsigned short * | b_temper | ) |
This function is retrives the main battery temperature.
b_temper | Output parameter for temperature setting. |
References pmic_adc_convert(), and suspend_flag.
PMIC_STATUS pmic_batt_get_batt_voltage | ( | unsigned short * | b_voltage | ) |
This function is retrives the main battery voltage.
b_voltage | Output parameter for voltage setting. |
References pmic_adc_convert(), and suspend_flag.
PMIC_STATUS pmic_batt_get_charge_current | ( | unsigned short * | c_current | ) |
This function is retrives the main battery charging current.
c_current | Output parameter for charging current setting. |
References pmic_adc_convert(), and suspend_flag.
PMIC_STATUS pmic_batt_get_charge_voltage | ( | unsigned short * | c_voltage | ) |
This function is retrives the main battery charging voltage.
c_voltage | Output parameter for charging voltage setting. |
References pmic_adc_convert(), and suspend_flag.
PMIC_STATUS pmic_batt_get_charger_setting | ( | t_batt_charger | chgr, | |
unsigned char * | c_voltage, | |||
unsigned char * | c_current | |||
) |
This function is used to retrive the charger setting.
chgr | Charger as defined in t_batt_charger. | |
c_voltage | Output parameter for charging voltage setting. | |
c_current | Output parameter for charging current setting. |
References pmic_read_reg(), and suspend_flag.
PMIC_STATUS pmic_batt_set_charger | ( | t_batt_charger | chgr, | |
unsigned char | c_voltage, | |||
unsigned char | c_current | |||
) |
This function is used to change the charger setting.
chgr | Charger as defined in t_batt_charger. | |
c_voltage | Charging voltage. | |
c_current | Charging current. |
References pmic_write_reg(), and suspend_flag.
static int pmic_battery_resume | ( | struct platform_device * | pdev | ) | [static] |
This is the resume of power management for the pmic battery API. It suports RESTORE state.
pdev | the device |
References suspend_flag, suspendq, and swait.
static int pmic_battery_suspend | ( | struct platform_device * | pdev, | |
pm_message_t | state | |||
) | [static] |
This is the suspend of power management for the pmic battery API. It suports SAVE and POWER_DOWN state.
pdev | the device | |
state | the state |
References pmic_write_reg(), and suspend_flag.
int suspend_flag [static] |
To indicate whether any of the battery devices are suspending
Referenced by pmic_batt_disable_charger(), pmic_batt_enable_charger(), pmic_batt_get_batt_current(), pmic_batt_get_batt_temperature(), pmic_batt_get_batt_voltage(), pmic_batt_get_charge_current(), pmic_batt_get_charge_voltage(), pmic_batt_get_charger_setting(), pmic_batt_set_charger(), pmic_battery_resume(), and pmic_battery_suspend().
wait_queue_head_t suspendq [static] |
The suspendq is used to block application calls
Referenced by pmic_battery_resume().
int swait [static] |
Number of users waiting in suspendq
Referenced by pmic_battery_resume().
© Freescale Semiconductor, Inc., 2007.
All rights reserved. Freescale Confidential Proprietary NDA Required |
![]() |