Logo Search packages:      
Sourcecode: linux-fsl-imx51 version File versions  Download package

PMIC_STATUS pmic_read_reg ( int  reg,
unsigned int *  reg_value,
unsigned int  reg_mask 
)

This function is called by PMIC clients to read a register on PMIC.

Parameters:
reg number of register
reg_value return value of register
reg_mask Bitmap mask indicating which bits to modify
Returns:
This function returns PMIC_SUCCESS if successful.

Definition at line 48 of file pmic_external.c.

References pmic_read().

Referenced by mc13783_adc_convert(), pmic_adc_get_touch_mode(), pmic_batt_get_charger_setting(), pmic_bklit_get_boost_mode(), pmic_bklit_get_current(), pmic_bklit_get_cycle_time(), pmic_bklit_get_dutycycle(), pmic_bklit_get_edge_slow(), pmic_bklit_get_mode(), pmic_bklit_gets_boost_mode(), pmic_bklit_set_dutycycle(), pmic_bklit_set_mode(), pmic_check_sensor(), pmic_dev_ioctl(), pmic_get_sensors(), pmic_power_get_auto_reset_en(), pmic_power_get_bat_det_state(), pmic_power_get_conf_button(), pmic_power_get_pc_config(), pmic_power_get_power_mode_sense(), pmic_power_get_regen_assig(), pmic_power_get_regen_inv(), pmic_power_get_vbkup2_auto_state(), pmic_power_gets_esim_v_state(), pmic_power_gets_vib_pin_state(), 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(), pmic_power_switcher_get_stby(), pmic_rtc_get_time(), pmic_rtc_get_time_alarm(), pmic_tcled_fun_get_current(), pmic_tcled_fun_get_cycletime(), pmic_tcled_fun_get_dutycycle(), pmic_tcled_get_fun_rampdown(), pmic_tcled_get_fun_rampup(), pmic_tcled_get_mode(), pmic_tcled_ind_get_blink_pattern(), and pmic_tcled_ind_get_current().

{
      int ret = 0;
      unsigned int temp = 0;

      ret = pmic_read(reg, &temp);
      if (ret != PMIC_SUCCESS) {
            return PMIC_ERROR;
      }
      *reg_value = (temp & reg_mask);

      pr_debug("Read REG[ %d ] = 0x%x\n", reg, *reg_value);

      return ret;
}


Generated by  Doxygen 1.6.0   Back to index