diff options
Diffstat (limited to 'drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c')
| -rw-r--r-- | drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 18 | 
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c index 5633c5797e85..2ddf5198e5c4 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c @@ -733,6 +733,24 @@ static int smu_late_init(void *handle)  		return ret;  	} +	/* +	 * Explicitly notify PMFW the power mode the system in. Since +	 * the PMFW may boot the ASIC with a different mode. +	 * For those supporting ACDC switch via gpio, PMFW will +	 * handle the switch automatically. Driver involvement +	 * is unnecessary. +	 */ +	if (!smu->dc_controlled_by_gpio) { +		ret = smu_set_power_source(smu, +					   adev->pm.ac_power ? SMU_POWER_SOURCE_AC : +					   SMU_POWER_SOURCE_DC); +		if (ret) { +			dev_err(adev->dev, "Failed to switch to %s mode!\n", +				adev->pm.ac_power ? "AC" : "DC"); +			return ret; +		} +	} +  	if ((adev->ip_versions[MP1_HWIP][0] == IP_VERSION(13, 0, 1)) ||  	    (adev->ip_versions[MP1_HWIP][0] == IP_VERSION(13, 0, 3)))  		return 0;  | 
