diff options
author | Álvaro Fernández Rojas <noltari@gmail.com> | 2021-08-21 10:54:34 +0200 |
---|---|---|
committer | Álvaro Fernández Rojas <noltari@gmail.com> | 2021-08-21 19:07:07 +0200 |
commit | 8299d1f057439f94c6a4412e2e5c5082b82a30c9 (patch) | |
tree | 1bf678d61f11f7394493be464c7876e496f7faed /target/linux/bcm27xx/patches-5.10/950-0286-media-i2c-ov9281-add-enum_frame_interval-function-fo.patch | |
parent | 33b6885975ce376ff075362b7f0890326043111b (diff) | |
download | upstream-8299d1f057439f94c6a4412e2e5c5082b82a30c9.tar.gz upstream-8299d1f057439f94c6a4412e2e5c5082b82a30c9.tar.bz2 upstream-8299d1f057439f94c6a4412e2e5c5082b82a30c9.zip |
bcm27xx: add kernel 5.10 support
Rebased RPi foundation patches on linux 5.10.59, removed applied and reverted
patches, wireless patches and defconfig patches.
bcm2708: boot tested on RPi B+ v1.2
bcm2709: boot tested on RPi 4B v1.1 4G
bcm2711: boot tested on RPi 4B v1.1 4G
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target/linux/bcm27xx/patches-5.10/950-0286-media-i2c-ov9281-add-enum_frame_interval-function-fo.patch')
-rw-r--r-- | target/linux/bcm27xx/patches-5.10/950-0286-media-i2c-ov9281-add-enum_frame_interval-function-fo.patch | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/target/linux/bcm27xx/patches-5.10/950-0286-media-i2c-ov9281-add-enum_frame_interval-function-fo.patch b/target/linux/bcm27xx/patches-5.10/950-0286-media-i2c-ov9281-add-enum_frame_interval-function-fo.patch new file mode 100644 index 0000000000..aab12fe4b1 --- /dev/null +++ b/target/linux/bcm27xx/patches-5.10/950-0286-media-i2c-ov9281-add-enum_frame_interval-function-fo.patch @@ -0,0 +1,97 @@ +From ffb4500f4c368183fb71ce20698eb4bd25bc0ed7 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson <dave.stevenson@raspberrypi.com> +Date: Tue, 14 Apr 2020 15:51:50 +0100 +Subject: [PATCH] media: i2c: ov9281: add enum_frame_interval function + for iq tool 2.2 and hal3 + +Adds the ov9281 parts of the Rockchip patch adding enum_frame_interval to +a large number of drivers. + +Change-Id: I03344cd6cf278dd7c18fce8e97479089ef185a5c +Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com> +--- + drivers/media/i2c/ov9281.c | 31 ++++++++++++++++++++++++++----- + 1 file changed, 26 insertions(+), 5 deletions(-) + +--- a/drivers/media/i2c/ov9281.c ++++ b/drivers/media/i2c/ov9281.c +@@ -4,6 +4,7 @@ + * + * Copyright (C) 2017 Fuzhou Rockchip Electronics Co., Ltd. + * V0.0X01.0X02 fix mclk issue when probe multiple camera. ++ * V0.0X01.0X03 add enum_frame_interval function. + */ + + #include <linux/clk.h> +@@ -23,7 +24,7 @@ + #include <media/v4l2-subdev.h> + #include <linux/pinctrl/consumer.h> + +-#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x2) ++#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x3) + + #ifndef V4L2_CID_DIGITAL_GAIN + #define V4L2_CID_DIGITAL_GAIN V4L2_CID_GAIN +@@ -92,7 +93,7 @@ struct regval { + struct ov9281_mode { + u32 width; + u32 height; +- u32 max_fps; ++ struct v4l2_fract max_fps; + u32 hts_def; + u32 vts_def; + u32 exp_def; +@@ -246,7 +247,10 @@ static const struct ov9281_mode supporte + { + .width = 1280, + .height = 800, +- .max_fps = 120, ++ .max_fps = { ++ .numerator = 10000, ++ .denominator = 1200000, ++ }, + .exp_def = 0x0320, + .hts_def = 0x0b60,//0x2d8*4 + .vts_def = 0x038e, +@@ -483,8 +487,7 @@ static int OV9281_g_frame_interval(struc + const struct ov9281_mode *mode = ov9281->cur_mode; + + mutex_lock(&ov9281->mutex); +- fi->interval.numerator = 10000; +- fi->interval.denominator = mode->max_fps * 10000; ++ fi->interval = mode->max_fps; + mutex_unlock(&ov9281->mutex); + + return 0; +@@ -778,6 +781,23 @@ static int ov9281_open(struct v4l2_subde + } + #endif + ++static int ++ov9281_enum_frame_interval(struct v4l2_subdev *sd, ++ struct v4l2_subdev_pad_config *cfg, ++ struct v4l2_subdev_frame_interval_enum *fie) ++{ ++ if (fie->index >= ARRAY_SIZE(supported_modes)) ++ return -EINVAL; ++ ++ if (fie->code != MEDIA_BUS_FMT_Y10_1X10) ++ return -EINVAL; ++ ++ fie->width = supported_modes[fie->index].width; ++ fie->height = supported_modes[fie->index].height; ++ fie->interval = supported_modes[fie->index].max_fps; ++ return 0; ++} ++ + static const struct dev_pm_ops ov9281_pm_ops = { + SET_RUNTIME_PM_OPS(ov9281_runtime_suspend, + ov9281_runtime_resume, NULL) +@@ -805,6 +825,7 @@ static const struct v4l2_subdev_video_op + static const struct v4l2_subdev_pad_ops ov9281_pad_ops = { + .enum_mbus_code = ov9281_enum_mbus_code, + .enum_frame_size = ov9281_enum_frame_sizes, ++ .enum_frame_interval = ov9281_enum_frame_interval, + .get_fmt = ov9281_get_fmt, + .set_fmt = ov9281_set_fmt, + }; |