Lines Matching refs:ps

76 	struct sumo_ps *ps = rps->ps_priv;  in sumo_get_ps()  local
78 return ps; in sumo_get_ps()
345 struct sumo_ps *ps = sumo_get_ps(rps); in sumo_program_bsp() local
347 u32 highest_engine_clock = ps->levels[ps->num_levels - 1].sclk; in sumo_program_bsp()
349 if (ps->flags & SUMO_POWERSTATE_FLAGS_BOOST_STATE) in sumo_program_bsp()
354 for (i = 0; i < ps->num_levels - 1; i++) in sumo_program_bsp()
359 if (ps->flags & SUMO_POWERSTATE_FLAGS_BOOST_STATE) in sumo_program_bsp()
388 struct sumo_ps *ps = sumo_get_ps(rps); in sumo_program_at() local
408 for (i = 0; i < ps->num_levels; i++) { in sumo_program_at()
409 asi = (i == ps->num_levels - 1) ? pi->pasi : pi->asi; in sumo_program_at()
411 m_a = asi * ps->levels[i].sclk / 100; in sumo_program_at()
418 if (ps->flags & SUMO_POWERSTATE_FLAGS_BOOST_STATE) { in sumo_program_at()
423 a_t = CG_R(m_a * r[ps->num_levels - 1] / 100) | in sumo_program_at()
424 CG_L(m_a * l[ps->num_levels - 1] / 100); in sumo_program_at()
1043 struct sumo_ps *ps, in sumo_patch_thermal_state() argument
1060 ps->levels[0].vddc_index = current_vddc; in sumo_patch_thermal_state()
1062 if (ps->levels[0].sclk > current_sclk) in sumo_patch_thermal_state()
1063 ps->levels[0].sclk = current_sclk; in sumo_patch_thermal_state()
1065 ps->levels[0].ss_divider_index = in sumo_patch_thermal_state()
1066 sumo_get_sleep_divider_id_from_clock(rdev, ps->levels[0].sclk, sclk_in_sr); in sumo_patch_thermal_state()
1068 ps->levels[0].ds_divider_index = in sumo_patch_thermal_state()
1069 sumo_get_sleep_divider_id_from_clock(rdev, ps->levels[0].sclk, SUMO_MINIMUM_ENGINE_CLOCK); in sumo_patch_thermal_state()
1071 if (ps->levels[0].ds_divider_index > ps->levels[0].ss_divider_index + 1) in sumo_patch_thermal_state()
1072 ps->levels[0].ds_divider_index = ps->levels[0].ss_divider_index + 1; in sumo_patch_thermal_state()
1074 if (ps->levels[0].ss_divider_index == ps->levels[0].ds_divider_index) { in sumo_patch_thermal_state()
1075 if (ps->levels[0].ss_divider_index > 1) in sumo_patch_thermal_state()
1076 ps->levels[0].ss_divider_index = ps->levels[0].ss_divider_index - 1; in sumo_patch_thermal_state()
1079 if (ps->levels[0].ss_divider_index == 0) in sumo_patch_thermal_state()
1080 ps->levels[0].ds_divider_index = 0; in sumo_patch_thermal_state()
1082 if (ps->levels[0].ds_divider_index == 0) in sumo_patch_thermal_state()
1083 ps->levels[0].ss_divider_index = 0; in sumo_patch_thermal_state()
1090 struct sumo_ps *ps = sumo_get_ps(new_rps); in sumo_apply_state_adjust_rules() local
1099 return sumo_patch_thermal_state(rdev, ps, current_ps); in sumo_apply_state_adjust_rules()
1103 ps->flags |= SUMO_POWERSTATE_FLAGS_BOOST_STATE; in sumo_apply_state_adjust_rules()
1109 ps->flags |= SUMO_POWERSTATE_FLAGS_FORCE_NBPS1_STATE; in sumo_apply_state_adjust_rules()
1111 for (i = 0; i < ps->num_levels; i++) { in sumo_apply_state_adjust_rules()
1112 if (ps->levels[i].vddc_index < min_voltage) in sumo_apply_state_adjust_rules()
1113 ps->levels[i].vddc_index = min_voltage; in sumo_apply_state_adjust_rules()
1115 if (ps->levels[i].sclk < min_sclk) in sumo_apply_state_adjust_rules()
1116 ps->levels[i].sclk = in sumo_apply_state_adjust_rules()
1119 ps->levels[i].ss_divider_index = in sumo_apply_state_adjust_rules()
1120 sumo_get_sleep_divider_id_from_clock(rdev, ps->levels[i].sclk, sclk_in_sr); in sumo_apply_state_adjust_rules()
1122 ps->levels[i].ds_divider_index = in sumo_apply_state_adjust_rules()
1123 sumo_get_sleep_divider_id_from_clock(rdev, ps->levels[i].sclk, SUMO_MINIMUM_ENGINE_CLOCK); in sumo_apply_state_adjust_rules()
1125 if (ps->levels[i].ds_divider_index > ps->levels[i].ss_divider_index + 1) in sumo_apply_state_adjust_rules()
1126 ps->levels[i].ds_divider_index = ps->levels[i].ss_divider_index + 1; in sumo_apply_state_adjust_rules()
1128 if (ps->levels[i].ss_divider_index == ps->levels[i].ds_divider_index) { in sumo_apply_state_adjust_rules()
1129 if (ps->levels[i].ss_divider_index > 1) in sumo_apply_state_adjust_rules()
1130 ps->levels[i].ss_divider_index = ps->levels[i].ss_divider_index - 1; in sumo_apply_state_adjust_rules()
1133 if (ps->levels[i].ss_divider_index == 0) in sumo_apply_state_adjust_rules()
1134 ps->levels[i].ds_divider_index = 0; in sumo_apply_state_adjust_rules()
1136 if (ps->levels[i].ds_divider_index == 0) in sumo_apply_state_adjust_rules()
1137 ps->levels[i].ss_divider_index = 0; in sumo_apply_state_adjust_rules()
1139 if (ps->flags & SUMO_POWERSTATE_FLAGS_FORCE_NBPS1_STATE) in sumo_apply_state_adjust_rules()
1140 ps->levels[i].allow_gnb_slow = 1; in sumo_apply_state_adjust_rules()
1143 ps->levels[i].allow_gnb_slow = 0; in sumo_apply_state_adjust_rules()
1144 else if (i == ps->num_levels - 1) in sumo_apply_state_adjust_rules()
1145 ps->levels[i].allow_gnb_slow = 0; in sumo_apply_state_adjust_rules()
1147 ps->levels[i].allow_gnb_slow = 1; in sumo_apply_state_adjust_rules()
1393 struct sumo_ps *ps) in sumo_patch_boot_state() argument
1397 ps->num_levels = 1; in sumo_patch_boot_state()
1398 ps->flags = 0; in sumo_patch_boot_state()
1399 ps->levels[0] = pi->boot_pl; in sumo_patch_boot_state()
1407 struct sumo_ps *ps = sumo_get_ps(rps); in sumo_parse_pplib_non_clock_info() local
1423 sumo_patch_boot_state(rdev, ps); in sumo_parse_pplib_non_clock_info()
1434 struct sumo_ps *ps = sumo_get_ps(rps); in sumo_parse_pplib_clock_info() local
1435 struct sumo_pl *pl = &ps->levels[index]; in sumo_parse_pplib_clock_info()
1444 ps->num_levels = index + 1; in sumo_parse_pplib_clock_info()
1467 struct sumo_ps *ps; in sumo_parse_power_table() local
1484 rdev->pm.dpm.ps = kcalloc(state_array->ucNumEntries, in sumo_parse_power_table()
1487 if (!rdev->pm.dpm.ps) in sumo_parse_power_table()
1498 ps = kzalloc(sizeof(struct sumo_ps), GFP_KERNEL); in sumo_parse_power_table()
1499 if (ps == NULL) { in sumo_parse_power_table()
1500 kfree(rdev->pm.dpm.ps); in sumo_parse_power_table()
1503 rdev->pm.dpm.ps[i].ps_priv = ps; in sumo_parse_power_table()
1515 &rdev->pm.dpm.ps[i], k, in sumo_parse_power_table()
1519 sumo_parse_pplib_non_clock_info(rdev, &rdev->pm.dpm.ps[i], in sumo_parse_power_table()
1798 struct sumo_ps *ps = sumo_get_ps(rps); in sumo_dpm_print_power_state() local
1803 for (i = 0; i < ps->num_levels; i++) { in sumo_dpm_print_power_state()
1804 struct sumo_pl *pl = &ps->levels[i]; in sumo_dpm_print_power_state()
1817 struct sumo_ps *ps = sumo_get_ps(rps); in sumo_dpm_debugfs_print_current_performance_level() local
1829 } else if (current_index >= ps->num_levels) { in sumo_dpm_debugfs_print_current_performance_level()
1832 pl = &ps->levels[current_index]; in sumo_dpm_debugfs_print_current_performance_level()
1844 struct sumo_ps *ps = sumo_get_ps(rps); in sumo_dpm_get_current_sclk() local
1853 } else if (current_index >= ps->num_levels) { in sumo_dpm_get_current_sclk()
1856 pl = &ps->levels[current_index]; in sumo_dpm_get_current_sclk()
1872 struct sumo_ps *ps = sumo_get_ps(rps); in sumo_dpm_get_current_vddc() local
1880 } else if (current_index >= ps->num_levels) { in sumo_dpm_get_current_vddc()
1883 pl = &ps->levels[current_index]; in sumo_dpm_get_current_vddc()
1895 kfree(rdev->pm.dpm.ps[i].ps_priv); in sumo_dpm_fini()
1897 kfree(rdev->pm.dpm.ps); in sumo_dpm_fini()
1924 struct sumo_ps *ps = sumo_get_ps(rps); in sumo_dpm_force_performance_level() local
1927 if (ps->num_levels <= 1) in sumo_dpm_force_performance_level()
1933 sumo_power_level_enable(rdev, ps->num_levels - 1, true); in sumo_dpm_force_performance_level()
1934 sumo_set_forced_level(rdev, ps->num_levels - 1); in sumo_dpm_force_performance_level()
1936 for (i = 0; i < ps->num_levels - 1; i++) { in sumo_dpm_force_performance_level()
1948 for (i = 1; i < ps->num_levels; i++) { in sumo_dpm_force_performance_level()
1955 for (i = 0; i < ps->num_levels; i++) { in sumo_dpm_force_performance_level()