void kbase_set_power_margin(int volt_offset) { int getVol; #ifdef CONFIG_MALI_T6XX_DVFS mutex_lock(&mali_set_clock_lock); #endif kbase_platform_get_voltage(NULL, &getVol); if (volt_offset) { if (volt_offset != gpu_voltage_margin) { if (getVol-gpu_voltage_margin+volt_offset <= COLD_MINIMUM_VOL) { kbase_platform_set_voltage(NULL, COLD_MINIMUM_VOL); pr_info("we set the voltage : %d\n", COLD_MINIMUM_VOL); } else { kbase_platform_set_voltage(NULL, getVol-gpu_voltage_margin+volt_offset); pr_info("we set the voltage : %d\n", getVol-gpu_voltage_margin+volt_offset); } gpu_voltage_margin = volt_offset; } } else { if (gpu_voltage_margin) { kbase_platform_set_voltage(NULL, getVol-gpu_voltage_margin); pr_info("we set the voltage : %d\n", getVol-gpu_voltage_margin); gpu_voltage_margin = 0; } } #ifdef CONFIG_MALI_T6XX_DVFS mutex_unlock(&mali_set_clock_lock); #endif }
static void kbase_platform_dvfs_set_vol(unsigned int vol) { static int _vol = -1; if (_vol == vol) return; kbase_platform_set_voltage(NULL, vol); _vol = vol; return; }
static void kbase_platform_dvfs_set_vol(unsigned int vol) { static int _vol = -1; #ifdef MALI_DEBUG int gotvol = -1; #endif if (_vol == vol) return; kbase_platform_set_voltage(NULL, vol); _vol = vol; #ifdef MALI_DEBUG DEBUG_PRINT_INFO("***set voltage:%d\n", vol); kbase_platform_get_voltage(NULL, &gotvol); DEBUG_PRINT_INFO("***get voltage:%d\n", gotvol); #endif return; }