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

PMIC_STATUS pmic_write_reg ( int  reg,
unsigned int  reg_value,
unsigned int  reg_mask 
)

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

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

Definition at line 74 of file pmic_external.c.

References pmic_read(), and pmic_write().

Referenced by mc13783_adc_convert(), mc13783_pmic_audio_exit(), mc13783_pmic_convity_exit(), pmic_adc_active_comparator(), pmic_adc_deactive_comparator(), pmic_adc_init(), pmic_adc_resume(), pmic_adc_set_touch_mode(), pmic_adc_suspend(), pmic_audio_antipop_disable(), pmic_audio_antipop_enable(), pmic_audio_digital_filter_reset(), pmic_audio_disable(), pmic_audio_enable(), pmic_audio_fm_output_enable(), pmic_audio_output_clear_config(), pmic_audio_output_clear_port(), pmic_audio_output_disable_mixer(), pmic_audio_output_disable_mono_adder(), pmic_audio_output_disable_phantom_ground(), pmic_audio_output_enable_mixer(), pmic_audio_output_enable_mono_adder(), pmic_audio_output_enable_phantom_ground(), pmic_audio_output_set_balance(), pmic_audio_output_set_config(), pmic_audio_output_set_pgaGain(), pmic_audio_output_set_port(), pmic_audio_output_set_stereo_in_gain(), pmic_audio_reset_all(), pmic_audio_reset_device(), pmic_audio_set_protocol(), pmic_audio_stdac_clear_config(), pmic_audio_stdac_disable_mixer(), pmic_audio_stdac_enable_mixer(), pmic_audio_stdac_set_clock(), pmic_audio_stdac_set_config(), pmic_audio_stdac_set_rxtx_timeslot(), pmic_audio_vcodec_clear_config(), pmic_audio_vcodec_disable_bypass(), pmic_audio_vcodec_disable_micbias(), pmic_audio_vcodec_disable_mixer(), pmic_audio_vcodec_enable_bypass(), pmic_audio_vcodec_enable_micbias(), pmic_audio_vcodec_enable_mixer(), pmic_audio_vcodec_set_clock(), pmic_audio_vcodec_set_config(), pmic_audio_vcodec_set_mic(), pmic_audio_vcodec_set_mic_on_off(), pmic_audio_vcodec_set_record_gain(), pmic_audio_vcodec_set_rxtx_timeslot(), pmic_audio_vcodec_set_secondary_txslot(), pmic_batt_disable_charger(), pmic_batt_enable_charger(), pmic_batt_set_charger(), pmic_battery_suspend(), pmic_bklit_config_boost_mode(), pmic_bklit_disable_edge_slow(), pmic_bklit_enable_edge_slow(), pmic_bklit_off_rampdown(), pmic_bklit_off_rampup(), pmic_bklit_rampdown(), pmic_bklit_rampup(), pmic_bklit_set_boost_mode(), pmic_bklit_set_current(), pmic_bklit_set_cycle_time(), pmic_bklit_set_dutycycle(), pmic_bklit_set_mode(), pmic_bklit_tcled_master_disable(), pmic_bklit_tcled_master_enable(), pmic_convity_cea936_exit_signal(), pmic_convity_reset(), pmic_convity_rs232_set_config(), pmic_convity_set_mode_internal(), pmic_convity_set_output(), pmic_convity_usb_otg_clear_config(), pmic_convity_usb_otg_set_config(), pmic_convity_usb_set_power_source(), pmic_convity_usb_set_speed(), pmic_convity_usb_set_xcvr(), pmic_dev_ioctl(), pmic_event_mask(), pmic_event_unmask(), pmic_light_init_reg(), pmic_power_bat_det_en(), pmic_power_esim_v_en(), pmic_power_off(), pmic_power_regulator_off(), pmic_power_regulator_on(), pmic_power_regulator_set_lp_mode(), pmic_power_regulator_set_voltage(), pmic_power_set_auto_reset_en(), pmic_power_set_conf_button(), pmic_power_set_pc_config(), pmic_power_set_regen_assig(), pmic_power_set_regen_inv(), 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(), pmic_power_switcher_set_stby(), pmic_power_vbkup2_auto_en(), pmic_power_vib_pin_en(), pmic_rtc_set_time(), pmic_rtc_set_time_alarm(), pmic_tcled_disable(), pmic_tcled_disable_edge_slow(), pmic_tcled_disable_half_current(), pmic_tcled_enable(), pmic_tcled_enable_edge_slow(), pmic_tcled_enable_half_current(), pmic_tcled_fun_blendedbowtie(), pmic_tcled_fun_blendedramps(), pmic_tcled_fun_chasinglightspattern(), pmic_tcled_fun_rampdown(), pmic_tcled_fun_rampup(), pmic_tcled_fun_sawramps(), pmic_tcled_fun_set_current(), pmic_tcled_fun_set_cycletime(), pmic_tcled_fun_set_dutycycle(), pmic_tcled_fun_triode_off(), pmic_tcled_fun_triode_on(), pmic_tcled_ind_set_blink_pattern(), and pmic_tcled_ind_set_current().

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

      ret = pmic_read(reg, &temp);
      if (ret != PMIC_SUCCESS) {
            return PMIC_ERROR;
      }
      temp = (temp & (~reg_mask)) | reg_value;
#ifdef CONFIG_MXC_PMIC_MC13783
      if (reg == REG_POWER_MISCELLANEOUS)
            temp &= 0xFFFE7FFF;
#endif
      ret = pmic_write(reg, temp);
      if (ret != PMIC_SUCCESS) {
            return PMIC_ERROR;
      }

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

      return ret;
}


Generated by  Doxygen 1.6.0   Back to index