Files
linux-hwpm/drivers/tegra/hwpm/os/linux/driver.h
Vedashree Vidwans 7c1ae11f78 tegra: hwpm: move files to appropriate path
HWPM files are copied from the previous source in linux-nvidia repo
withgit history. Create folders and move files to obtain expected folder
structure.

Bug 3787076

Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
2022-10-05 16:05:20 -07:00

82 lines
2.1 KiB
C

/*
* 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_DRIVER_H
#define TEGRA_HWPM_OS_LINUX_DRIVER_H
#include <linux/platform_device.h>
#include <linux/device.h>
#include <linux/cdev.h>
#include <linux/delay.h>
#include <tegra_hwpm.h>
#include <uapi/linux/tegra-soc-hwpm-uapi.h>
#define TEGRA_SOC_HWPM_MODULE_NAME "tegra-soc-hwpm"
extern struct platform_device *tegra_soc_hwpm_pdev;
extern const struct file_operations tegra_hwpm_ops;
typedef struct tegra_hwpm_linux_atomic_t {
atomic_t var;
} tegra_hwpm_atomic_t;
struct hwpm_ip_register_list {
struct tegra_soc_hwpm_ip_ops ip_ops;
struct hwpm_ip_register_list *next;
};
extern struct hwpm_ip_register_list *ip_register_list_head;
struct tegra_hwpm_os_linux {
struct tegra_soc_hwpm hwpm;
/* Device */
struct platform_device *pdev;
struct device *dev;
struct device_node *np;
struct class class;
dev_t dev_t;
struct cdev cdev;
/* Clocks and resets */
struct clk *la_clk;
struct clk *la_parent_clk;
struct reset_control *la_rst;
struct reset_control *hwpm_rst;
/* Device info */
struct tegra_soc_hwpm_device_info device_info;
/* Reference count */
tegra_hwpm_atomic_t usage_count;
#ifdef CONFIG_DEBUG_FS
struct dentry *debugfs_root;
#endif
};
static inline struct tegra_hwpm_os_linux *tegra_hwpm_os_linux_from_cdev(
struct cdev *cdev)
{
return container_of(cdev, struct tegra_hwpm_os_linux, cdev);
}
static inline struct tegra_hwpm_os_linux *tegra_hwpm_os_linux_from_hwpm(
struct tegra_soc_hwpm *hwpm)
{
return container_of(hwpm, struct tegra_hwpm_os_linux, hwpm);
}
#endif /* TEGRA_HWPM_OS_LINUX_DRIVER_H */