DCE-KMD: Use OS abstraction for dce_device

- Use OS abstraction added to display/drivers/server
  for dce_device.

JIRA TDS-16052

Change-Id: I2339ad423ad38e8c3ba0f3205d80f172a4d0abe9
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3172565
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Arun Swain <arswain@nvidia.com>
This commit is contained in:
anupamg
2024-07-10 17:45:01 +00:00
committed by Jon Hunter
parent 8f1271978c
commit 0dfd61c0e7
4 changed files with 4 additions and 92 deletions

View File

@@ -10,6 +10,7 @@
#include <dce.h>
#include <dce-log.h>
#include <os-utils.h>
#include <os-dce-device.h>
#include <dce-debug-perf.h>
#include <interface/dce-interface.h>
#include <interface/dce-core-interface-errors.h>

View File

@@ -1,23 +1,12 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* SPDX-FileCopyrightText: Copyright (c) 2019-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: GPL-2.0-only
*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <nvidia/conftest.h>
#include <dce.h>
#include <os-dce-device.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/of_device.h>

View File

@@ -3,6 +3,7 @@
* SPDX-FileCopyrightText: Copyright (c) 2019-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
*/
#include <dce.h>
#include <os-dce-device.h>
#include <os-utils.h>
#include <linux/io.h>
#include <linux/slab.h>

View File

@@ -6,7 +6,6 @@
#ifndef TEGRA_DCE_H
#define TEGRA_DCE_H
#include <linux/cdev.h>
#include <types.h>
#include <dce-log.h>
#include <dce-ipc.h>
@@ -214,84 +213,6 @@ struct tegra_dce {
struct dce_firmware *fw_data;
};
/**
* struct dce_device - DCE data structure for storing
* linux device specific info.
*/
struct dce_device {
/**
* @d : OS agnostic dce struct. Stores all runitme info for dce cluster
* elements.
*/
struct tegra_dce d;
/**
* @dev : Pointer to DCE Cluster's Linux device struct.
*/
struct device *dev;
/**
* @pdata : Pointer to dce platform data struct.
*/
struct dce_platform_data *pdata;
/**
* @max_cpu_irqs : stores maximum no. os irqs from DCE cluster to CPU
* for this platform.
*/
u8 max_cpu_irqs;
/**
* @regs : Stores the cpu-mapped base address of DCE Cluster. Will be
* used for MMIO transactions to DCE elements.
*/
void __iomem *regs;
#ifdef CONFIG_DEBUG_FS
/**
* @debugfs : Debugfs node for DCE Linux device.
*/
struct dentry *debugfs;
/**
* @ext_test_status : Return code for external client tests run via
* debugfs
*/
s32 ext_test_status;
#endif
};
/**
* dce_device_from_dce - inline function to get linux os data from the
* os agnostic struct tegra_dc
* @d : Pointer to the os agnostic tegra_dce data structure.
*
* Return : pointer to struct dce_device
*/
static inline struct dce_device *dce_device_from_dce(struct tegra_dce *d)
{
return container_of(d, struct dce_device, d);
}
/**
* dev_from_dce - inline function to get linux device from the
* os agnostic struct tegra_dc
* @d : Pointer to the os agnostic tegra_dce data structure.
*
* Return : pointer to struct device
*/
static inline struct device *dev_from_dce(struct tegra_dce *d)
{
return dce_device_from_dce(d)->dev;
}
/**
* pdata_from_dce - inline function to get dce platform data from
* the os agnostic struct tegra_dc.
*
* @d : Pointer to the os agnostic tegra_dce data structure.
*
* Return : pointer to struct device
*/
static inline struct dce_platform_data *pdata_from_dce(struct tegra_dce *d)
{
return ((struct dce_device *)dev_get_drvdata(dev_from_dce(d)))->pdata;
}
/**
* dce_set_boot_complete - updates the current dce boot complete status.
*