mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
video: tegra: Don't use nvhost_get_private_data
The function nvhost_get_private_data() is a wrapper around the Linux
platform_get_drvdata() function. To remove all the legacy nvhost code
that is no longer supported or needed, update the camera drivers to use
platform_get_drvdata() directly. Note that there are places in these
drivers that already use platform_get_drvdata() and so this change makes
these drivers more consistent.
Bug 4475969
Change-Id: Ie474c46c438f69c2141f41d0702bf57525597ab5
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3065974
(cherry picked from commit 73a4985dbd)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3066024
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
7f293be0be
commit
34ef06bd12
@@ -1,7 +1,5 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-only
|
// SPDX-License-Identifier: GPL-2.0-only
|
||||||
/*
|
// SPDX-FileCopyrightText: Copyright (c) 2017-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||||
* SPDX-FileCopyrightText: Copyright (C) 2017-2023 NVIDIA CORPORATION. All rights reserved.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <asm/ioctls.h>
|
#include <asm/ioctls.h>
|
||||||
#include <linux/clk.h>
|
#include <linux/clk.h>
|
||||||
@@ -49,14 +47,16 @@ static int isp5_alloc_syncpt(struct platform_device *pdev,
|
|||||||
const char *name,
|
const char *name,
|
||||||
uint32_t *syncpt_id)
|
uint32_t *syncpt_id)
|
||||||
{
|
{
|
||||||
struct host_isp5 *isp5 = nvhost_get_private_data(pdev);
|
struct nvhost_device_data *info = platform_get_drvdata(pdev);
|
||||||
|
struct host_isp5 *isp5 = info->private_data;
|
||||||
|
|
||||||
return capture_alloc_syncpt(isp5->isp_thi, name, syncpt_id);
|
return capture_alloc_syncpt(isp5->isp_thi, name, syncpt_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void isp5_release_syncpt(struct platform_device *pdev, uint32_t id)
|
static void isp5_release_syncpt(struct platform_device *pdev, uint32_t id)
|
||||||
{
|
{
|
||||||
struct host_isp5 *isp5 = nvhost_get_private_data(pdev);
|
struct nvhost_device_data *info = platform_get_drvdata(pdev);
|
||||||
|
struct host_isp5 *isp5 = info->private_data;
|
||||||
|
|
||||||
capture_release_syncpt(isp5->isp_thi, id);
|
capture_release_syncpt(isp5->isp_thi, id);
|
||||||
}
|
}
|
||||||
@@ -67,7 +67,8 @@ static int isp5_get_syncpt_gos_backing(struct platform_device *pdev,
|
|||||||
uint32_t *gos_index,
|
uint32_t *gos_index,
|
||||||
uint32_t *gos_offset)
|
uint32_t *gos_offset)
|
||||||
{
|
{
|
||||||
struct host_isp5 *isp5 = nvhost_get_private_data(pdev);
|
struct nvhost_device_data *info = platform_get_drvdata(pdev);
|
||||||
|
struct host_isp5 *isp5 = info->private_data;
|
||||||
|
|
||||||
return capture_get_syncpt_gos_backing(isp5->isp_thi, id,
|
return capture_get_syncpt_gos_backing(isp5->isp_thi, id,
|
||||||
syncpt_addr, gos_index, gos_offset);
|
syncpt_addr, gos_index, gos_offset);
|
||||||
@@ -77,7 +78,8 @@ static int isp5_get_syncpt_gos_backing(struct platform_device *pdev,
|
|||||||
static uint32_t isp5_get_gos_table(struct platform_device *pdev,
|
static uint32_t isp5_get_gos_table(struct platform_device *pdev,
|
||||||
const dma_addr_t **table)
|
const dma_addr_t **table)
|
||||||
{
|
{
|
||||||
struct host_isp5 *isp5 = nvhost_get_private_data(pdev);
|
struct nvhost_device_data *info = platform_get_drvdata(pdev);
|
||||||
|
struct host_isp5 *isp5 = info->private_data;
|
||||||
uint32_t count;
|
uint32_t count;
|
||||||
|
|
||||||
capture_get_gos_table(isp5->isp_thi, &count, table);
|
capture_get_gos_table(isp5->isp_thi, &count, table);
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-only
|
// SPDX-License-Identifier: GPL-2.0-only
|
||||||
|
// SPDX-FileCopyrightText: Copyright (c) 2017-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||||
/*
|
/*
|
||||||
|
<<<<<<< HEAD (246e62 video: tegra: remove icc request in system resume)
|
||||||
* SPDX-FileCopyrightText: Copyright (C) 2017-2023 NVIDIA CORPORATION. All rights reserved.
|
* SPDX-FileCopyrightText: Copyright (C) 2017-2023 NVIDIA CORPORATION. All rights reserved.
|
||||||
|
=======
|
||||||
|
* VI5 driver
|
||||||
|
>>>>>>> CHANGE (73a498 video: tegra: Don't use nvhost_get_private_data)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <asm/ioctls.h>
|
#include <asm/ioctls.h>
|
||||||
@@ -70,7 +75,8 @@ static int vi5_alloc_syncpt(struct platform_device *pdev,
|
|||||||
const char *name,
|
const char *name,
|
||||||
uint32_t *syncpt_id)
|
uint32_t *syncpt_id)
|
||||||
{
|
{
|
||||||
struct host_vi5 *vi5 = nvhost_get_private_data(pdev);
|
struct nvhost_device_data *info = platform_get_drvdata(pdev);
|
||||||
|
struct host_vi5 *vi5 = info->private_data;
|
||||||
|
|
||||||
return capture_alloc_syncpt(vi5->vi_thi, name, syncpt_id);
|
return capture_alloc_syncpt(vi5->vi_thi, name, syncpt_id);
|
||||||
}
|
}
|
||||||
@@ -100,7 +106,8 @@ int nvhost_vi5_aggregate_constraints(struct platform_device *dev,
|
|||||||
|
|
||||||
static void vi5_release_syncpt(struct platform_device *pdev, uint32_t id)
|
static void vi5_release_syncpt(struct platform_device *pdev, uint32_t id)
|
||||||
{
|
{
|
||||||
struct host_vi5 *vi5 = nvhost_get_private_data(pdev);
|
struct nvhost_device_data *info = platform_get_drvdata(pdev);
|
||||||
|
struct host_vi5 *vi5 = info->private_data;
|
||||||
|
|
||||||
capture_release_syncpt(vi5->vi_thi, id);
|
capture_release_syncpt(vi5->vi_thi, id);
|
||||||
}
|
}
|
||||||
@@ -108,7 +115,8 @@ static void vi5_release_syncpt(struct platform_device *pdev, uint32_t id)
|
|||||||
static void vi5_get_gos_table(struct platform_device *pdev, int *count,
|
static void vi5_get_gos_table(struct platform_device *pdev, int *count,
|
||||||
const dma_addr_t **table)
|
const dma_addr_t **table)
|
||||||
{
|
{
|
||||||
struct host_vi5 *vi5 = nvhost_get_private_data(pdev);
|
struct nvhost_device_data *info = platform_get_drvdata(pdev);
|
||||||
|
struct host_vi5 *vi5 = info->private_data;
|
||||||
|
|
||||||
capture_get_gos_table(vi5->vi_thi, count, table);
|
capture_get_gos_table(vi5->vi_thi, count, table);
|
||||||
}
|
}
|
||||||
@@ -119,7 +127,8 @@ static int vi5_get_syncpt_gos_backing(struct platform_device *pdev,
|
|||||||
uint32_t *gos_index,
|
uint32_t *gos_index,
|
||||||
uint32_t *gos_offset)
|
uint32_t *gos_offset)
|
||||||
{
|
{
|
||||||
struct host_vi5 *vi5 = nvhost_get_private_data(pdev);
|
struct nvhost_device_data *info = platform_get_drvdata(pdev);
|
||||||
|
struct host_vi5 *vi5 = info->private_data;
|
||||||
|
|
||||||
return capture_get_syncpt_gos_backing(vi5->vi_thi, id,
|
return capture_get_syncpt_gos_backing(vi5->vi_thi, id,
|
||||||
syncpt_addr, gos_index, gos_offset);
|
syncpt_addr, gos_index, gos_offset);
|
||||||
@@ -386,7 +395,8 @@ MODULE_DEVICE_TABLE(of, tegra_vi5_of_match);
|
|||||||
static int vi_runtime_suspend(struct device *dev)
|
static int vi_runtime_suspend(struct device *dev)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct platform_device *pdev = to_platform_device(dev);
|
||||||
struct host_vi5 *vi5 = nvhost_get_private_data(pdev);
|
struct nvhost_device_data *info = platform_get_drvdata(pdev);
|
||||||
|
struct host_vi5 *vi5 = info->private_data;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
if (nvhost_module_pm_ops.runtime_suspend != NULL) {
|
if (nvhost_module_pm_ops.runtime_suspend != NULL) {
|
||||||
@@ -407,7 +417,8 @@ static int vi_runtime_suspend(struct device *dev)
|
|||||||
static int vi_runtime_resume(struct device *dev)
|
static int vi_runtime_resume(struct device *dev)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct platform_device *pdev = to_platform_device(dev);
|
||||||
struct host_vi5 *vi5 = nvhost_get_private_data(pdev);
|
struct nvhost_device_data *pdata = platform_get_drvdata(pdev);
|
||||||
|
struct host_vi5 *vi5 = pdata->private_data;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
if (nvhost_module_pm_ops.runtime_resume != NULL) {
|
if (nvhost_module_pm_ops.runtime_resume != NULL) {
|
||||||
|
|||||||
Reference in New Issue
Block a user