media: camera: Fix build for Linux v5.16+

Building the Tegra camera drivers with Linux v5.16+ kernels fail because
the driver does not use the correct kernel version for handling various
API changes in upstream. Update ther kernel version appropriately so
that the camera drivers can build with Linux v5.16+ kernels.

Change-Id: I4c110d12f554fd4aa757a1aa9a42a81be5a87ae6
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2831219
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Jon Hunter
2022-12-20 09:55:46 +00:00
committed by mobile promotions
parent 891c93a8fb
commit c86c642f5b
4 changed files with 10 additions and 10 deletions

View File

@@ -940,7 +940,7 @@ int camera_common_get_mbus_config(struct v4l2_subdev *sd,
* then return an error * then return an error
*/ */
cfg->type = V4L2_MBUS_CSI2_DPHY; cfg->type = V4L2_MBUS_CSI2_DPHY;
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0)
cfg->flags = V4L2_MBUS_CSI2_4_LANE | cfg->flags = V4L2_MBUS_CSI2_4_LANE |
V4L2_MBUS_CSI2_CHANNEL_0 | V4L2_MBUS_CSI2_CHANNEL_0 |
V4L2_MBUS_CSI2_CONTINUOUS_CLOCK; V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;

View File

@@ -494,7 +494,7 @@ int capture_common_setup_progress_status_notifier(
uint32_t mem_offset) uint32_t mem_offset)
{ {
struct dma_buf *dmabuf; struct dma_buf *dmabuf;
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0)
struct dma_buf_map map; struct dma_buf_map map;
#else #else
struct iosys_map map; struct iosys_map map;
@@ -541,7 +541,7 @@ int capture_common_release_progress_status_notifier(
{ {
struct dma_buf *dmabuf = progress_status_notifier->buf; struct dma_buf *dmabuf = progress_status_notifier->buf;
void *va = progress_status_notifier->va; void *va = progress_status_notifier->va;
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0)
struct dma_buf_map map = DMA_BUF_MAP_INIT_VADDR(va); struct dma_buf_map map = DMA_BUF_MAP_INIT_VADDR(va);
#else #else
struct iosys_map map = IOSYS_MAP_INIT_VADDR(va); struct iosys_map map = IOSYS_MAP_INIT_VADDR(va);
@@ -597,7 +597,7 @@ int capture_common_pin_memory(
struct capture_common_buf *unpin_data) struct capture_common_buf *unpin_data)
{ {
struct dma_buf *buf; struct dma_buf *buf;
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0)
struct dma_buf_map map; struct dma_buf_map map;
#else #else
struct iosys_map map; struct iosys_map map;
@@ -650,7 +650,7 @@ EXPORT_SYMBOL_GPL(capture_common_pin_memory);
void capture_common_unpin_memory( void capture_common_unpin_memory(
struct capture_common_buf *unpin_data) struct capture_common_buf *unpin_data)
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0)
struct dma_buf_map map = DMA_BUF_MAP_INIT_VADDR(unpin_data->va); struct dma_buf_map map = DMA_BUF_MAP_INIT_VADDR(unpin_data->va);
#else #else
struct iosys_map map = IOSYS_MAP_INIT_VADDR(unpin_data->va); struct iosys_map map = IOSYS_MAP_INIT_VADDR(unpin_data->va);

View File

@@ -341,7 +341,7 @@ static int isp_capture_setup_inputfences(
void *reloc_page_addr = NULL; void *reloc_page_addr = NULL;
struct isp_capture *capture = chan->capture_data; struct isp_capture *capture = chan->capture_data;
void *vmap_base = NULL; void *vmap_base = NULL;
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0)
struct dma_buf_map map; struct dma_buf_map map;
#else #else
struct iosys_map map; struct iosys_map map;
@@ -427,7 +427,7 @@ static int isp_capture_setup_prefences(
void *reloc_page_addr = NULL; void *reloc_page_addr = NULL;
struct isp_capture *capture = chan->capture_data; struct isp_capture *capture = chan->capture_data;
void *vmap_base = NULL; void *vmap_base = NULL;
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0)
struct dma_buf_map map; struct dma_buf_map map;
#else #else
struct iosys_map map; struct iosys_map map;

View File

@@ -382,7 +382,7 @@ void tegra_vi_graph_cleanup(struct tegra_mc_vi *vi)
struct tegra_channel *chan; struct tegra_channel *chan;
list_for_each_entry(chan, &vi->vi_chans, list) { list_for_each_entry(chan, &vi->vi_chans, list) {
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)
v4l2_async_notifier_unregister(&chan->notifier); v4l2_async_notifier_unregister(&chan->notifier);
#else #else
v4l2_async_nf_unregister(&chan->notifier); v4l2_async_nf_unregister(&chan->notifier);
@@ -613,7 +613,7 @@ int tegra_vi_graph_init(struct tegra_mc_vi *vi)
num_subdevs = chan->num_subdevs; num_subdevs = chan->num_subdevs;
i = 0; i = 0;
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)
v4l2_async_notifier_init(&chan->notifier); v4l2_async_notifier_init(&chan->notifier);
list_for_each_entry(entity, &chan->entities, list) list_for_each_entry(entity, &chan->entities, list)
__v4l2_async_notifier_add_subdev(&chan->notifier, &entity->asd); __v4l2_async_notifier_add_subdev(&chan->notifier, &entity->asd);
@@ -627,7 +627,7 @@ int tegra_vi_graph_init(struct tegra_mc_vi *vi)
chan->subdevs_bound = 0; chan->subdevs_bound = 0;
/* Register the async notifier for this channel */ /* Register the async notifier for this channel */
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)
ret = v4l2_async_notifier_register(&vi->v4l2_dev, ret = v4l2_async_notifier_register(&vi->v4l2_dev,
&chan->notifier); &chan->notifier);
#else #else