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
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Jon Hunter
2024-01-29 20:21:05 +00:00
committed by mobile promotions
parent 072a881099
commit 73a4985dbd
2 changed files with 22 additions and 15 deletions

View File

@@ -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);

View File

@@ -1,8 +1,7 @@
// 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.
/* /*
* VI5 driver * VI5 driver
*
* Copyright (c) 2017-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
*/ */
#include <asm/ioctls.h> #include <asm/ioctls.h>
@@ -71,7 +70,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);
} }
@@ -101,7 +101,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);
} }
@@ -109,7 +110,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);
} }
@@ -120,7 +122,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);
@@ -368,7 +371,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) {
@@ -389,7 +393,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) {