media: i2c: camera driver support enum sensor work format

Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: Ia5d0b804a85ce9947183c651395798910e4566bc
This commit is contained in:
Zefa Chen
2020-06-16 16:55:36 +08:00
committed by Tao Huang
parent ef3ee92e16
commit 2dcb987515
4 changed files with 16 additions and 16 deletions

View File

@@ -10,6 +10,7 @@
* V0.0X01.0X04 add enum_frame_interval function.
* V0.0X01.0X05 fix gain reg, add otp and dpc.
* V0.0X01.0X06 add set dpc cfg.
* V0.0X01.0X07 support enum sensor fmt
*/
#include <linux/clk.h>
@@ -31,7 +32,7 @@
#include <media/v4l2-subdev.h>
#include <linux/pinctrl/consumer.h>
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x06)
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x07)
#ifndef V4L2_CID_DIGITAL_GAIN
#define V4L2_CID_DIGITAL_GAIN V4L2_CID_GAIN
@@ -2040,12 +2041,11 @@ static int gc4c33_enum_frame_interval(struct v4l2_subdev *sd,
if (fie->index >= ARRAY_SIZE(supported_modes))
return -EINVAL;
if (fie->code != MEDIA_BUS_FMT_SRGGB10_1X10)
return -EINVAL;
fie->code = MEDIA_BUS_FMT_SRGGB10_1X10;
fie->width = supported_modes[fie->index].width;
fie->height = supported_modes[fie->index].height;
fie->interval = supported_modes[fie->index].max_fps;
fie->reserved[0] = supported_modes[fie->index].hdr_mode;
return 0;
}

View File

@@ -7,6 +7,7 @@
* V0.0X01.0X00 first version
* V0.0X01.0X01 add conversion gain control
* V0.0X01.0X02 add debug interface for conversion gain control
* V0.0X01.0X03 support enum sensor fmt
*/
#include <linux/clk.h>
@@ -28,7 +29,7 @@
#include <linux/pinctrl/consumer.h>
#include <linux/rk-preisp.h>
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x02)
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x03)
#ifndef V4L2_CID_DIGITAL_GAIN
#define V4L2_CID_DIGITAL_GAIN V4L2_CID_GAIN
@@ -1696,12 +1697,11 @@ static int imx347_enum_frame_interval(struct v4l2_subdev *sd,
if (fie->index >= imx347->cfg_num)
return -EINVAL;
if (fie->code != supported_modes[fie->index].bus_fmt)
return -EINVAL;
fie->code = supported_modes[fie->index].bus_fmt;
fie->width = supported_modes[fie->index].width;
fie->height = supported_modes[fie->index].height;
fie->interval = supported_modes[fie->index].max_fps;
fie->reserved[0] = supported_modes[fie->index].hdr_mode;
return 0;
}

View File

@@ -7,6 +7,7 @@
* V0.0X01.0X00 first version.
* V0.0X01.0X01 support conversion gain switch.
* V0.0X01.0X02 add debug interface for conversion gain switch.
* V0.0X01.0X03 support enum sensor fmt
*/
#include <linux/clk.h>
@@ -28,7 +29,7 @@
#include <linux/pinctrl/consumer.h>
#include <linux/rk-preisp.h>
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x02)
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x03)
#ifndef V4L2_CID_DIGITAL_GAIN
#define V4L2_CID_DIGITAL_GAIN V4L2_CID_GAIN
@@ -1836,12 +1837,11 @@ static int os04a10_enum_frame_interval(struct v4l2_subdev *sd,
if (fie->index >= os04a10->cfg_num)
return -EINVAL;
if (fie->code != supported_modes[fie->index].bus_fmt)
return -EINVAL;
fie->code = supported_modes[fie->index].bus_fmt;
fie->width = supported_modes[fie->index].width;
fie->height = supported_modes[fie->index].height;
fie->interval = supported_modes[fie->index].max_fps;
fie->reserved[0] = supported_modes[fie->index].hdr_mode;
return 0;
}

View File

@@ -9,6 +9,7 @@
* V0.0X01.0X03 fix gain range.
* V0.0X01.0X04 add enum_frame_interval function.
* V0.0X01.0X05 add hdr config
* V0.0X01.0X06 support enum sensor fmt
*/
#include <linux/clk.h>
@@ -30,7 +31,7 @@
#include <media/v4l2-subdev.h>
#include <linux/pinctrl/consumer.h>
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x05)
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x06)
#ifndef V4L2_CID_DIGITAL_GAIN
#define V4L2_CID_DIGITAL_GAIN V4L2_CID_GAIN
@@ -1210,12 +1211,11 @@ static int ov4689_enum_frame_interval(struct v4l2_subdev *sd,
if (fie->index >= ARRAY_SIZE(supported_modes))
return -EINVAL;
if (fie->code != MEDIA_BUS_FMT_SBGGR10_1X10)
return -EINVAL;
fie->code = MEDIA_BUS_FMT_SBGGR10_1X10;
fie->width = supported_modes[fie->index].width;
fie->height = supported_modes[fie->index].height;
fie->interval = supported_modes[fie->index].max_fps;
fie->reserved[0] = supported_modes[fie->index].hdr_mode;
return 0;
}