tegra: hwpm: add wrappers for io functions

In an effort to make HWPM driver OS agnostic, add wrappers for io
functions.

Jira THWPM-59

Change-Id: I9309ee15a965aa3d2f122ef959eec211c9a84623
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2738156
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:
Vedashree Vidwans
2022-06-30 00:25:23 -07:00
committed by mobile promotions
parent c893ae2cd9
commit 42a33fd9d0
4 changed files with 86 additions and 19 deletions

34
os/linux/io_utils.h Normal file
View File

@@ -0,0 +1,34 @@
/*
* Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*/
#ifndef TEGRA_HWPM_OS_LINUX_IO_UTILS_H
#define TEGRA_HWPM_OS_LINUX_IO_UTILS_H
struct tegra_soc_hwpm;
struct hwpm_ip_inst;
struct hwpm_ip_aperture;
int tegra_hwpm_read_sticky_bits_impl(struct tegra_soc_hwpm *hwpm,
u64 reg_base, u64 reg_offset, u32 *val);
int tegra_hwpm_readl_impl(struct tegra_soc_hwpm *hwpm,
struct hwpm_ip_aperture *aperture, u64 addr, u32 *val);
int tegra_hwpm_writel_impl(struct tegra_soc_hwpm *hwpm,
struct hwpm_ip_aperture *aperture, u64 addr, u32 val);
int tegra_hwpm_regops_readl_impl(struct tegra_soc_hwpm *hwpm,
struct hwpm_ip_inst *ip_inst, struct hwpm_ip_aperture *aperture,
u64 addr, u32 *val);
int tegra_hwpm_regops_writel_impl(struct tegra_soc_hwpm *hwpm,
struct hwpm_ip_inst *ip_inst, struct hwpm_ip_aperture *aperture,
u64 addr, u32 val);
#endif /* TEGRA_HWPM_OS_LINUX_IO_UTILS_H */