void pmic_voltage_init(void) { t_regulator_voltage volt; /* Enable 4 mc13783 output voltages */ pmic_write_reg(REG_ARBITRATION_SWITCHERS, (1 << 5), (1 << 5)); /* Set mc13783 DVS speed 25mV each 4us */ pmic_write_reg(REG_SWITCHERS_4, (0 << 6), (3 << 6)); if (cpu_is_mx31()) volt.sw1a = SW1A_1_625V; else volt.sw1a = SW1A_1_425V; pmic_power_regulator_set_voltage(SW_SW1A, volt); volt.sw1a = SW1A_1_25V; pmic_power_switcher_set_dvs(SW_SW1A, volt); if (cpu_is_mx32()) { volt.sw1a = SW1A_0_975V; pmic_power_switcher_set_stby(SW_SW1A, volt); } volt.sw1b = SW1A_1_25V; pmic_power_switcher_set_dvs(SW_SW1B, volt); volt.sw1b = SW1A_1_25V; pmic_power_switcher_set_stby(SW_SW1B, volt); }
void pmic_voltage_init(void) { t_regulator_voltage volt; /* Enable 4 mc13783 output voltages */ pmic_write_reg(REG_ARBITRATION_SWITCHERS, 1, (1 << 5)); /* Enable mc13783 voltage ready signal */ pmic_write_reg(REG_INTERRUPT_MASK_1, 0, (1 << 11)); /* Set mc13783 DVS speed 25mV each 4us */ pmic_write_reg(REG_SWITCHERS_4, 1, (1 << 6)); pmic_write_reg(REG_SWITCHERS_4, 0, (1 << 7)); volt.sw1a = SW1A_1_625V; pmic_power_regulator_set_voltage(SW_SW1A, volt); volt.sw1a = SW1A_1_25V; pmic_power_switcher_set_dvs(SW_SW1A, volt); volt.sw1b = SW1A_1_25V; pmic_power_switcher_set_dvs(SW_SW1B, volt); volt.sw1b = SW1A_1_25V; pmic_power_switcher_set_stby(SW_SW1B, volt); }
/*! * This function updates the CPU voltage, produced by MC13783, by calling * MC13783 driver functions. * * @param dvfs_dptc_tables_ptr pointer to the DPTC translation table. * @param wp current wp value. * */ static void set_pmic_voltage(dvfs_dptc_tables_s * dvfs_dptc_tables_ptr, int wp) { /* Call MC13783 functions */ t_regulator_voltage volt; volt.sw1a = dvfs_dptc_tables_ptr->wp[wp].pmic_values[0]; pmic_power_regulator_set_voltage(SW_SW1A, volt); }
static void mxcmci_mc13783_power_ctrl(struct mmc_host *host, struct mmc_ios *ios) { struct mxcmci_priv *priv = mmc_priv(host); t_regulator_voltage voltage; switch (ios->power_mode) { case MMC_POWER_UP: if (priv->id == 0) { voltage.vmmc1 = vdd_mapping[ios->vdd]; pmic_power_regulator_set_voltage(REGU_VMMC1, voltage); pmic_power_regulator_set_lp_mode(REGU_VMMC1, LOW_POWER_DISABLED); pmic_power_regulator_on(REGU_VMMC1); } if (priv->id == 1) { voltage.vmmc2 = vdd_mapping[ios->vdd]; pmic_power_regulator_set_voltage(REGU_VMMC2, voltage); pmic_power_regulator_set_lp_mode(REGU_VMMC2, LOW_POWER_DISABLED); pmic_power_regulator_on(REGU_VMMC2); } dev_dbg(priv->host->parent, "mmc power on\n"); msleep(300); break; case MMC_POWER_OFF: if (priv->id == 0) { pmic_power_regulator_set_lp_mode(REGU_VMMC1, LOW_POWER_EN); pmic_power_regulator_off(REGU_VMMC1); } if (priv->id == 1) { pmic_power_regulator_set_lp_mode(REGU_VMMC2, LOW_POWER_EN); pmic_power_regulator_off(REGU_VMMC2); } dev_dbg(priv->host->parent, "mmc power off\n"); break; default: break; } }