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 <petlozup@nvidia.com>
This commit is contained in:
Petlozu Pravareshwar
2024-03-17 17:48:13 +00:00
committed by Jon Hunter
parent a87e58326b
commit 54fc0656e6

View File

@@ -2,7 +2,7 @@
/* /*
* camera_common.c - utilities for tegra camera driver * 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 <linux/types.h> #include <linux/types.h>
#include <media/tegra-v4l2-camera.h> #include <media/tegra-v4l2-camera.h>
@@ -13,6 +13,7 @@
#include <soc/tegra/pmc.h> #include <soc/tegra/pmc.h>
#include <trace/events/camera_common.h> #include <trace/events/camera_common.h>
#include <soc/tegra/fuse.h> #include <soc/tegra/fuse.h>
#include <soc/tegra/fuse-helper.h>
#include <soc/tegra/tegra-i2c-rtcpu.h> #include <soc/tegra/tegra-i2c-rtcpu.h>
#include <linux/arm64-barrier.h> #include <linux/arm64-barrier.h>
#include <linux/nospec.h> #include <linux/nospec.h>
@@ -873,8 +874,14 @@ void camera_common_dpd_disable(struct camera_common_data *s_data)
return; return;
} }
if (atomic_inc_return( if (atomic_inc_return(
&camera_common_csi_io_pads[io_idx].ref) == 1) &camera_common_csi_io_pads[io_idx].ref) == 1) {
tegra_io_pad_power_enable(TEGRA_IO_PAD_CSIA + io_idx); 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, dev_dbg(s_data->dev,
"%s: csi %d\n", __func__, io_idx); "%s: csi %d\n", __func__, io_idx);
@@ -898,8 +905,14 @@ void camera_common_dpd_enable(struct camera_common_data *s_data)
return; return;
} }
if (atomic_dec_return( if (atomic_dec_return(
&camera_common_csi_io_pads[io_idx].ref) == 0) &camera_common_csi_io_pads[io_idx].ref) == 0) {
tegra_io_pad_power_disable(TEGRA_IO_PAD_CSIA + io_idx); 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, dev_dbg(s_data->dev,
"%s: csi %d\n", __func__, io_idx); "%s: csi %d\n", __func__, io_idx);