@@ -190,6 +190,19 @@ static void amd_pmf_load_defaults_sps(struct amd_pmf_dev *dev)
190
190
amd_pmf_dump_sps_defaults (& config_store );
191
191
}
192
192
193
+ static void amd_pmf_update_slider_v2 (struct amd_pmf_dev * dev , int idx )
194
+ {
195
+ amd_pmf_send_cmd (dev , SET_PMF_PPT , false, apts_config_store .val [idx ].pmf_ppt , NULL );
196
+ amd_pmf_send_cmd (dev , SET_PMF_PPT_APU_ONLY , false,
197
+ apts_config_store .val [idx ].ppt_pmf_apu_only , NULL );
198
+ amd_pmf_send_cmd (dev , SET_STT_MIN_LIMIT , false,
199
+ apts_config_store .val [idx ].stt_min_limit , NULL );
200
+ amd_pmf_send_cmd (dev , SET_STT_LIMIT_APU , false,
201
+ apts_config_store .val [idx ].stt_skin_temp_limit_apu , NULL );
202
+ amd_pmf_send_cmd (dev , SET_STT_LIMIT_HS2 , false,
203
+ apts_config_store .val [idx ].stt_skin_temp_limit_hs2 , NULL );
204
+ }
205
+
193
206
void amd_pmf_update_slider (struct amd_pmf_dev * dev , bool op , int idx ,
194
207
struct amd_pmf_static_slider_granular * table )
195
208
{
@@ -222,6 +235,32 @@ void amd_pmf_update_slider(struct amd_pmf_dev *dev, bool op, int idx,
222
235
}
223
236
}
224
237
238
+ static int amd_pmf_update_sps_power_limits_v2 (struct amd_pmf_dev * pdev , int pwr_mode )
239
+ {
240
+ int src , index ;
241
+
242
+ src = amd_pmf_get_power_source ();
243
+
244
+ switch (pwr_mode ) {
245
+ case POWER_MODE_PERFORMANCE :
246
+ index = config_store_v2 .sps_idx .power_states [src ][POWER_MODE_BEST_PERFORMANCE ];
247
+ amd_pmf_update_slider_v2 (pdev , index );
248
+ break ;
249
+ case POWER_MODE_BALANCED_POWER :
250
+ index = config_store_v2 .sps_idx .power_states [src ][POWER_MODE_BALANCED ];
251
+ amd_pmf_update_slider_v2 (pdev , index );
252
+ break ;
253
+ case POWER_MODE_POWER_SAVER :
254
+ index = config_store_v2 .sps_idx .power_states [src ][POWER_MODE_BEST_POWER_EFFICIENCY ];
255
+ amd_pmf_update_slider_v2 (pdev , index );
256
+ break ;
257
+ default :
258
+ return - EINVAL ;
259
+ }
260
+
261
+ return 0 ;
262
+ }
263
+
225
264
int amd_pmf_set_sps_power_limits (struct amd_pmf_dev * pmf )
226
265
{
227
266
int mode ;
@@ -230,6 +269,9 @@ int amd_pmf_set_sps_power_limits(struct amd_pmf_dev *pmf)
230
269
if (mode < 0 )
231
270
return mode ;
232
271
272
+ if (pmf -> pmf_if_version == PMF_IF_V2 )
273
+ return amd_pmf_update_sps_power_limits_v2 (pmf , mode );
274
+
233
275
amd_pmf_update_slider (pmf , SLIDER_OP_SET , mode , NULL );
234
276
235
277
return 0 ;
0 commit comments