build/patch/kernel/archive/sunxi-6.1/patches.megous/media-ov5640-Add-more-framerates-to-the-driver-some-of-them-eve.patch

57 lines
1.6 KiB
Diff

From 4b413ac6c026092e5fa31ac9dfaca5ed6517e625 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Fri, 24 Jan 2020 18:25:12 +0100
Subject: [PATCH 047/389] media: ov5640: Add more framerates to the driver
(some of them even work!)
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
drivers/media/i2c/ov5640.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c
index 2d740397a5d4..4e3ed1987235 100644
--- a/drivers/media/i2c/ov5640.c
+++ b/drivers/media/i2c/ov5640.c
@@ -133,7 +133,11 @@ enum ov5640_mode_id {
};
enum ov5640_frame_rate {
- OV5640_15_FPS = 0,
+ OV5640_2_FPS = 0,
+ OV5640_3_FPS,
+ OV5640_5_FPS,
+ OV5640_7_FPS,
+ OV5640_15_FPS,
OV5640_30_FPS,
OV5640_60_FPS,
OV5640_NUM_FRAMERATES,
@@ -343,6 +347,10 @@ MODULE_PARM_DESC(virtual_channel,
"MIPI CSI-2 virtual channel (0..3), default 0");
static const int ov5640_framerates[] = {
+ [OV5640_2_FPS] = 2,
+ [OV5640_3_FPS] = 3,
+ [OV5640_5_FPS] = 5,
+ [OV5640_7_FPS] = 7,
[OV5640_15_FPS] = 15,
[OV5640_30_FPS] = 30,
[OV5640_60_FPS] = 60,
@@ -2718,11 +2726,11 @@ static int ov5640_try_frame_interval(struct ov5640_dev *sensor,
u32 width, u32 height)
{
const struct ov5640_mode_info *mode;
- enum ov5640_frame_rate rate = OV5640_15_FPS;
+ enum ov5640_frame_rate rate = OV5640_2_FPS;
int minfps, maxfps, best_fps, fps;
int i;
- minfps = ov5640_framerates[OV5640_15_FPS];
+ minfps = ov5640_framerates[OV5640_2_FPS];
maxfps = ov5640_framerates[OV5640_60_FPS];
if (fi->numerator == 0) {
--
2.35.3