int get_vddfix_vlt_adj(u32 vddfix_vlt) { int voltage = bcmpmu_rgltr_get_volt_val(vddfix_vlt); int adj_val, silicon_type = SILICON_TYPE_SLOW; u32 ddr_freq, ddr_freq_id; /* Convert uV to mV */ voltage = voltage/1000; ddr_freq = kona_memc_get_ddr_clk_freq(); if (ddr_freq < 400000000) ddr_freq_id = DDR_FREQ_400M; else ddr_freq_id = DDR_FREQ_450M; #ifdef CONFIG_KONA_AVS adj_val = avs_get_vddfix_adj(ddr_freq_id); if (adj_val == 0) { if (ddr_freq_id == DDR_FREQ_450M) { silicon_type = avs_get_silicon_type(); voltage = sdsr1_active_voltage_450m[silicon_type]; } else voltage = DEFAULT_VDDFIX_VOLTAGE; } else voltage = DEFAULT_VDDFIX_VOLTAGE + adj_val; #else if (ddr_freq_id == DDR_FREQ_450M) voltage = sdsr1_active_voltage_450m[silicon_type]; else voltage = DEFAULT_VDDFIX_VOLTAGE; #endif pr_info("SDSR1 active voltage: %dmV\n", voltage); return bcmpmu_rgltr_get_volt_id(voltage); }
int get_vddfix_vlt_adj(u32 vddfix_vlt) { int voltage = bcmpmu_rgltr_get_volt_val(vddfix_vlt); /* Convert uV to mV */ voltage = voltage/1000; #ifdef CONFIG_KONA_AVS voltage += avs_get_vddfix_adj(); #endif pr_info("SDSR1 active voltage: %dmV\n", voltage); return bcmpmu_rgltr_get_volt_id(voltage); }