Lines Matching +full:mode +full:- +full:flag

1 // SPDX-License-Identifier: GPL-2.0
8 * Author: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
30 return "Unknown Power Mode"; in slider_v2_as_str()
64 pr_debug("Static Slider Data - BEGIN\n"); in amd_pmf_dump_sps_defaults()
68 pr_debug("--- Source:%s Mode:%s ---\n", amd_pmf_source_as_str(i), in amd_pmf_dump_sps_defaults()
70 pr_debug("SPL: %u mW\n", data->prop[i][j].spl); in amd_pmf_dump_sps_defaults()
71 pr_debug("SPPT: %u mW\n", data->prop[i][j].sppt); in amd_pmf_dump_sps_defaults()
72 pr_debug("SPPT_ApuOnly: %u mW\n", data->prop[i][j].sppt_apu_only); in amd_pmf_dump_sps_defaults()
73 pr_debug("FPPT: %u mW\n", data->prop[i][j].fppt); in amd_pmf_dump_sps_defaults()
74 pr_debug("STTMinLimit: %u mW\n", data->prop[i][j].stt_min); in amd_pmf_dump_sps_defaults()
76 data->prop[i][j].stt_skin_temp[STT_TEMP_APU]); in amd_pmf_dump_sps_defaults()
78 data->prop[i][j].stt_skin_temp[STT_TEMP_HS2]); in amd_pmf_dump_sps_defaults()
82 pr_debug("Static Slider Data - END\n"); in amd_pmf_dump_sps_defaults()
89 pr_debug("Static Slider APTS state index data - BEGIN"); in amd_pmf_dump_sps_defaults_v2()
90 pr_debug("size: %u\n", data->size); in amd_pmf_dump_sps_defaults_v2()
95 data->sps_idx.power_states[i][j]); in amd_pmf_dump_sps_defaults_v2()
97 pr_debug("Static Slider APTS state index data - END\n"); in amd_pmf_dump_sps_defaults_v2()
104 pr_debug("Static Slider APTS index default values data - BEGIN"); in amd_pmf_dump_apts_sps_defaults()
107 pr_debug("Table Version[%d] = %u\n", i, info->val[i].table_version); in amd_pmf_dump_apts_sps_defaults()
108 pr_debug("Fan Index[%d] = %u\n", i, info->val[i].fan_table_idx); in amd_pmf_dump_apts_sps_defaults()
109 pr_debug("PPT[%d] = %u\n", i, info->val[i].pmf_ppt); in amd_pmf_dump_apts_sps_defaults()
110 pr_debug("PPT APU[%d] = %u\n", i, info->val[i].ppt_pmf_apu_only); in amd_pmf_dump_apts_sps_defaults()
111 pr_debug("STT Min[%d] = %u\n", i, info->val[i].stt_min_limit); in amd_pmf_dump_apts_sps_defaults()
112 pr_debug("STT APU[%d] = %u\n", i, info->val[i].stt_skin_temp_limit_apu); in amd_pmf_dump_apts_sps_defaults()
113 pr_debug("STT HS2[%d] = %u\n", i, info->val[i].stt_skin_temp_limit_hs2); in amd_pmf_dump_apts_sps_defaults()
116 pr_debug("Static Slider APTS index default values data - END"); in amd_pmf_dump_apts_sps_defaults()
224 amd_pmf_send_cmd(dev, GET_SPL, true, ARG_NONE, &table->prop[src][idx].spl); in amd_pmf_update_slider()
225 amd_pmf_send_cmd(dev, GET_FPPT, true, ARG_NONE, &table->prop[src][idx].fppt); in amd_pmf_update_slider()
226 amd_pmf_send_cmd(dev, GET_SPPT, true, ARG_NONE, &table->prop[src][idx].sppt); in amd_pmf_update_slider()
228 &table->prop[src][idx].sppt_apu_only); in amd_pmf_update_slider()
230 &table->prop[src][idx].stt_min); in amd_pmf_update_slider()
232 (u32 *)&table->prop[src][idx].stt_skin_temp[STT_TEMP_APU]); in amd_pmf_update_slider()
234 (u32 *)&table->prop[src][idx].stt_skin_temp[STT_TEMP_HS2]); in amd_pmf_update_slider()
258 return -EINVAL; in amd_pmf_update_sps_power_limits_v2()
266 int mode; in amd_pmf_set_sps_power_limits() local
268 mode = amd_pmf_get_pprof_modes(pmf); in amd_pmf_set_sps_power_limits()
269 if (mode < 0) in amd_pmf_set_sps_power_limits()
270 return mode; in amd_pmf_set_sps_power_limits()
272 if (pmf->pmf_if_version == PMF_IF_V2) in amd_pmf_set_sps_power_limits()
273 return amd_pmf_update_sps_power_limits_v2(pmf, mode); in amd_pmf_set_sps_power_limits()
275 amd_pmf_update_slider(pmf, SLIDER_OP_SET, mode, NULL); in amd_pmf_set_sps_power_limits()
282 return (pmf->current_profile == PLATFORM_PROFILE_BALANCED) ? true : false; in is_pprof_balanced()
290 *profile = pmf->current_profile; in amd_pmf_profile_get()
296 int mode; in amd_pmf_get_pprof_modes() local
298 switch (pmf->current_profile) { in amd_pmf_get_pprof_modes()
300 mode = POWER_MODE_PERFORMANCE; in amd_pmf_get_pprof_modes()
303 mode = POWER_MODE_BALANCED_POWER; in amd_pmf_get_pprof_modes()
306 mode = POWER_MODE_POWER_SAVER; in amd_pmf_get_pprof_modes()
309 dev_err(pmf->dev, "Unknown Platform Profile.\n"); in amd_pmf_get_pprof_modes()
310 return -EOPNOTSUPP; in amd_pmf_get_pprof_modes()
313 return mode; in amd_pmf_get_pprof_modes()
318 u8 flag = 0; in amd_pmf_power_slider_update_event() local
319 int mode; in amd_pmf_power_slider_update_event() local
322 mode = amd_pmf_get_pprof_modes(dev); in amd_pmf_power_slider_update_event()
323 if (mode < 0) in amd_pmf_power_slider_update_event()
324 return mode; in amd_pmf_power_slider_update_event()
329 switch (mode) { in amd_pmf_power_slider_update_event()
331 flag |= BIT(AC_BEST_PERF); in amd_pmf_power_slider_update_event()
334 flag |= BIT(AC_BETTER_PERF); in amd_pmf_power_slider_update_event()
337 flag |= BIT(AC_BETTER_BATTERY); in amd_pmf_power_slider_update_event()
340 dev_err(dev->dev, "unsupported platform profile\n"); in amd_pmf_power_slider_update_event()
341 return -EOPNOTSUPP; in amd_pmf_power_slider_update_event()
345 switch (mode) { in amd_pmf_power_slider_update_event()
347 flag |= BIT(DC_BEST_PERF); in amd_pmf_power_slider_update_event()
350 flag |= BIT(DC_BETTER_PERF); in amd_pmf_power_slider_update_event()
353 flag |= BIT(DC_BATTERY_SAVER); in amd_pmf_power_slider_update_event()
356 dev_err(dev->dev, "unsupported platform profile\n"); in amd_pmf_power_slider_update_event()
357 return -EOPNOTSUPP; in amd_pmf_power_slider_update_event()
361 apmf_os_power_slider_update(dev, flag); in amd_pmf_power_slider_update_event()
372 pmf->current_profile = profile; in amd_pmf_profile_set()
394 dev->current_profile = PLATFORM_PROFILE_BALANCED; in amd_pmf_init_sps()
397 if (dev->pmf_if_version == PMF_IF_V2) { in amd_pmf_init_sps()
404 /* update SPS balanced power mode thermals */ in amd_pmf_init_sps()
408 dev->pprof.profile_get = amd_pmf_profile_get; in amd_pmf_init_sps()
409 dev->pprof.profile_set = amd_pmf_profile_set; in amd_pmf_init_sps()
412 set_bit(PLATFORM_PROFILE_LOW_POWER, dev->pprof.choices); in amd_pmf_init_sps()
413 set_bit(PLATFORM_PROFILE_BALANCED, dev->pprof.choices); in amd_pmf_init_sps()
414 set_bit(PLATFORM_PROFILE_PERFORMANCE, dev->pprof.choices); in amd_pmf_init_sps()
417 err = platform_profile_register(&dev->pprof); in amd_pmf_init_sps()
419 dev_err(dev->dev, "Failed to register SPS support, this is most likely an SBIOS bug: %d\n", in amd_pmf_init_sps()