From c893ae2cd9f955be0892b74cc0ef0341932e85d6 Mon Sep 17 00:00:00 2001 From: Vedashree Vidwans Date: Wed, 29 Jun 2022 21:29:26 -0700 Subject: [PATCH] tegra: hwpm: move regops functions to os folder Regops functions refer to linux uapi structures. As an effort to make HWPM driver OS agnostic, move regops functions to os linux folder. Jira THWPM-59 Change-Id: Ia06c4da5c91a59b088678daaaf6063d70af99177 Signed-off-by: Vedashree Vidwans Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2738155 Reviewed-by: svc_kernel_abi Reviewed-by: Vasuki Shankar Reviewed-by: Seema Khowala GVS: Gerrit_Virtual_Submit --- Makefile | 2 +- include/tegra_hwpm_common.h | 2 -- os/linux/ioctl.c | 1 + common/regops.c => os/linux/regops_utils.c | 3 +-- os/linux/regops_utils.h | 23 ++++++++++++++++++++++ 5 files changed, 26 insertions(+), 5 deletions(-) rename common/regops.c => os/linux/regops_utils.c (99%) create mode 100644 os/linux/regops_utils.h diff --git a/Makefile b/Makefile index 90cd2cf..078f93f 100644 --- a/Makefile +++ b/Makefile @@ -16,11 +16,11 @@ obj-y += os/linux/ioctl.o obj-y += os/linux/kmem.o obj-y += os/linux/log.o obj-y += os/linux/mem_mgmt_utils.o +obj-y += os/linux/regops_utils.o obj-y += common/allowlist.o obj-y += common/aperture.o obj-y += common/ip.o -obj-y += common/regops.o obj-y += common/resource.o obj-y += common/init.o diff --git a/include/tegra_hwpm_common.h b/include/tegra_hwpm_common.h index dc36ded..c80c660 100644 --- a/include/tegra_hwpm_common.h +++ b/include/tegra_hwpm_common.h @@ -65,8 +65,6 @@ int tegra_hwpm_ip_handle_power_mgmt(struct tegra_soc_hwpm *hwpm, int tegra_hwpm_get_allowlist_size(struct tegra_soc_hwpm *hwpm); int tegra_hwpm_combine_alist(struct tegra_soc_hwpm *hwpm, u64 *alist); -int tegra_hwpm_exec_regops(struct tegra_soc_hwpm *hwpm, - struct tegra_soc_hwpm_exec_reg_ops *exec_reg_ops); int tegra_hwpm_setup_hw(struct tegra_soc_hwpm *hwpm); int tegra_hwpm_setup_sw(struct tegra_soc_hwpm *hwpm); diff --git a/os/linux/ioctl.c b/os/linux/ioctl.c index 06c217c..eedec54 100644 --- a/os/linux/ioctl.c +++ b/os/linux/ioctl.c @@ -30,6 +30,7 @@ #include #include #include +#include #define LA_CLK_RATE 625000000UL diff --git a/common/regops.c b/os/linux/regops_utils.c similarity index 99% rename from common/regops.c rename to os/linux/regops_utils.c index 4ce975e..417f445 100644 --- a/common/regops.c +++ b/os/linux/regops_utils.c @@ -11,8 +11,6 @@ * more details. */ -#include - #include #include @@ -20,6 +18,7 @@ #include #include #include +#include static int tegra_hwpm_exec_reg_ops(struct tegra_soc_hwpm *hwpm, struct tegra_soc_hwpm_reg_op *reg_op) diff --git a/os/linux/regops_utils.h b/os/linux/regops_utils.h new file mode 100644 index 0000000..afeb658 --- /dev/null +++ b/os/linux/regops_utils.h @@ -0,0 +1,23 @@ +/* + * 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_REGOPS_UTILS_H +#define TEGRA_HWPM_OS_LINUX_REGOPS_UTILS_H + +struct tegra_soc_hwpm; +struct tegra_soc_hwpm_exec_reg_ops; + +int tegra_hwpm_exec_regops(struct tegra_soc_hwpm *hwpm, + struct tegra_soc_hwpm_exec_reg_ops *exec_reg_ops); + +#endif /* TEGRA_HWPM_OS_LINUX_REGOPS_UTILS_H */ \ No newline at end of file