diff --git a/drivers/media/i2c/nv_imx318.c b/drivers/media/i2c/nv_imx318.c index 2a8276f0..85ed0129 100644 --- a/drivers/media/i2c/nv_imx318.c +++ b/drivers/media/i2c/nv_imx318.c @@ -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 @@ -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;