mirror of
git://nv-tegra.nvidia.com/linux-hwpm.git
synced 2025-12-24 10:13:00 +03:00
tegra: hwpm: use consistent function names
- Update common function names to tegra_hwpm_* instead of tegra_soc_hwpm_*. - Update header guards to follow similar naming guidelines. Jira THWPM-41 Change-Id: If5ca4f136f5cb6659a99bae42030817142bd242c Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2675469 Reviewed-by: svcacv <svcacv@nvidia.com> Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com> Reviewed-by: Seema Khowala <seemaj@nvidia.com> Reviewed-by: Vasuki Shankar <vasukis@nvidia.com> GVS: Gerrit_Virtual_Submit
This commit is contained in:
committed by
mobile promotions
parent
edb9e2c245
commit
9adf6a080d
@@ -19,7 +19,7 @@
|
||||
#include <tegra_hwpm.h>
|
||||
|
||||
/* FIXME: This is a placeholder for now. We can add debugfs nodes as needed. */
|
||||
void tegra_soc_hwpm_debugfs_init(struct tegra_soc_hwpm *hwpm)
|
||||
void tegra_hwpm_debugfs_init(struct tegra_soc_hwpm *hwpm)
|
||||
{
|
||||
if (!hwpm) {
|
||||
tegra_hwpm_err(hwpm, "Invalid hwpm struct");
|
||||
@@ -44,7 +44,7 @@ fail:
|
||||
hwpm->debugfs_root = NULL;
|
||||
}
|
||||
|
||||
void tegra_soc_hwpm_debugfs_deinit(struct tegra_soc_hwpm *hwpm)
|
||||
void tegra_hwpm_debugfs_deinit(struct tegra_soc_hwpm *hwpm)
|
||||
{
|
||||
if (!hwpm) {
|
||||
tegra_hwpm_err(hwpm, "Invalid hwpm struct");
|
||||
|
||||
@@ -243,7 +243,7 @@ void tegra_hwpm_writel(struct tegra_soc_hwpm *hwpm,
|
||||
* Read a register from the EXEC_REG_OPS IOCTL. It is assumed that the allowlist
|
||||
* check has been done before calling this function.
|
||||
*/
|
||||
u32 regops_readl(struct tegra_soc_hwpm *hwpm,
|
||||
u32 tegra_hwpm_regops_readl(struct tegra_soc_hwpm *hwpm,
|
||||
struct hwpm_ip_aperture *aperture, u64 addr)
|
||||
{
|
||||
u32 reg_val = 0;
|
||||
@@ -269,7 +269,7 @@ u32 regops_readl(struct tegra_soc_hwpm *hwpm,
|
||||
* Write a register from the EXEC_REG_OPS IOCTL. It is assumed that the
|
||||
* allowlist check has been done before calling this function.
|
||||
*/
|
||||
void regops_writel(struct tegra_soc_hwpm *hwpm,
|
||||
void tegra_hwpm_regops_writel(struct tegra_soc_hwpm *hwpm,
|
||||
struct hwpm_ip_aperture *aperture, u64 addr, u32 val)
|
||||
{
|
||||
u64 reg_offset = 0ULL;
|
||||
|
||||
@@ -139,7 +139,7 @@ static int floorsweep_info_ioctl(struct tegra_soc_hwpm *hwpm,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return tegra_soc_hwpm_get_floorsweep_info(hwpm, fs_info);
|
||||
return tegra_hwpm_get_floorsweep_info(hwpm, fs_info);
|
||||
}
|
||||
|
||||
static int timer_relation_ioctl(struct tegra_soc_hwpm *hwpm,
|
||||
@@ -177,7 +177,7 @@ static int reserve_resource_ioctl(struct tegra_soc_hwpm *hwpm,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ret = tegra_soc_hwpm_reserve_resource(hwpm, resource);
|
||||
ret = tegra_hwpm_reserve_resource(hwpm, resource);
|
||||
if (ret < 0) {
|
||||
tegra_hwpm_err(hwpm, "Failed to reserve resource %d", resource);
|
||||
}
|
||||
@@ -224,7 +224,7 @@ static int bind_ioctl(struct tegra_soc_hwpm *hwpm,
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
ret = tegra_soc_hwpm_bind_resources(hwpm);
|
||||
ret = tegra_hwpm_bind_resources(hwpm);
|
||||
if (ret != 0) {
|
||||
tegra_hwpm_err(hwpm, "Failed to bind resources");
|
||||
} else {
|
||||
@@ -252,7 +252,7 @@ static int query_allowlist_ioctl(struct tegra_soc_hwpm *hwpm,
|
||||
/* Userspace is querying allowlist size only */
|
||||
if (hwpm->full_alist_size == 0) {
|
||||
/*Full alist size is not computed yet */
|
||||
ret = tegra_soc_hwpm_get_allowlist_size(hwpm);
|
||||
ret = tegra_hwpm_get_allowlist_size(hwpm);
|
||||
if (ret != 0) {
|
||||
tegra_hwpm_err(hwpm,
|
||||
"failed to get alist_size");
|
||||
@@ -262,7 +262,7 @@ static int query_allowlist_ioctl(struct tegra_soc_hwpm *hwpm,
|
||||
query_allowlist->allowlist_size = hwpm->full_alist_size;
|
||||
} else {
|
||||
/* Concatenate allowlists and return */
|
||||
ret = tegra_soc_hwpm_update_allowlist(hwpm, query_allowlist);
|
||||
ret = tegra_hwpm_update_allowlist(hwpm, query_allowlist);
|
||||
if (ret != 0) {
|
||||
tegra_hwpm_err(hwpm, "Failed to update full alist");
|
||||
return ret;
|
||||
@@ -280,7 +280,7 @@ static int exec_reg_ops_ioctl(struct tegra_soc_hwpm *hwpm,
|
||||
return -EPERM;
|
||||
}
|
||||
|
||||
return tegra_soc_hwpm_exec_regops(hwpm,
|
||||
return tegra_hwpm_exec_regops(hwpm,
|
||||
(struct tegra_soc_hwpm_exec_reg_ops *)ioctl_struct);
|
||||
}
|
||||
|
||||
@@ -305,7 +305,7 @@ static int update_get_put_ioctl(struct tegra_soc_hwpm *hwpm,
|
||||
return tegra_hwpm_update_mem_bytes(hwpm, update_get_put);
|
||||
}
|
||||
|
||||
static long tegra_soc_hwpm_ioctl(struct file *file,
|
||||
static long tegra_hwpm_ioctl(struct file *file,
|
||||
unsigned int cmd,
|
||||
unsigned long arg)
|
||||
{
|
||||
@@ -397,7 +397,7 @@ end:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int tegra_soc_hwpm_open(struct inode *inode, struct file *filp)
|
||||
static int tegra_hwpm_open(struct inode *inode, struct file *filp)
|
||||
{
|
||||
int ret = 0;
|
||||
unsigned int minor;
|
||||
@@ -474,13 +474,13 @@ static int tegra_soc_hwpm_open(struct inode *inode, struct file *filp)
|
||||
}
|
||||
}
|
||||
|
||||
ret = tegra_soc_hwpm_setup_hw(hwpm);
|
||||
ret = tegra_hwpm_setup_hw(hwpm);
|
||||
if (ret < 0) {
|
||||
tegra_hwpm_err(hwpm, "Failed to setup hw");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
ret = tegra_soc_hwpm_setup_sw(hwpm);
|
||||
ret = tegra_hwpm_setup_sw(hwpm);
|
||||
if (ret < 0) {
|
||||
tegra_hwpm_err(hwpm, "Failed to setup sw");
|
||||
goto fail;
|
||||
@@ -488,7 +488,7 @@ static int tegra_soc_hwpm_open(struct inode *inode, struct file *filp)
|
||||
|
||||
return 0;
|
||||
fail:
|
||||
ret = tegra_soc_hwpm_release_hw(hwpm);
|
||||
ret = tegra_hwpm_release_hw(hwpm);
|
||||
if (ret < 0) {
|
||||
tegra_hwpm_err(hwpm, "Failed to release hw");
|
||||
}
|
||||
@@ -497,7 +497,7 @@ fail:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static ssize_t tegra_soc_hwpm_read(struct file *file,
|
||||
static ssize_t tegra_hwpm_read(struct file *file,
|
||||
char __user *ubuf,
|
||||
size_t count,
|
||||
loff_t *offp)
|
||||
@@ -506,7 +506,7 @@ static ssize_t tegra_soc_hwpm_read(struct file *file,
|
||||
}
|
||||
|
||||
/* FIXME: Fix double release bug */
|
||||
static int tegra_soc_hwpm_release(struct inode *inode, struct file *filp)
|
||||
static int tegra_hwpm_release(struct inode *inode, struct file *filp)
|
||||
{
|
||||
int ret = 0;
|
||||
struct tegra_soc_hwpm *hwpm = NULL;
|
||||
@@ -538,7 +538,7 @@ static int tegra_soc_hwpm_release(struct inode *inode, struct file *filp)
|
||||
}
|
||||
|
||||
/* Disable and release reserved IPs */
|
||||
ret = tegra_soc_hwpm_release_resources(hwpm);
|
||||
ret = tegra_hwpm_release_resources(hwpm);
|
||||
if (ret < 0) {
|
||||
tegra_hwpm_err(hwpm, "Failed to release IP apertures");
|
||||
goto fail;
|
||||
@@ -551,7 +551,7 @@ static int tegra_soc_hwpm_release(struct inode *inode, struct file *filp)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
ret = tegra_soc_hwpm_release_hw(hwpm);
|
||||
ret = tegra_hwpm_release_hw(hwpm);
|
||||
if (ret < 0) {
|
||||
tegra_hwpm_err(hwpm, "Failed to release hw");
|
||||
goto fail;
|
||||
@@ -577,11 +577,11 @@ fail:
|
||||
/* File ops for device node */
|
||||
const struct file_operations tegra_soc_hwpm_ops = {
|
||||
.owner = THIS_MODULE,
|
||||
.open = tegra_soc_hwpm_open,
|
||||
.read = tegra_soc_hwpm_read,
|
||||
.release = tegra_soc_hwpm_release,
|
||||
.unlocked_ioctl = tegra_soc_hwpm_ioctl,
|
||||
.open = tegra_hwpm_open,
|
||||
.read = tegra_hwpm_read,
|
||||
.release = tegra_hwpm_release,
|
||||
.unlocked_ioctl = tegra_hwpm_ioctl,
|
||||
#ifdef CONFIG_COMPAT
|
||||
.compat_ioctl = tegra_soc_hwpm_ioctl,
|
||||
.compat_ioctl = tegra_hwpm_ioctl,
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -85,7 +85,7 @@ void tegra_soc_hwpm_ip_unregister(struct tegra_soc_hwpm_ip_ops *hwpm_ip_ops)
|
||||
}
|
||||
}
|
||||
|
||||
int tegra_soc_hwpm_get_floorsweep_info(struct tegra_soc_hwpm *hwpm,
|
||||
int tegra_hwpm_get_floorsweep_info(struct tegra_soc_hwpm *hwpm,
|
||||
struct tegra_soc_hwpm_ip_floorsweep_info *fs_info)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
@@ -36,7 +36,7 @@ static const struct of_device_id tegra_soc_hwpm_of_match[] = {
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, tegra_soc_hwpm_of_match);
|
||||
|
||||
static int tegra_soc_hwpm_probe(struct platform_device *pdev)
|
||||
static int tegra_hwpm_probe(struct platform_device *pdev)
|
||||
{
|
||||
int ret = 0;
|
||||
struct device *dev = NULL;
|
||||
@@ -125,8 +125,8 @@ static int tegra_soc_hwpm_probe(struct platform_device *pdev)
|
||||
}
|
||||
}
|
||||
|
||||
tegra_soc_hwpm_debugfs_init(hwpm);
|
||||
tegra_soc_hwpm_init_chip_info(hwpm);
|
||||
tegra_hwpm_debugfs_init(hwpm);
|
||||
tegra_hwpm_init_chip_info(hwpm);
|
||||
|
||||
/*
|
||||
* Currently VDK doesn't have a fmodel for SOC HWPM. Therefore, we
|
||||
@@ -169,7 +169,7 @@ success:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int tegra_soc_hwpm_remove(struct platform_device *pdev)
|
||||
static int tegra_hwpm_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct tegra_soc_hwpm *hwpm = NULL;
|
||||
|
||||
@@ -200,22 +200,22 @@ static int tegra_soc_hwpm_remove(struct platform_device *pdev)
|
||||
unregister_chrdev_region(hwpm->dev_t, 1);
|
||||
class_unregister(&hwpm->class);
|
||||
|
||||
tegra_soc_hwpm_debugfs_deinit(hwpm);
|
||||
tegra_soc_hwpm_release_sw_components(hwpm);
|
||||
tegra_hwpm_debugfs_deinit(hwpm);
|
||||
tegra_hwpm_release_sw_components(hwpm);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct platform_driver tegra_soc_hwpm_pdrv = {
|
||||
.probe = tegra_soc_hwpm_probe,
|
||||
.remove = tegra_soc_hwpm_remove,
|
||||
.probe = tegra_hwpm_probe,
|
||||
.remove = tegra_hwpm_remove,
|
||||
.driver = {
|
||||
.name = TEGRA_SOC_HWPM_MODULE_NAME,
|
||||
.of_match_table = of_match_ptr(tegra_soc_hwpm_of_match),
|
||||
},
|
||||
};
|
||||
|
||||
static int __init tegra_soc_hwpm_init(void)
|
||||
static int __init tegra_hwpm_init(void)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
@@ -226,13 +226,13 @@ static int __init tegra_soc_hwpm_init(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void __exit tegra_soc_hwpm_exit(void)
|
||||
static void __exit tegra_hwpm_exit(void)
|
||||
{
|
||||
platform_driver_unregister(&tegra_soc_hwpm_pdrv);
|
||||
}
|
||||
|
||||
postcore_initcall(tegra_soc_hwpm_init);
|
||||
module_exit(tegra_soc_hwpm_exit);
|
||||
postcore_initcall(tegra_hwpm_init);
|
||||
module_exit(tegra_hwpm_exit);
|
||||
|
||||
MODULE_ALIAS(TEGRA_SOC_HWPM_MODULE_NAME);
|
||||
MODULE_DESCRIPTION("Tegra SOC HWPM Driver");
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
#define LOG_BUF_SIZE 160
|
||||
|
||||
static void tegra_soc_hwpm_print(const char *func, int line,
|
||||
static void tegra_hwpm_print(const char *func, int line,
|
||||
int type, const char *log)
|
||||
{
|
||||
switch (type) {
|
||||
@@ -33,7 +33,7 @@ static void tegra_soc_hwpm_print(const char *func, int line,
|
||||
}
|
||||
}
|
||||
|
||||
void tegra_soc_err_impl(struct tegra_soc_hwpm *hwpm,
|
||||
void tegra_hwpm_err_impl(struct tegra_soc_hwpm *hwpm,
|
||||
const char *func, int line, const char *fmt, ...)
|
||||
{
|
||||
char log[LOG_BUF_SIZE];
|
||||
@@ -43,7 +43,7 @@ void tegra_soc_err_impl(struct tegra_soc_hwpm *hwpm,
|
||||
(void) vsnprintf(log, LOG_BUF_SIZE, fmt, args);
|
||||
va_end(args);
|
||||
|
||||
tegra_soc_hwpm_print(func, line, TEGRA_HWPM_ERROR, log);
|
||||
tegra_hwpm_print(func, line, TEGRA_HWPM_ERROR, log);
|
||||
}
|
||||
|
||||
void tegra_hwpm_dbg_impl(struct tegra_soc_hwpm *hwpm,
|
||||
@@ -60,5 +60,5 @@ void tegra_hwpm_dbg_impl(struct tegra_soc_hwpm *hwpm,
|
||||
(void) vsnprintf(log, LOG_BUF_SIZE, fmt, args);
|
||||
va_end(args);
|
||||
|
||||
tegra_soc_hwpm_print(func, line, TEGRA_HWPM_DEBUG, log);
|
||||
tegra_hwpm_print(func, line, TEGRA_HWPM_DEBUG, log);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user