media: i2c: sensor driver add g_mbus_config for isp2

Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: I14dfc95c06ab93843a7c9956e7da5b04cdb820bb
This commit is contained in:
Zefa Chen
2021-03-11 21:06:07 +08:00
committed by Tao Huang
parent a140608dec
commit 1cb6be0adb
25 changed files with 409 additions and 30 deletions

View File

@@ -5,6 +5,7 @@
* Copyright (C) 2019 Fuzhou Rockchip Electronics Co.,Ltd.
* V0.0X01.0X02 add enum_frame_interval function.
* V0.0X01.0X03 add quick stream on/off
* V0.0X01.0X04 add function g_mbus_config
*/
#include <linux/clk.h>
@@ -76,6 +77,8 @@
#define GC0403_LINK_FREQ 96000000
#define GC0403_PIXEL_RATE (GC0403_LINK_FREQ * 2 * 1 / 10)
#define GC0403_LANES 1
static const s64 link_freq_menu_items[] = {
GC0403_LINK_FREQ
};
@@ -914,6 +917,20 @@ static int gc0403_enum_frame_interval(struct v4l2_subdev *sd,
return 0;
}
static int gc0403_g_mbus_config(struct v4l2_subdev *sd,
struct v4l2_mbus_config *config)
{
u32 val = 0;
val = 1 << (GC0403_LANES - 1) |
V4L2_MBUS_CSI2_CHANNEL_0 |
V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
config->type = V4L2_MBUS_CSI2;
config->flags = val;
return 0;
}
static const struct dev_pm_ops gc0403_pm_ops = {
SET_RUNTIME_PM_OPS(gc0403_runtime_suspend,
gc0403_runtime_resume, NULL)
@@ -936,6 +953,7 @@ static struct v4l2_subdev_core_ops gc0403_core_ops = {
static const struct v4l2_subdev_video_ops gc0403_video_ops = {
.s_stream = gc0403_s_stream,
.g_frame_interval = gc0403_g_frame_interval,
.g_mbus_config = gc0403_g_mbus_config,
};
static const struct v4l2_subdev_pad_ops gc0403_pad_ops = {

View File

@@ -6,6 +6,7 @@
* V0.0X01.0X02 fix mclk issue when probe multiple camera.
* V0.0X01.0X03 add enum_frame_interval function.
* V0.0X01.0X04 add quick stream on/off
* V0.0X01.0X05 add function g_mbus_config
*/
#define DEBUG 1
#include <linux/clk.h>
@@ -26,7 +27,7 @@
#include <media/v4l2-subdev.h>
#include <linux/pinctrl/consumer.h>
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x4)
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x5)
#ifndef V4L2_CID_DIGITAL_GAIN
#define V4L2_CID_DIGITAL_GAIN V4L2_CID_GAIN
@@ -825,6 +826,20 @@ static int gc2355_enum_frame_interval(struct v4l2_subdev *sd,
return 0;
}
static int gc2355_g_mbus_config(struct v4l2_subdev *sd,
struct v4l2_mbus_config *config)
{
u32 val = 0;
val = 1 << (GC2355_LANES - 1) |
V4L2_MBUS_CSI2_CHANNEL_0 |
V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
config->type = V4L2_MBUS_CSI2;
config->flags = val;
return 0;
}
static const struct dev_pm_ops gc2355_pm_ops = {
SET_RUNTIME_PM_OPS(gc2355_runtime_suspend,
gc2355_runtime_resume, NULL)
@@ -846,6 +861,7 @@ static const struct v4l2_subdev_core_ops gc2355_core_ops = {
static const struct v4l2_subdev_video_ops gc2355_video_ops = {
.s_stream = gc2355_s_stream,
.g_frame_interval = gc2355_g_frame_interval,
.g_mbus_config = gc2355_g_mbus_config,
};
static const struct v4l2_subdev_pad_ops gc2355_pad_ops = {

View File

@@ -9,6 +9,7 @@
* V0.0X01.0X03 add enum_frame_interval function.
* TODO: add OTP function.
* V0.0X01.0X04 add quick stream on/off
* V0.0X01.0X05 add function g_mbus_config
*/
//#define DEBUG 1
@@ -34,7 +35,7 @@
#include <linux/pinctrl/consumer.h>
#include <linux/slab.h>
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x4)
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x5)
#ifndef V4L2_CID_DIGITAL_GAIN
#define V4L2_CID_DIGITAL_GAIN V4L2_CID_GAIN
@@ -1000,6 +1001,20 @@ static int gc2375h_enum_frame_interval(struct v4l2_subdev *sd,
return 0;
}
static int gc2375h_g_mbus_config(struct v4l2_subdev *sd,
struct v4l2_mbus_config *config)
{
u32 val = 0;
val = 1 << (GC2375H_LANES - 1) |
V4L2_MBUS_CSI2_CHANNEL_0 |
V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
config->type = V4L2_MBUS_CSI2;
config->flags = val;
return 0;
}
static const struct dev_pm_ops gc2375h_pm_ops = {
SET_RUNTIME_PM_OPS(gc2375h_runtime_suspend,
gc2375h_runtime_resume, NULL)
@@ -1022,6 +1037,7 @@ static const struct v4l2_subdev_core_ops gc2375h_core_ops = {
static const struct v4l2_subdev_video_ops gc2375h_video_ops = {
.s_stream = gc2375h_s_stream,
.g_frame_interval = gc2375h_g_frame_interval,
.g_mbus_config = gc2375h_g_mbus_config,
};
static const struct v4l2_subdev_pad_ops gc2375h_pad_ops = {

View File

@@ -8,6 +8,7 @@
* V0.0X01.0X02 fix mclk issue when probe multiple camera.
* V0.0X01.0X03 add enum_frame_interval function.
* V0.0X01.0X04 add quick stream on/off
* V0.0X01.0X05 add function g_mbus_config
*/
#include <linux/clk.h>
@@ -27,7 +28,7 @@
#include <media/v4l2-subdev.h>
#include <linux/pinctrl/consumer.h>
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x04)
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x05)
#ifndef V4L2_CID_DIGITAL_GAIN
#define V4L2_CID_DIGITAL_GAIN V4L2_CID_GAIN
@@ -785,6 +786,20 @@ static int gc2385_enum_frame_interval(struct v4l2_subdev *sd,
return 0;
}
static int gc2385_g_mbus_config(struct v4l2_subdev *sd,
struct v4l2_mbus_config *config)
{
u32 val = 0;
val = 1 << (GC2385_LANES - 1) |
V4L2_MBUS_CSI2_CHANNEL_0 |
V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
config->type = V4L2_MBUS_CSI2;
config->flags = val;
return 0;
}
static const struct dev_pm_ops gc2385_pm_ops = {
SET_RUNTIME_PM_OPS(gc2385_runtime_suspend,
gc2385_runtime_resume, NULL)
@@ -807,6 +822,7 @@ static const struct v4l2_subdev_core_ops gc2385_core_ops = {
static const struct v4l2_subdev_video_ops gc2385_video_ops = {
.s_stream = gc2385_s_stream,
.g_frame_interval = gc2385_g_frame_interval,
.g_mbus_config = gc2385_g_mbus_config,
};
static const struct v4l2_subdev_pad_ops gc2385_pad_ops = {

View File

@@ -884,7 +884,6 @@ static int sensor_g_mbus_config(struct v4l2_subdev *sd,
config->type = V4L2_MBUS_CSI2;
config->flags = V4L2_MBUS_CSI2_2_LANE |
V4L2_MBUS_CSI2_CHANNEL_0 |
V4L2_MBUS_CSI2_CHANNEL_1 |
V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
} else {
dev_err(&sensor->client->dev,

View File

@@ -968,7 +968,6 @@ static int sensor_g_mbus_config(struct v4l2_subdev *sd,
config->type = V4L2_MBUS_CSI2;
config->flags = V4L2_MBUS_CSI2_2_LANE |
V4L2_MBUS_CSI2_CHANNEL_0 |
V4L2_MBUS_CSI2_CHANNEL_1 |
V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
} else {
dev_err(&sensor->client->dev,

View File

@@ -8,6 +8,7 @@
* V0.0X01.0X02 fix mclk issue when probe multiple camera.
* V0.0X01.0X03 add enum_frame_interval function.
* V0.0X01.0X04 add quick stream on/off
* V0.0X01.0X05 add function g_mbus_config
*/
#include <linux/clk.h>
@@ -28,7 +29,7 @@
#include <linux/pinctrl/consumer.h>
#include <linux/slab.h>
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x04)
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x05)
#ifndef V4L2_CID_DIGITAL_GAIN
#define V4L2_CID_DIGITAL_GAIN V4L2_CID_GAIN
@@ -1728,6 +1729,20 @@ static int gc8034_enum_frame_interval(struct v4l2_subdev *sd,
return 0;
}
static int gc8034_g_mbus_config(struct v4l2_subdev *sd,
struct v4l2_mbus_config *config)
{
u32 val = 0;
val = 1 << (GC8034_LANES - 1) |
V4L2_MBUS_CSI2_CHANNEL_0 |
V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
config->type = V4L2_MBUS_CSI2;
config->flags = val;
return 0;
}
static const struct dev_pm_ops gc8034_pm_ops = {
SET_RUNTIME_PM_OPS(gc8034_runtime_suspend,
gc8034_runtime_resume, NULL)
@@ -1750,6 +1765,7 @@ static const struct v4l2_subdev_core_ops gc8034_core_ops = {
static const struct v4l2_subdev_video_ops gc8034_video_ops = {
.s_stream = gc8034_s_stream,
.g_frame_interval = gc8034_g_frame_interval,
.g_mbus_config = gc8034_g_mbus_config,
};
static const struct v4l2_subdev_pad_ops gc8034_pad_ops = {

View File

@@ -7,6 +7,7 @@
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
* V0.0X01.0X01 add enum_frame_interval function.
* V0.0X01.0X02 add function g_mbus_config.
*/
#include <linux/clk.h>
#include <linux/delay.h>
@@ -25,7 +26,7 @@
#include <media/v4l2-image-sizes.h>
#include <media/v4l2-mediabus.h>
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x1)
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x2)
/* IMX219 supported geometry */
#define IMX219_TABLE_END 0xffff
@@ -47,6 +48,8 @@
#define IMX219_NAME "imx219"
#define IMX219_LANES 2
static const s64 link_freq_menu_items[] = {
456000000,
};
@@ -821,10 +824,25 @@ static int imx219_enum_frame_interval(struct v4l2_subdev *sd,
return 0;
}
static int imx219_g_mbus_config(struct v4l2_subdev *sd,
struct v4l2_mbus_config *config)
{
u32 val = 0;
val = 1 << (IMX219_LANES - 1) |
V4L2_MBUS_CSI2_CHANNEL_0 |
V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
config->type = V4L2_MBUS_CSI2;
config->flags = val;
return 0;
}
/* Various V4L2 operations tables */
static struct v4l2_subdev_video_ops imx219_subdev_video_ops = {
.s_stream = imx219_s_stream,
.g_frame_interval = imx219_g_frame_interval,
.g_mbus_config = imx219_g_mbus_config,
};
static struct v4l2_subdev_core_ops imx219_subdev_core_ops = {

View File

@@ -8,6 +8,7 @@
* V0.0X01.0X02 fix mclk issue when probe multiple camera.
* V0.0X01.0X03 add enum_frame_interval function.
* V0.0X01.0X04 add quick stream on/off
* V0.0X01.0X05 add function g_mbus_config
*/
#include <linux/clk.h>
@@ -28,7 +29,7 @@
#include <linux/pinctrl/consumer.h>
#include "imx258_eeprom_head.h"
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x04)
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x05)
#ifndef V4L2_CID_DIGITAL_GAIN
#define V4L2_CID_DIGITAL_GAIN V4L2_CID_GAIN
@@ -1432,6 +1433,20 @@ static int imx258_enum_frame_interval(struct v4l2_subdev *sd,
return 0;
}
static int imx258_g_mbus_config(struct v4l2_subdev *sd,
struct v4l2_mbus_config *config)
{
u32 val = 0;
val = 1 << (IMX258_LANES - 1) |
V4L2_MBUS_CSI2_CHANNEL_0 |
V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
config->type = V4L2_MBUS_CSI2;
config->flags = val;
return 0;
}
static const struct dev_pm_ops imx258_pm_ops = {
SET_RUNTIME_PM_OPS(imx258_runtime_suspend,
imx258_runtime_resume, NULL)
@@ -1454,6 +1469,7 @@ static const struct v4l2_subdev_core_ops imx258_core_ops = {
static const struct v4l2_subdev_video_ops imx258_video_ops = {
.s_stream = imx258_s_stream,
.g_frame_interval = imx258_g_frame_interval,
.g_mbus_config = imx258_g_mbus_config,
};
static const struct v4l2_subdev_pad_ops imx258_pad_ops = {

View File

@@ -9,6 +9,7 @@
* V0.0X01.0X03 add enum_frame_interval function.
* V0.0X01.0X04 adjust exposue and gain control issues.
* V0.0X01.0X05 add quick stream on/off
* V0.0X01.0X06 add function g_mbus_config
*/
#include <linux/clk.h>
@@ -32,7 +33,7 @@
#include <linux/of_graph.h>
#include <media/v4l2-fwnode.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
@@ -1186,6 +1187,20 @@ static int imx317_enum_frame_interval(struct v4l2_subdev *sd,
return 0;
}
static int imx317_g_mbus_config(struct v4l2_subdev *sd,
struct v4l2_mbus_config *config)
{
u32 val = 0;
val = 1 << (IMX317_LANES - 1) |
V4L2_MBUS_CSI2_CHANNEL_0 |
V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
config->type = V4L2_MBUS_CSI2;
config->flags = val;
return 0;
}
static const struct dev_pm_ops imx317_pm_ops = {
SET_RUNTIME_PM_OPS(imx317_runtime_suspend,
imx317_runtime_resume, NULL)
@@ -1208,6 +1223,7 @@ static const struct v4l2_subdev_core_ops imx317_core_ops = {
static const struct v4l2_subdev_video_ops imx317_video_ops = {
.s_stream = imx317_s_stream,
.g_frame_interval = imx317_g_frame_interval,
.g_mbus_config = imx317_g_mbus_config,
};
static const struct v4l2_subdev_pad_ops imx317_pad_ops = {

View File

@@ -5,6 +5,7 @@
* Copyright (C) 2020 Rockchip Electronics Co., Ltd.
*
* V0.0X01.0X01 init version.
* V0.0X01.0X02 add function g_mbus_config.
*/
#include <linux/clk.h>
@@ -27,7 +28,7 @@
#include <linux/version.h>
#include <linux/rk-camera-module.h>
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x01)
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x02)
#ifndef V4L2_CID_DIGITAL_GAIN
#define V4L2_CID_DIGITAL_GAIN V4L2_CID_GAIN
@@ -53,7 +54,7 @@
#define JX_H62_EXPOSURE_STEP 1
#define JX_H62_VTS_MAX 0xffff
#define JX_H62_AEC_PK_LONG_GAIN_REG 0x00 /* Bits 0 -7 */
#define JX_H62_AEC_PK_LONG_GAIN_REG 0x00 /* Bits 0 -7 */
#define ANALOG_GAIN_MIN 0x00
#define ANALOG_GAIN_MAX 0xf8 /* 15.5 */
#define ANALOG_GAIN_STEP 1
@@ -83,6 +84,8 @@
#define JX_H62_NAME "jx_h62"
#define JX_H62_MEDIA_BUS_FMT MEDIA_BUS_FMT_SBGGR10_1X10
#define JX_H62_LANES 1
static const char * const jx_h62_supply_names[] = {
"vcc2v8_dvp", /* Analog power */
"vcc1v8_dvp", /* Digital I/O power */
@@ -803,6 +806,20 @@ static int jx_h62_enum_frame_interval(struct v4l2_subdev *sd,
return 0;
}
static int jx_h62_g_mbus_config(struct v4l2_subdev *sd,
struct v4l2_mbus_config *config)
{
u32 val = 0;
val = 1 << (JX_H62_LANES - 1) |
V4L2_MBUS_CSI2_CHANNEL_0 |
V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
config->type = V4L2_MBUS_CSI2;
config->flags = val;
return 0;
}
static const struct dev_pm_ops jx_h62_pm_ops = {
SET_RUNTIME_PM_OPS(jx_h62_runtime_suspend,
jx_h62_runtime_resume, NULL)
@@ -825,6 +842,7 @@ static const struct v4l2_subdev_core_ops jx_h62_core_ops = {
static const struct v4l2_subdev_video_ops jx_h62_video_ops = {
.s_stream = jx_h62_s_stream,
.g_frame_interval = jx_h62_g_frame_interval,
.g_mbus_config = jx_h62_g_mbus_config,
};
static const struct v4l2_subdev_pad_ops jx_h62_pad_ops = {

View File

@@ -7,6 +7,7 @@
* V0.0X01.0X01 add poweron function.
* V0.0X01.0X02 add enum_frame_interval function.
* V0.0X01.0X03 add quick stream on/off
* V0.0X01.0X04 add function g_mbus_config
*/
#include <linux/clk.h>
@@ -25,7 +26,7 @@
#include <media/v4l2-subdev.h>
#include <linux/version.h>
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x03)
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x04)
#ifndef V4L2_CID_DIGITAL_GAIN
#define V4L2_CID_DIGITAL_GAIN V4L2_CID_GAIN
@@ -77,6 +78,8 @@
#define JX_H65_NAME "jx_h65"
#define JX_H65_LANES 1
static const char * const jx_h65_supply_names[] = {
"vcc2v8_dvp", /* Analog power */
"vcc1v8_dvp", /* Digital I/O power */
@@ -901,6 +904,20 @@ static int jx_h65_enum_frame_interval(struct v4l2_subdev *sd,
return 0;
}
static int jx_h65_g_mbus_config(struct v4l2_subdev *sd,
struct v4l2_mbus_config *config)
{
u32 val = 0;
val = 1 << (JX_H65_LANES - 1) |
V4L2_MBUS_CSI2_CHANNEL_0 |
V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
config->type = V4L2_MBUS_CSI2;
config->flags = val;
return 0;
}
static const struct dev_pm_ops jx_h65_pm_ops = {
SET_RUNTIME_PM_OPS(jx_h65_runtime_suspend,
jx_h65_runtime_resume, NULL)
@@ -923,6 +940,7 @@ static const struct v4l2_subdev_core_ops jx_h65_core_ops = {
static const struct v4l2_subdev_video_ops jx_h65_video_ops = {
.s_stream = jx_h65_s_stream,
.g_frame_interval = jx_h65_g_frame_interval,
.g_mbus_config = jx_h65_g_mbus_config,
};
static const struct v4l2_subdev_pad_ops jx_h65_pad_ops = {

View File

@@ -8,6 +8,7 @@
* V0.0X01.0X02 fix mclk issue when probe multiple camera.
* V0.0X01.0X03 add enum_frame_interval function.
* V0.0X01.0X04 add quick stream on/off
* V0.0X01.0X05 add function g_mbus_config
*/
#include <linux/clk.h>
@@ -28,7 +29,7 @@
#include <media/v4l2-subdev.h>
#include <linux/pinctrl/consumer.h>
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x04)
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x05)
#ifndef V4L2_CID_DIGITAL_GAIN
#define V4L2_CID_DIGITAL_GAIN V4L2_CID_GAIN
@@ -1246,6 +1247,20 @@ static int ov13850_enum_frame_interval(struct v4l2_subdev *sd,
return 0;
}
static int ov13850_g_mbus_config(struct v4l2_subdev *sd,
struct v4l2_mbus_config *config)
{
u32 val = 0;
val = 1 << (OV13850_LANES - 1) |
V4L2_MBUS_CSI2_CHANNEL_0 |
V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
config->type = V4L2_MBUS_CSI2;
config->flags = val;
return 0;
}
static const struct dev_pm_ops ov13850_pm_ops = {
SET_RUNTIME_PM_OPS(ov13850_runtime_suspend,
ov13850_runtime_resume, NULL)
@@ -1268,6 +1283,7 @@ static const struct v4l2_subdev_core_ops ov13850_core_ops = {
static const struct v4l2_subdev_video_ops ov13850_video_ops = {
.s_stream = ov13850_s_stream,
.g_frame_interval = ov13850_g_frame_interval,
.g_mbus_config = ov13850_g_mbus_config,
};
static const struct v4l2_subdev_pad_ops ov13850_pad_ops = {

View File

@@ -6,6 +6,7 @@
* V0.0X01.0X02 fix mclk issue when probe multiple camera.
* V0.0X01.0X03 add enum_frame_interval function.
* V0.0X01.0X04 add quick stream on/off
* V0.0X01.0X05 add function g_mbus_config
*/
#include <linux/clk.h>
@@ -37,7 +38,7 @@
/* verify default register values */
//#define CHECK_REG_VALUE
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x4)
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x5)
#ifndef V4L2_CID_DIGITAL_GAIN
#define V4L2_CID_DIGITAL_GAIN V4L2_CID_GAIN
@@ -914,6 +915,20 @@ static int ov2680_enum_frame_interval(struct v4l2_subdev *sd,
return 0;
}
static int ov2680_g_mbus_config(struct v4l2_subdev *sd,
struct v4l2_mbus_config *config)
{
u32 val = 0;
val = 1 << (OV2680_LANES - 1) |
V4L2_MBUS_CSI2_CHANNEL_0 |
V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
config->type = V4L2_MBUS_CSI2;
config->flags = val;
return 0;
}
static const struct dev_pm_ops ov2680_pm_ops = {
SET_RUNTIME_PM_OPS(ov2680_runtime_suspend,
ov2680_runtime_resume, NULL)
@@ -936,6 +951,7 @@ static const struct v4l2_subdev_core_ops ov2680_core_ops = {
static const struct v4l2_subdev_video_ops ov2680_video_ops = {
.s_stream = ov2680_s_stream,
.g_frame_interval = ov2680_g_frame_interval,
.g_mbus_config = ov2680_g_mbus_config,
};
static const struct v4l2_subdev_pad_ops ov2680_pad_ops = {

View File

@@ -9,6 +9,7 @@
* (at your option) any later version.
* V0.0X01.0X01 add enum_frame_interval function.
* V0.0X01.0X02 add quick stream on/off
* V0.0X01.0X03 add function g_mbus_config
*/
#include <linux/clk.h>
@@ -28,7 +29,7 @@
#include <media/v4l2-ctrls.h>
#include <media/v4l2-subdev.h>
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x2)
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x3)
#define CHIP_ID 0x2685
#define OV2685_REG_CHIP_ID 0x300a
@@ -732,6 +733,20 @@ static int ov2685_enum_frame_interval(struct v4l2_subdev *sd,
return 0;
}
static int ov2685_g_mbus_config(struct v4l2_subdev *sd,
struct v4l2_mbus_config *config)
{
u32 val = 0;
val = 1 << (OV2685_LANES - 1) |
V4L2_MBUS_CSI2_CHANNEL_0 |
V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
config->type = V4L2_MBUS_CSI2;
config->flags = val;
return 0;
}
static struct v4l2_subdev_core_ops ov2685_core_ops = {
.s_power = ov2685_s_power,
.ioctl = ov2685_ioctl,
@@ -742,6 +757,7 @@ static struct v4l2_subdev_core_ops ov2685_core_ops = {
static struct v4l2_subdev_video_ops ov2685_video_ops = {
.s_stream = ov2685_s_stream,
.g_mbus_config = ov2685_g_mbus_config,
};
static struct v4l2_subdev_pad_ops ov2685_pad_ops = {

View File

@@ -8,6 +8,7 @@
* V0.0X01.0X02 fix mclk issue when probe multiple camera.
* V0.0X01.0X03 add enum_frame_interval function.
* V0.0X01.0X04 add quick stream on/off
* V0.0X01.0X05 add function g_mbus_config
*/
#include <linux/clk.h>
@@ -27,7 +28,7 @@
#include <media/v4l2-ctrls.h>
#include <media/v4l2-subdev.h>
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x04)
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x05)
#ifndef V4L2_CID_DIGITAL_GAIN
#define V4L2_CID_DIGITAL_GAIN V4L2_CID_GAIN
@@ -97,6 +98,8 @@
#define OV2735_NAME "ov2735"
#define OV2735_LANES 2
static const char * const ov2735_supply_names[] = {
"avdd", /* Analog power */
"dovdd", /* Digital I/O power */
@@ -842,6 +845,20 @@ static int ov2735_enum_frame_interval(struct v4l2_subdev *sd,
return 0;
}
static int ov2735_g_mbus_config(struct v4l2_subdev *sd,
struct v4l2_mbus_config *config)
{
u32 val = 0;
val = 1 << (OV2735_LANES - 1) |
V4L2_MBUS_CSI2_CHANNEL_0 |
V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
config->type = V4L2_MBUS_CSI2;
config->flags = val;
return 0;
}
static const struct dev_pm_ops ov2735_pm_ops = {
SET_RUNTIME_PM_OPS(ov2735_runtime_suspend,
ov2735_runtime_resume, NULL)
@@ -863,6 +880,7 @@ static const struct v4l2_subdev_core_ops ov2735_core_ops = {
static const struct v4l2_subdev_video_ops ov2735_video_ops = {
.s_stream = ov2735_s_stream,
.g_mbus_config = ov2735_g_mbus_config,
};
static const struct v4l2_subdev_pad_ops ov2735_pad_ops = {

View File

@@ -8,6 +8,7 @@
* V0.0X01.0X02 fix mclk issue when probe multiple camera.
* V0.0X01.0X03 add enum_frame_interval function.
* V0.0X01.0X04 add quick stream on/off
* V0.0X01.0X05 add function g_mbus_config
*/
#include <linux/clk.h>
@@ -39,7 +40,7 @@
/* verify default register values */
//#define CHECK_REG_VALUE
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x04)
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x05)
#ifndef V4L2_CID_DIGITAL_GAIN
#define V4L2_CID_DIGITAL_GAIN V4L2_CID_GAIN
@@ -1090,6 +1091,20 @@ static int ov5648_enum_frame_interval(struct v4l2_subdev *sd,
return 0;
}
static int ov5648_g_mbus_config(struct v4l2_subdev *sd,
struct v4l2_mbus_config *config)
{
u32 val = 0;
val = 1 << (OV5648_LANES - 1) |
V4L2_MBUS_CSI2_CHANNEL_0 |
V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
config->type = V4L2_MBUS_CSI2;
config->flags = val;
return 0;
}
static const struct dev_pm_ops ov5648_pm_ops = {
SET_RUNTIME_PM_OPS(ov5648_runtime_suspend,
ov5648_runtime_resume, NULL)
@@ -1112,6 +1127,7 @@ static const struct v4l2_subdev_core_ops ov5648_core_ops = {
static const struct v4l2_subdev_video_ops ov5648_video_ops = {
.s_stream = ov5648_s_stream,
.g_frame_interval = ov5648_g_frame_interval,
.g_mbus_config = ov5648_g_mbus_config,
};
static const struct v4l2_subdev_pad_ops ov5648_pad_ops = {

View File

@@ -9,6 +9,7 @@
* V0.0X01.0X03 add otp function.
* V0.0X01.0X04 add enum_frame_interval function.
* V0.0X01.0X05 add quick stream on/off
* V0.0X01.0X06 add function g_mmbus_config
*/
#include <linux/clk.h>
@@ -40,7 +41,7 @@
/* verify default register values */
//#define CHECK_REG_VALUE
#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
@@ -1422,6 +1423,20 @@ static int ov5670_enum_frame_interval(struct v4l2_subdev *sd,
return 0;
}
static int ov5670_g_mbus_config(struct v4l2_subdev *sd,
struct v4l2_mbus_config *config)
{
u32 val = 0;
val = 1 << (OV5670_LANES - 1) |
V4L2_MBUS_CSI2_CHANNEL_0 |
V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
config->type = V4L2_MBUS_CSI2;
config->flags = val;
return 0;
}
static const struct dev_pm_ops ov5670_pm_ops = {
SET_RUNTIME_PM_OPS(ov5670_runtime_suspend,
ov5670_runtime_resume, NULL)
@@ -1444,6 +1459,7 @@ static const struct v4l2_subdev_core_ops ov5670_core_ops = {
static const struct v4l2_subdev_video_ops ov5670_video_ops = {
.s_stream = ov5670_s_stream,
.g_frame_interval = ov5670_g_frame_interval,
.g_mbus_config = ov5670_g_mbus_config,
};
static const struct v4l2_subdev_pad_ops ov5670_pad_ops = {

View File

@@ -7,6 +7,7 @@
* V0.0X01.0X01 add poweron function.
* V0.0X01.0X02 add enum_frame_interval function.
* V0.0X01.0X03 add quick stream on/off
* V0.0X01.0X04 add function g_mbus_config
*/
#include <linux/clk.h>
@@ -26,7 +27,7 @@
#include <media/v4l2-ctrls.h>
#include <media/v4l2-subdev.h>
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x03)
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x04)
#ifndef V4L2_CID_DIGITAL_GAIN
#define V4L2_CID_DIGITAL_GAIN V4L2_CID_GAIN
@@ -1155,6 +1156,20 @@ static int ov5695_enum_frame_interval(struct v4l2_subdev *sd,
return 0;
}
static int ov5695_g_mbus_config(struct v4l2_subdev *sd,
struct v4l2_mbus_config *config)
{
u32 val = 0;
val = 1 << (OV5695_LANES - 1) |
V4L2_MBUS_CSI2_CHANNEL_0 |
V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
config->type = V4L2_MBUS_CSI2;
config->flags = val;
return 0;
}
static const struct dev_pm_ops ov5695_pm_ops = {
SET_RUNTIME_PM_OPS(ov5695_runtime_suspend,
ov5695_runtime_resume, NULL)
@@ -1177,6 +1192,7 @@ static const struct v4l2_subdev_core_ops ov5695_core_ops = {
static const struct v4l2_subdev_video_ops ov5695_video_ops = {
.s_stream = ov5695_s_stream,
.g_frame_interval = ov5695_g_frame_interval,
.g_mbus_config = ov5695_g_mbus_config,
};
static const struct v4l2_subdev_pad_ops ov5695_pad_ops = {

View File

@@ -8,6 +8,7 @@
* V0.0X01.0X02 fix mclk issue when probe multiple camera.
* V0.0X01.0X03 add enum_frame_interval function.
* V0.0X01.0X04 add quick stream on/off
* V0.0X01.0X05 add function g_mbus_config
*/
#include <linux/clk.h>
@@ -27,7 +28,7 @@
#include <media/v4l2-ctrls.h>
#include <media/v4l2-subdev.h>
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x04)
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x05)
#ifndef V4L2_CID_DIGITAL_GAIN
#define V4L2_CID_DIGITAL_GAIN V4L2_CID_GAIN
@@ -72,6 +73,8 @@
#define OV7251_NAME "ov7251"
#define OV7251_LANES 1
static const char * const ov7251_supply_names[] = {
"avdd", /* Analog power */
"dovdd", /* Digital I/O power */
@@ -831,6 +834,20 @@ static int ov7251_enum_frame_interval(struct v4l2_subdev *sd,
return 0;
}
static int ov7251_g_mbus_config(struct v4l2_subdev *sd,
struct v4l2_mbus_config *config)
{
u32 val = 0;
val = 1 << (OV7251_LANES - 1) |
V4L2_MBUS_CSI2_CHANNEL_0 |
V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
config->type = V4L2_MBUS_CSI2;
config->flags = val;
return 0;
}
static const struct dev_pm_ops ov7251_pm_ops = {
SET_RUNTIME_PM_OPS(ov7251_runtime_suspend,
ov7251_runtime_resume, NULL)
@@ -853,6 +870,7 @@ static const struct v4l2_subdev_core_ops ov7251_core_ops = {
static const struct v4l2_subdev_video_ops ov7251_video_ops = {
.s_stream = ov7251_s_stream,
.g_frame_interval = ov7251_g_frame_interval,
.g_mbus_config = ov7251_g_mbus_config,
};
static const struct v4l2_subdev_pad_ops ov7251_pad_ops = {

View File

@@ -8,6 +8,7 @@
* V0.0X01.0X02 fix mclk issue when probe multiple camera.
* V0.0X01.0X03 add enum_frame_interval function.
* V0.0X01.0X04 add quick stream on/off
* V0.0X01.0X05 add function g_mbus_config
*/
#include <linux/clk.h>
@@ -28,7 +29,7 @@
#include <media/v4l2-subdev.h>
#include <linux/pinctrl/consumer.h>
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x04)
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x05)
#ifndef V4L2_CID_DIGITAL_GAIN
#define V4L2_CID_DIGITAL_GAIN V4L2_CID_GAIN
@@ -72,7 +73,6 @@
#define OV7750_REG_VALUE_16BIT 2
#define OV7750_REG_VALUE_24BIT 3
#define OV7750_LANES 2
#define OV7750_BITS_PER_SAMPLE 10
#define OV7750_REG_MANUAL_CTL 0x3503
#define OV7750_CHIP_REVISION_REG 0x3029
@@ -84,6 +84,8 @@
#define OV7750_NAME "ov7750"
#define OV7750_LANES 1
static const struct regval *ov7750_global_regs;
static const char * const ov7750_supply_names[] = {
@@ -948,6 +950,20 @@ static int ov7750_enum_frame_interval(struct v4l2_subdev *sd,
return 0;
}
static int ov7750_g_mbus_config(struct v4l2_subdev *sd,
struct v4l2_mbus_config *config)
{
u32 val = 0;
val = 1 << (OV7750_LANES - 1) |
V4L2_MBUS_CSI2_CHANNEL_0 |
V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
config->type = V4L2_MBUS_CSI2;
config->flags = val;
return 0;
}
static const struct dev_pm_ops ov7750_pm_ops = {
SET_RUNTIME_PM_OPS(ov7750_runtime_suspend,
ov7750_runtime_resume, NULL)
@@ -969,6 +985,7 @@ static const struct v4l2_subdev_core_ops ov7750_core_ops = {
static const struct v4l2_subdev_video_ops ov7750_video_ops = {
.s_stream = ov7750_s_stream,
.g_mbus_config = ov7750_g_mbus_config,
};
static const struct v4l2_subdev_pad_ops ov7750_pad_ops = {

View File

@@ -6,6 +6,7 @@
* V0.0X01.0X02 fix mclk issue when probe multiple camera.
* V0.0X01.0X03 add enum_frame_interval function.
* V0.0X01.0X04 add quick stream on/off
* V0.0X01.0X05 add function g_mbus_config
*/
#include <linux/clk.h>
@@ -35,7 +36,7 @@
#include <media/v4l2-mediabus.h>
#include <media/v4l2-subdev.h>
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x04)
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x05)
#ifndef V4L2_CID_DIGITAL_GAIN
#define V4L2_CID_DIGITAL_GAIN V4L2_CID_GAIN
@@ -2329,6 +2330,20 @@ static int ov8858_enum_frame_interval(struct v4l2_subdev *sd,
return 0;
}
static int ov8858_g_mbus_config(struct v4l2_subdev *sd,
struct v4l2_mbus_config *config)
{
u32 val = 0;
val = 1 << (OV8858_LANES - 1) |
V4L2_MBUS_CSI2_CHANNEL_0 |
V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
config->type = V4L2_MBUS_CSI2;
config->flags = val;
return 0;
}
static const struct dev_pm_ops ov8858_pm_ops = {
SET_RUNTIME_PM_OPS(ov8858_runtime_suspend,
ov8858_runtime_resume, NULL)
@@ -2351,6 +2366,7 @@ static const struct v4l2_subdev_core_ops ov8858_core_ops = {
static const struct v4l2_subdev_video_ops ov8858_video_ops = {
.s_stream = ov8858_s_stream,
.g_frame_interval = ov8858_g_frame_interval,
.g_mbus_config = ov8858_g_mbus_config,
};
static const struct v4l2_subdev_pad_ops ov8858_pad_ops = {

View File

@@ -6,6 +6,7 @@
* V0.0X01.0X02 fix mclk issue when probe multiple camera.
* V0.0X01.0X03 add enum_frame_interval function.
* V0.0X01.0X04 add quick stream on/off
* V0.0X01.0X05 add function g_mbus_config
*/
#include <linux/clk.h>
@@ -26,7 +27,7 @@
#include <linux/pinctrl/consumer.h>
#include <linux/version.h>
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x4)
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x5)
#ifndef V4L2_CID_DIGITAL_GAIN
#define V4L2_CID_DIGITAL_GAIN V4L2_CID_GAIN
@@ -482,7 +483,7 @@ static int ov9281_enable_test_pattern(struct ov9281 *ov9281, u32 pattern)
OV9281_REG_VALUE_08BIT, val);
}
static int OV9281_g_frame_interval(struct v4l2_subdev *sd,
static int ov9281_g_frame_interval(struct v4l2_subdev *sd,
struct v4l2_subdev_frame_interval *fi)
{
struct ov9281 *ov9281 = to_ov9281(sd);
@@ -816,6 +817,20 @@ static int ov9281_enum_frame_interval(struct v4l2_subdev *sd,
return 0;
}
static int ov9281_g_mbus_config(struct v4l2_subdev *sd,
struct v4l2_mbus_config *config)
{
u32 val = 0;
val = 1 << (OV9281_LANES - 1) |
V4L2_MBUS_CSI2_CHANNEL_0 |
V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
config->type = V4L2_MBUS_CSI2;
config->flags = val;
return 0;
}
static const struct dev_pm_ops ov9281_pm_ops = {
SET_RUNTIME_PM_OPS(ov9281_runtime_suspend,
ov9281_runtime_resume, NULL)
@@ -837,7 +852,8 @@ static const struct v4l2_subdev_core_ops ov9281_core_ops = {
static const struct v4l2_subdev_video_ops ov9281_video_ops = {
.s_stream = ov9281_s_stream,
.g_frame_interval = OV9281_g_frame_interval,
.g_frame_interval = ov9281_g_frame_interval,
.g_mbus_config = ov9281_g_mbus_config,
};
static const struct v4l2_subdev_pad_ops ov9281_pad_ops = {

View File

@@ -6,6 +6,7 @@
* V0.0X01.0X02 fix mclk issue when probe multiple camera.
* V0.0X01.0X03 add enum_frame_interval function.
* V0.0X01.0X04 add quick stream on/off
* V0.0X01.0X05 add function g_mbus_config
*/
#include <linux/clk.h>
@@ -26,7 +27,7 @@
#include <linux/pinctrl/consumer.h>
#include <linux/version.h>
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x4)
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x5)
#ifndef V4L2_CID_DIGITAL_GAIN
#define V4L2_CID_DIGITAL_GAIN V4L2_CID_GAIN
@@ -616,7 +617,7 @@ static int ov9750_enable_test_pattern(struct ov9750 *ov9750, u32 pattern)
OV9750_REG_VALUE_08BIT, val);
}
static int OV9750_g_frame_interval(struct v4l2_subdev *sd,
static int ov9750_g_frame_interval(struct v4l2_subdev *sd,
struct v4l2_subdev_frame_interval *fi)
{
struct ov9750 *ov9750 = to_ov9750(sd);
@@ -935,6 +936,20 @@ static int ov9750_enum_frame_interval(struct v4l2_subdev *sd,
return 0;
}
static int ov9750_g_mbus_config(struct v4l2_subdev *sd,
struct v4l2_mbus_config *config)
{
u32 val = 0;
val = 1 << (OV9750_LANES - 1) |
V4L2_MBUS_CSI2_CHANNEL_0 |
V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
config->type = V4L2_MBUS_CSI2;
config->flags = val;
return 0;
}
static const struct dev_pm_ops ov9750_pm_ops = {
SET_RUNTIME_PM_OPS(ov9750_runtime_suspend,
ov9750_runtime_resume, NULL)
@@ -956,7 +971,8 @@ static const struct v4l2_subdev_core_ops ov9750_core_ops = {
static const struct v4l2_subdev_video_ops ov9750_video_ops = {
.s_stream = ov9750_s_stream,
.g_frame_interval = OV9750_g_frame_interval,
.g_frame_interval = ov9750_g_frame_interval,
.g_mbus_config = ov9750_g_mbus_config,
};
static const struct v4l2_subdev_pad_ops ov9750_pad_ops = {

View File

@@ -7,6 +7,7 @@
* V0.0X01.0X02 fix mclk issue when probe multiple camera.
* V0.0X01.0X03 add enum_frame_interval function.
* V0.0X01.0X04 add quick stream on/off
* V0.0X01.0X05 add function g_mbus_config
*/
#include <linux/clk.h>
@@ -27,7 +28,7 @@
#include <media/v4l2-subdev.h>
#include <linux/pinctrl/consumer.h>
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x04)
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x05)
#ifndef V4L2_CID_DIGITAL_GAIN
#define V4L2_CID_DIGITAL_GAIN V4L2_CID_GAIN
#endif
@@ -849,6 +850,20 @@ static int sc132gs_enum_frame_interval(struct v4l2_subdev *sd,
return 0;
}
static int sc132gs_g_mbus_config(struct v4l2_subdev *sd,
struct v4l2_mbus_config *config)
{
u32 val = 0;
val = 1 << (SC132GS_LANES - 1) |
V4L2_MBUS_CSI2_CHANNEL_0 |
V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
config->type = V4L2_MBUS_CSI2;
config->flags = val;
return 0;
}
static const struct dev_pm_ops sc132gs_pm_ops = {
SET_RUNTIME_PM_OPS(sc132gs_runtime_suspend,
sc132gs_runtime_resume, NULL)
@@ -871,6 +886,7 @@ static const struct v4l2_subdev_core_ops sc132gs_core_ops = {
static const struct v4l2_subdev_video_ops sc132gs_video_ops = {
.s_stream = sc132gs_s_stream,
.g_frame_interval = sc132gs_g_frame_interval,
.g_mbus_config = sc132gs_g_mbus_config,
};
static const struct v4l2_subdev_pad_ops sc132gs_pad_ops = {