From 54fc0656e6c18efba95e3851f8f5dd14a1d12d60 Mon Sep 17 00:00:00 2001 From: Petlozu Pravareshwar Date: Sun, 17 Mar 2024 17:48:13 +0000 Subject: [PATCH] Camera: OOT: Add T264 specific PMC calls For Tegra264, new PMC driver is introduced to support instance specific driver data. As per the design, on Tegra264, if client drivers are using below PMC exported APIs, they need to pass their struct device pointer as an argument. Also it is expected that clients dt node should have "nvidia,pmc" property populated with appropriate PMC instance phandle. - *_io_pad_power_enable() - *_io_pad_power_disable() Bug 4470933 Change-Id: Idb41b95cd863f313496110a4e3c4b5ea61a1df8f Signed-off-by: Petlozu Pravareshwar --- .../platform/tegra/camera/camera_common.c | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/tegra/camera/camera_common.c b/drivers/media/platform/tegra/camera/camera_common.c index 97552c86..05143855 100644 --- a/drivers/media/platform/tegra/camera/camera_common.c +++ b/drivers/media/platform/tegra/camera/camera_common.c @@ -2,7 +2,7 @@ /* * camera_common.c - utilities for tegra camera driver * - * Copyright (c) 2015-2023, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2015-2024, NVIDIA CORPORATION. All rights reserved. */ #include #include @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -873,8 +874,14 @@ void camera_common_dpd_disable(struct camera_common_data *s_data) return; } if (atomic_inc_return( - &camera_common_csi_io_pads[io_idx].ref) == 1) - tegra_io_pad_power_enable(TEGRA_IO_PAD_CSIA + io_idx); + &camera_common_csi_io_pads[io_idx].ref) == 1) { + if (__tegra_get_chip_id() == TEGRA264) + tegra264_io_pad_power_enable(s_data->dev, + TEGRA_IO_PAD_CSIA + io_idx); + else + tegra_io_pad_power_enable( + TEGRA_IO_PAD_CSIA + io_idx); + } dev_dbg(s_data->dev, "%s: csi %d\n", __func__, io_idx); @@ -898,8 +905,14 @@ void camera_common_dpd_enable(struct camera_common_data *s_data) return; } if (atomic_dec_return( - &camera_common_csi_io_pads[io_idx].ref) == 0) - tegra_io_pad_power_disable(TEGRA_IO_PAD_CSIA + io_idx); + &camera_common_csi_io_pads[io_idx].ref) == 0) { + if (__tegra_get_chip_id() == TEGRA264) + tegra264_io_pad_power_disable(s_data->dev, + TEGRA_IO_PAD_CSIA + io_idx); + else + tegra_io_pad_power_disable( + TEGRA_IO_PAD_CSIA + io_idx); + } dev_dbg(s_data->dev, "%s: csi %d\n", __func__, io_idx);