From 34ef06bd128678a7a336ecc86f140be763c2bd1f Mon Sep 17 00:00:00 2001 From: Jon Hunter Date: Mon, 29 Jan 2024 20:21:05 +0000 Subject: [PATCH] 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 Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3065974 (cherry picked from commit 73a4985dbd8fd8f2bdd7747a3b936ce37760aaa2) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3066024 Reviewed-by: Laxman Dewangan GVS: Gerrit_Virtual_Submit --- drivers/video/tegra/host/isp/isp5.c | 16 +++++++++------- drivers/video/tegra/host/vi/vi5.c | 23 +++++++++++++++++------ 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/drivers/video/tegra/host/isp/isp5.c b/drivers/video/tegra/host/isp/isp5.c index bac6e85c..08512391 100644 --- a/drivers/video/tegra/host/isp/isp5.c +++ b/drivers/video/tegra/host/isp/isp5.c @@ -1,7 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-only -/* - * SPDX-FileCopyrightText: Copyright (C) 2017-2023 NVIDIA CORPORATION. All rights reserved. - */ +// SPDX-FileCopyrightText: Copyright (c) 2017-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. #include #include @@ -49,14 +47,16 @@ static int isp5_alloc_syncpt(struct platform_device *pdev, const char *name, 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); } 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); } @@ -67,7 +67,8 @@ static int isp5_get_syncpt_gos_backing(struct platform_device *pdev, uint32_t *gos_index, 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, 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, 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; capture_get_gos_table(isp5->isp_thi, &count, table); diff --git a/drivers/video/tegra/host/vi/vi5.c b/drivers/video/tegra/host/vi/vi5.c index 799d1613..a455b3b1 100644 --- a/drivers/video/tegra/host/vi/vi5.c +++ b/drivers/video/tegra/host/vi/vi5.c @@ -1,6 +1,11 @@ // 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. +======= + * VI5 driver +>>>>>>> CHANGE (73a498 video: tegra: Don't use nvhost_get_private_data) */ #include @@ -70,7 +75,8 @@ static int vi5_alloc_syncpt(struct platform_device *pdev, const char *name, 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); } @@ -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) { - 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); } @@ -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, 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); } @@ -119,7 +127,8 @@ static int vi5_get_syncpt_gos_backing(struct platform_device *pdev, uint32_t *gos_index, 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, 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) { 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; 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) { 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; if (nvhost_module_pm_ops.runtime_resume != NULL) {