This is the main file of PMIC(mc13783) Power driver. More...
Functions | |
static int | pmic_power_suspend (struct platform_device *pdev, pm_message_t state) |
static int | pmic_power_resume (struct platform_device *pdev) |
void | pmic_power_off (void) |
PMIC_STATUS | pmic_power_set_pc_config (t_pc_config *pc_config) |
PMIC_STATUS | pmic_power_get_pc_config (t_pc_config *pc_config) |
PMIC_STATUS | pmic_power_regulator_on (t_pmic_regulator regulator) |
PMIC_STATUS | pmic_power_regulator_off (t_pmic_regulator regulator) |
PMIC_STATUS | pmic_power_regulator_set_voltage (t_pmic_regulator regulator, t_regulator_voltage voltage) |
PMIC_STATUS | pmic_power_regulator_get_voltage (t_pmic_regulator regulator, t_regulator_voltage *voltage) |
PMIC_STATUS | pmic_power_switcher_set_dvs (t_pmic_regulator regulator, t_regulator_voltage dvs) |
PMIC_STATUS | pmic_power_switcher_get_dvs (t_pmic_regulator regulator, t_regulator_voltage *dvs) |
PMIC_STATUS | pmic_power_switcher_set_stby (t_pmic_regulator regulator, t_regulator_voltage stby) |
PMIC_STATUS | pmic_power_switcher_get_stby (t_pmic_regulator regulator, t_regulator_voltage *stby) |
PMIC_STATUS | pmic_power_switcher_set_mode (t_pmic_regulator regulator, t_regulator_sw_mode mode, bool stby) |
PMIC_STATUS | pmic_power_switcher_get_mode (t_pmic_regulator regulator, t_regulator_sw_mode *mode, bool stby) |
PMIC_STATUS | pmic_power_switcher_set_dvs_speed (t_pmic_regulator regulator, t_switcher_dvs_speed speed) |
PMIC_STATUS | pmic_power_switcher_get_dvs_speed (t_pmic_regulator regulator, t_switcher_dvs_speed *speed) |
PMIC_STATUS | pmic_power_switcher_set_panic_mode (t_pmic_regulator regulator, bool panic_mode) |
PMIC_STATUS | pmic_power_switcher_get_panic_mode (t_pmic_regulator regulator, bool *panic_mode) |
PMIC_STATUS | pmic_power_switcher_set_softstart (t_pmic_regulator regulator, bool softstart) |
PMIC_STATUS | pmic_power_switcher_get_softstart (t_pmic_regulator regulator, bool *softstart) |
PMIC_STATUS | pmic_power_switcher_set_factor (t_pmic_regulator regulator, t_switcher_factor factor) |
PMIC_STATUS | pmic_power_switcher_get_factor (t_pmic_regulator regulator, t_switcher_factor *factor) |
PMIC_STATUS | pmic_power_regulator_set_lp_mode (t_pmic_regulator regulator, t_regulator_lp_mode lp_mode) |
PMIC_STATUS | pmic_power_regulator_get_lp_mode (t_pmic_regulator regulator, t_regulator_lp_mode *lp_mode) |
PMIC_STATUS | pmic_power_regulator_set_config (t_pmic_regulator regulator, t_regulator_config *config) |
PMIC_STATUS | pmic_power_regulator_get_config (t_pmic_regulator regulator, t_regulator_config *config) |
PMIC_STATUS | pmic_power_vbkup2_auto_en (bool en) |
PMIC_STATUS | pmic_power_get_vbkup2_auto_state (bool *en) |
PMIC_STATUS | pmic_power_bat_det_en (bool en) |
PMIC_STATUS | pmic_power_get_bat_det_state (bool *en) |
PMIC_STATUS | pmic_power_vib_pin_en (bool en) |
PMIC_STATUS | pmic_power_gets_vib_pin_state (bool *en) |
PMIC_STATUS | pmic_power_get_power_mode_sense (struct t_p_up_sense *p_up_sense) |
PMIC_STATUS | pmic_power_set_regen_assig (t_pmic_regulator regulator, bool en_dis) |
PMIC_STATUS | pmic_power_get_regen_assig (t_pmic_regulator regulator, bool *en_dis) |
PMIC_STATUS | pmic_power_set_regen_inv (bool en_dis) |
PMIC_STATUS | pmic_power_get_regen_inv (bool *en_dis) |
PMIC_STATUS | pmic_power_esim_v_en (bool vesim, bool vmmc1, bool vmmc2) |
PMIC_STATUS | pmic_power_gets_esim_v_state (bool *vesim, bool *vmmc1, bool *vmmc2) |
PMIC_STATUS | pmic_power_set_auto_reset_en (bool en) |
PMIC_STATUS | pmic_power_get_auto_reset_en (bool *en) |
PMIC_STATUS | pmic_power_set_conf_button (t_button bt, bool sys_rst, int deb_time) |
PMIC_STATUS | pmic_power_get_conf_button (t_button bt, bool *sys_rst, int *deb_time) |
PMIC_STATUS | pmic_power_event (t_pwr_int event, void *callback, bool sub) |
PMIC_STATUS | pmic_power_event_sub (t_pwr_int event, void *callback) |
PMIC_STATUS | pmic_power_event_unsub (t_pwr_int event, void *callback) |
This is the main file of PMIC(mc13783) Power driver.
PMIC_STATUS pmic_power_bat_det_en | ( | bool | en | ) |
This function enables battery detect function. Only on mc13783 2.0 or higher
en | if true, enable BATTDETEN |
References pmic_get_version(), pmic_write_reg(), and pmic_version_t::revision.
PMIC_STATUS pmic_power_esim_v_en | ( | bool | vesim, | |
bool | vmmc1, | |||
bool | vmmc2 | |||
) |
This function enables esim control voltage. Only on mc13783 2.0 or higher
vesim | if true, enable VESIMESIMEN | |
vmmc1 | if true, enable VMMC1ESIMEN | |
vmmc2 | if true, enable VMMC2ESIMEN |
References pmic_get_version(), pmic_write_reg(), and pmic_version_t::revision.
PMIC_STATUS pmic_power_event | ( | t_pwr_int | event, | |
void * | callback, | |||
bool | sub | |||
) |
This function is used to un/subscribe on power event IT.
event | type of event. | |
callback | event callback function. | |
sub | define if Un/subscribe event. |
References pmic_event_callback_t::func, pmic_event_callback_t::param, pmic_event_subscribe(), and pmic_event_unsubscribe().
Referenced by pmic_power_event_sub(), and pmic_power_event_unsub().
PMIC_STATUS pmic_power_event_sub | ( | t_pwr_int | event, | |
void * | callback | |||
) |
This function is used to subscribe on power event IT.
event | type of event. | |
callback | event callback function. |
References pmic_power_event().
PMIC_STATUS pmic_power_event_unsub | ( | t_pwr_int | event, | |
void * | callback | |||
) |
This function is used to un subscribe on power event IT.
event | type of event. | |
callback | event callback function. |
References pmic_power_event().
PMIC_STATUS pmic_power_get_auto_reset_en | ( | bool * | en | ) |
This function gets auto reset configuration.
en | if true, the auto reset is enabled |
References pmic_read_reg().
PMIC_STATUS pmic_power_get_bat_det_state | ( | bool * | en | ) |
This function gets state of battery detect function. Only on mc13783 2.0 or higher
en | if true, BATTDETEN is enabled |
References pmic_get_version(), pmic_read_reg(), and pmic_version_t::revision.
PMIC_STATUS pmic_power_get_conf_button | ( | t_button | bt, | |
bool * | sys_rst, | |||
int * | deb_time | |||
) |
This function gets configuration of a button.
bt | type of button. | |
sys_rst | if true, the system reset is enabled on this button | |
deb_time | gets the debounce time on this button pin |
References pmic_read_reg().
PMIC_STATUS pmic_power_get_pc_config | ( | t_pc_config * | pc_config | ) |
This function retrives the power control configuration.
pc_config | pointer to power control configuration. |
References pmic_read_reg().
PMIC_STATUS pmic_power_get_power_mode_sense | ( | struct t_p_up_sense * | p_up_sense | ) |
This function returns power up sense value
p_up_sense | value of power up sense |
References pmic_read_reg().
PMIC_STATUS pmic_power_get_regen_assig | ( | t_pmic_regulator | regulator, | |
bool * | en_dis | |||
) |
This function gets the Regen assignment for all regulator
regulator | type of regulator | |
en_dis | return value, if true : the regulator is enabled by regen. |
References pmic_read_reg().
PMIC_STATUS pmic_power_get_regen_inv | ( | bool * | en_dis | ) |
This function gets the Regen polarity.
en_dis | If true regen is inverted. |
References pmic_read_reg().
PMIC_STATUS pmic_power_get_vbkup2_auto_state | ( | bool * | en | ) |
This function gets state of automatically VBKUP2. Only on mc13783 2.0 or higher
en | if true, VBKUP2AUTOMH is enabled |
References pmic_get_version(), pmic_read_reg(), and pmic_version_t::revision.
PMIC_STATUS pmic_power_gets_esim_v_state | ( | bool * | vesim, | |
bool * | vmmc1, | |||
bool * | vmmc2 | |||
) |
This function gets esim control voltage values. Only on mc13783 2.0 or higher
vesim | if true, enable VESIMESIMEN | |
vmmc1 | if true, enable VMMC1ESIMEN | |
vmmc2 | if true, enable VMMC2ESIMEN |
References pmic_get_version(), pmic_read_reg(), and pmic_version_t::revision.
PMIC_STATUS pmic_power_gets_vib_pin_state | ( | bool * | en | ) |
This function gets state of control of VVIB by VIBEN pin. Only on mc13783 2.0 or higher
en | if true, VIBPINCTRL is enabled |
References pmic_get_version(), pmic_read_reg(), and pmic_version_t::revision.
void pmic_power_off | ( | void | ) |
This function sets user power off in power control register and thus powers off the phone.
References pmic_write_reg().
PMIC_STATUS pmic_power_regulator_get_config | ( | t_pmic_regulator | regulator, | |
t_regulator_config * | config | |||
) |
This function retrives the regulator output configuration.
regulator | The regulator to be truned off. | |
config | Pointer to regulator configuration. |
References pmic_power_regulator_get_lp_mode(), pmic_power_regulator_get_voltage(), pmic_power_switcher_get_dvs(), pmic_power_switcher_get_dvs_speed(), pmic_power_switcher_get_factor(), pmic_power_switcher_get_mode(), pmic_power_switcher_get_panic_mode(), pmic_power_switcher_get_softstart(), and pmic_power_switcher_get_stby().
PMIC_STATUS pmic_power_regulator_get_lp_mode | ( | t_pmic_regulator | regulator, | |
t_regulator_lp_mode * | lp_mode | |||
) |
This function gets low power mode.
regulator | The regulator to be handled | |
lp_mode | Select nominal or low power mode. |
References pmic_read_reg().
Referenced by pmic_power_regulator_get_config().
PMIC_STATUS pmic_power_regulator_get_voltage | ( | t_pmic_regulator | regulator, | |
t_regulator_voltage * | voltage | |||
) |
This function retrives the regulator output voltage.
regulator | The regulator to be truned off. | |
voltage | Pointer to regulator output voltage. |
References pmic_read_reg().
Referenced by pmic_power_regulator_get_config().
PMIC_STATUS pmic_power_regulator_off | ( | t_pmic_regulator | regulator | ) |
This function turns off a regulator.
regulator | The regulator to be truned off. |
References pmic_write_reg().
PMIC_STATUS pmic_power_regulator_on | ( | t_pmic_regulator | regulator | ) |
This function turns on a regulator.
regulator | The regulator to be truned on. |
References pmic_write_reg().
PMIC_STATUS pmic_power_regulator_set_config | ( | t_pmic_regulator | regulator, | |
t_regulator_config * | config | |||
) |
This function sets the regulator configuration.
regulator | The regulator to be configured. | |
config | The regulator output configuration. |
References pmic_power_regulator_set_lp_mode(), pmic_power_regulator_set_voltage(), pmic_power_switcher_set_dvs(), pmic_power_switcher_set_dvs_speed(), pmic_power_switcher_set_factor(), pmic_power_switcher_set_mode(), pmic_power_switcher_set_panic_mode(), pmic_power_switcher_set_softstart(), and pmic_power_switcher_set_stby().
PMIC_STATUS pmic_power_regulator_set_lp_mode | ( | t_pmic_regulator | regulator, | |
t_regulator_lp_mode | lp_mode | |||
) |
This function enables or disables low power mode.
regulator | The regulator to be configured. | |
lp_mode | Select nominal or low power mode. |
References pmic_write_reg().
Referenced by pmic_power_regulator_set_config().
PMIC_STATUS pmic_power_regulator_set_voltage | ( | t_pmic_regulator | regulator, | |
t_regulator_voltage | voltage | |||
) |
This function sets the regulator output voltage.
regulator | The regulator to be configured. | |
voltage | The regulator output voltage. |
References pmic_write_reg().
Referenced by pmic_power_regulator_set_config().
static int pmic_power_resume | ( | struct platform_device * | pdev | ) | [static] |
This function is called to resume the power from a low power state.
pdev | the device structure used to give information on which power device (0 through 3 channels) to suspend |
PMIC_STATUS pmic_power_set_auto_reset_en | ( | bool | en | ) |
This function enables auto reset after a system reset.
en | if true, the auto reset is enabled |
References pmic_write_reg().
PMIC_STATUS pmic_power_set_conf_button | ( | t_button | bt, | |
bool | sys_rst, | |||
int | deb_time | |||
) |
This function configures a system reset on a button.
bt | type of button. | |
sys_rst | if true, enable the system reset on this button | |
deb_time | sets the debounce time on this button pin |
References pmic_write_reg().
PMIC_STATUS pmic_power_set_pc_config | ( | t_pc_config * | pc_config | ) |
This function sets the power control configuration.
pc_config | power control configuration. |
References pmic_write_reg().
PMIC_STATUS pmic_power_set_regen_assig | ( | t_pmic_regulator | regulator, | |
bool | en_dis | |||
) |
This function configures the Regen assignment for all regulator
regulator | type of regulator | |
en_dis | if true, the regulator is enabled by regen. |
References pmic_write_reg().
PMIC_STATUS pmic_power_set_regen_inv | ( | bool | en_dis | ) |
This function sets the Regen polarity.
en_dis | If true regen is inverted. |
References pmic_write_reg().
static int pmic_power_suspend | ( | struct platform_device * | pdev, | |
pm_message_t | state | |||
) | [static] |
This function is called to put the power in a low power state. Switching off the platform cannot be decided by the power module. It has to be handled by the client application.
pdev | the device structure used to give information on which power device (0 through 3 channels) to suspend | |
state | the power state the device is entering |
PMIC_STATUS pmic_power_switcher_get_dvs | ( | t_pmic_regulator | regulator, | |
t_regulator_voltage * | dvs | |||
) |
This function gets the DVS voltage
regulator | The regulator to be handled. | |
dvs | The switch Dynamic Voltage Scaling |
References pmic_read_reg().
Referenced by pmic_power_regulator_get_config().
PMIC_STATUS pmic_power_switcher_get_dvs_speed | ( | t_pmic_regulator | regulator, | |
t_switcher_dvs_speed * | speed | |||
) |
This function gets the switch dvs speed
regulator | The regulator to be handled. | |
speed | The dvs speed. |
References pmic_read_reg().
Referenced by pmic_power_regulator_get_config().
PMIC_STATUS pmic_power_switcher_get_factor | ( | t_pmic_regulator | regulator, | |
t_switcher_factor * | factor | |||
) |
This function gets the PLL multiplication factor
regulator | The regulator to be handled | |
factor | The multiplication factor. |
References pmic_read_reg().
Referenced by pmic_power_regulator_get_config().
PMIC_STATUS pmic_power_switcher_get_mode | ( | t_pmic_regulator | regulator, | |
t_regulator_sw_mode * | mode, | |||
bool | stby | |||
) |
This function gets the switchers mode.
regulator | The regulator to be handled. | |
mode | The switcher mode. | |
stby | Switch between main and standby. |
References pmic_read_reg().
Referenced by pmic_power_regulator_get_config().
PMIC_STATUS pmic_power_switcher_get_panic_mode | ( | t_pmic_regulator | regulator, | |
bool * | panic_mode | |||
) |
This function gets the switch panic mode
regulator | The regulator to be handled | |
panic_mode | Enable or disable panic mode |
References pmic_read_reg().
Referenced by pmic_power_regulator_get_config().
PMIC_STATUS pmic_power_switcher_get_softstart | ( | t_pmic_regulator | regulator, | |
bool * | softstart | |||
) |
This function gets the switch softstart mode
regulator | The regulator to be handled | |
softstart | Enable or disable softstart. |
References pmic_read_reg().
Referenced by pmic_power_regulator_get_config().
PMIC_STATUS pmic_power_switcher_get_stby | ( | t_pmic_regulator | regulator, | |
t_regulator_voltage * | stby | |||
) |
This function gets the standiby voltage
regulator | The regulator to be handled. | |
stby | The switch standby voltage |
References pmic_read_reg().
Referenced by pmic_power_regulator_get_config().
PMIC_STATUS pmic_power_switcher_set_dvs | ( | t_pmic_regulator | regulator, | |
t_regulator_voltage | dvs | |||
) |
This function sets the DVS voltage
regulator | The regulator to be configured. | |
dvs | The switch Dynamic Voltage Scaling |
References pmic_write_reg().
Referenced by pmic_power_regulator_set_config().
PMIC_STATUS pmic_power_switcher_set_dvs_speed | ( | t_pmic_regulator | regulator, | |
t_switcher_dvs_speed | speed | |||
) |
This function sets the switch dvs speed
regulator | The regulator to be configured. | |
speed | The dvs speed. |
References pmic_write_reg().
Referenced by pmic_power_regulator_set_config().
PMIC_STATUS pmic_power_switcher_set_factor | ( | t_pmic_regulator | regulator, | |
t_switcher_factor | factor | |||
) |
This function sets the PLL multiplication factor
regulator | The regulator to be configured. | |
factor | The multiplication factor. |
References pmic_write_reg().
Referenced by pmic_power_regulator_set_config().
PMIC_STATUS pmic_power_switcher_set_mode | ( | t_pmic_regulator | regulator, | |
t_regulator_sw_mode | mode, | |||
bool | stby | |||
) |
This function sets the switchers mode.
regulator | The regulator to be configured. | |
mode | The switcher mode | |
stby | Switch between main and standby. |
References pmic_write_reg().
Referenced by pmic_power_regulator_set_config().
PMIC_STATUS pmic_power_switcher_set_panic_mode | ( | t_pmic_regulator | regulator, | |
bool | panic_mode | |||
) |
This function sets the switch panic mode
regulator | The regulator to be configured. | |
panic_mode | Enable or disable panic mode |
References pmic_write_reg().
Referenced by pmic_power_regulator_set_config().
PMIC_STATUS pmic_power_switcher_set_softstart | ( | t_pmic_regulator | regulator, | |
bool | softstart | |||
) |
This function sets the switch softstart mode
regulator | The regulator to be configured. | |
softstart | Enable or disable softstart. |
References pmic_write_reg().
Referenced by pmic_power_regulator_set_config().
PMIC_STATUS pmic_power_switcher_set_stby | ( | t_pmic_regulator | regulator, | |
t_regulator_voltage | stby | |||
) |
This function sets the standiby voltage
regulator | The regulator to be configured. | |
stby | The switch standby voltage |
References pmic_write_reg().
Referenced by pmic_power_regulator_set_config().
PMIC_STATUS pmic_power_vbkup2_auto_en | ( | bool | en | ) |
This function enables automatically VBKUP2 in the memory hold modes. Only on mc13783 2.0 or higher
en | if true, enable VBKUP2AUTOMH |
References pmic_get_version(), pmic_write_reg(), and pmic_version_t::revision.
PMIC_STATUS pmic_power_vib_pin_en | ( | bool | en | ) |
This function enables control of VVIB by VIBEN pin. Only on mc13783 2.0 or higher
en | if true, enable VIBPINCTRL |
References pmic_get_version(), pmic_write_reg(), and pmic_version_t::revision.
© Freescale Semiconductor, Inc., 2007.
All rights reserved. Freescale Confidential Proprietary NDA Required |
![]() |