nvidia-oot: imx318: fix probe failure

V4l2 ctrl values are 0 during init time s_ctrl call
from v4l2. Since framerate val parameter is 0, when
set_framerate_ex is called from set_ctrl_ex during
initialization for probing of imx318 sensor, this
results in invalid error and probe failure for imx318.

Assign framerate 'val' to a value from imx318 sensor
device-tree properties within the given range to avoid
probe failure due to this.

Bug 3692128

Change-Id: Ib5f50e64f99c8443bf604066eda315dc96fbde03
Signed-off-by: Shubham Chandra <shubhamc@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3089350
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Praveen AC <pac@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Shubham Chandra
2024-03-05 05:04:15 +00:00
committed by mobile promotions
parent f9ed570c2b
commit 17e0946ce0

View File

@@ -1,5 +1,9 @@
// SPDX-License-Identifier: GPL-2.0
// Copyright (c) 2017-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-FileCopyrightText: Copyright (c) 2017-2024 NVIDIA CORPORATION & AFFILIATES.
// All rights reserved.
//
// nv_imx318.c - imx318 sensor driver
//
#include <nvidia/conftest.h>
@@ -131,6 +135,11 @@ static int imx318_set_frame_rate_ex(struct tegracam_device *tc_dev,
u8 fl_arr[2];
int err = 0;
if (val < mode->control_properties.min_framerate)
val = mode->control_properties.min_framerate;
else if (val > mode->control_properties.max_framerate)
val = mode->control_properties.max_framerate;
if (mode->image_properties.line_length == 0 ||
val == 0) {
return -EINVAL;