mirror of
git://nv-tegra.nvidia.com/linux-hwpm.git
synced 2025-12-24 02:07:34 +03:00
tegra: hwpm: combine common functionality
- Many HWPM functions are performed on all apertures of all instances of all IPs. Define below resource utility functions to perform a task on all IPs, instances and apertures: - tegra_hwpm_func_all_IPs - tegra_hwpm_func_single_ip - tegra_hwpm_func_all_instance - tegra_hwpm_func_single_instance - tegra_hwpm_func_all_perfmuxes - tegra_hwpm_func_all_perfmons - tegra_hwpm_func_single_aperture - Modify below functions to use above mentioned utility functions: - get allowlist size - combine allowlist - reserve resources - bind resources - release resources This will make code more legible and maintainable. This patch also defines new function that validates all HAL initializations for the chip. Jira THWPM-41 Change-Id: Icaeba4d94187b97022c0a6626584e7d61ab6d0e4 Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2705524 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com> Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com> Reviewed-by: Vasuki Shankar <vasukis@nvidia.com> Reviewed-by: Seema Khowala <seemaj@nvidia.com> GVS: Gerrit_Virtual_Submit
This commit is contained in:
committed by
mobile promotions
parent
c5b3d09518
commit
25f0737897
@@ -106,10 +106,6 @@ void tegra_soc_hwpm_ip_register(struct tegra_soc_hwpm_ip_ops *hwpm_ip_ops)
|
||||
tegra_hwpm_dbg(hwpm, hwpm_info,
|
||||
"Register IP 0x%llx", hwpm_ip_ops->ip_base_address);
|
||||
|
||||
if (hwpm->active_chip->extract_ip_ops == NULL) {
|
||||
tegra_hwpm_err(hwpm, "extract_ip_ops uninitialized");
|
||||
return;
|
||||
}
|
||||
ret = hwpm->active_chip->extract_ip_ops(hwpm,
|
||||
hwpm_ip_ops, REGISTER_IP);
|
||||
if (ret < 0) {
|
||||
@@ -141,10 +137,6 @@ void tegra_soc_hwpm_ip_unregister(struct tegra_soc_hwpm_ip_ops *hwpm_ip_ops)
|
||||
tegra_hwpm_dbg(hwpm, hwpm_info,
|
||||
"Unregister IP 0x%llx", hwpm_ip_ops->ip_base_address);
|
||||
|
||||
if (hwpm->active_chip->extract_ip_ops == NULL) {
|
||||
tegra_hwpm_err(hwpm, "extract_ip_ops uninitialized");
|
||||
return;
|
||||
}
|
||||
ret = hwpm->active_chip->extract_ip_ops(hwpm,
|
||||
hwpm_ip_ops, UNREGISTER_IP);
|
||||
if (ret < 0) {
|
||||
@@ -162,11 +154,6 @@ int tegra_hwpm_get_floorsweep_info(struct tegra_soc_hwpm *hwpm,
|
||||
|
||||
tegra_hwpm_fn(hwpm, " ");
|
||||
|
||||
if (hwpm->active_chip->get_fs_info == NULL) {
|
||||
tegra_hwpm_err(hwpm, "get_fs_info uninitialized");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
for (i = 0U; i < fs_info->num_queries; i++) {
|
||||
ret = hwpm->active_chip->get_fs_info(
|
||||
hwpm, (u32)fs_info->ip_fsinfo[i].ip_type,
|
||||
|
||||
Reference in New Issue
Block a user