// SPDX-License-Identifier: GPL-2.0
// Copyright (c) 2022 Intel Corporation.
#include <linux/acpi.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/pm_runtime.h>
#include <linux/regulator/consumer.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
#include <media/v4l2-fwnode.h>
#define OV08D10_SCLK 144000000 ULL
#define OV08D10_XVCLK_19_2 19200000
#define OV08D10_ROWCLK 36000
#define OV08D10_DATA_LANES 2
#define OV08D10_RGB_DEPTH 10
#define OV08D10_REG_PAGE 0 xfd
#define OV08D10_REG_GLOBAL_EFFECTIVE 0 x01
#define OV08D10_REG_CHIP_ID_0 0 x00
#define OV08D10_REG_CHIP_ID_1 0 x01
#define OV08D10_ID_MASK GENMASK(15 , 0 )
#define OV08D10_CHIP_ID 0 x5608
#define OV08D10_REG_MODE_SELECT 0 xa0
#define OV08D10_MODE_STANDBY 0 x00
#define OV08D10_MODE_STREAMING 0 x01
/* vertical-timings from sensor */
#define OV08D10_REG_VTS_H 0 x05
#define OV08D10_REG_VTS_L 0 x06
#define OV08D10_VTS_MAX 0 x7fff
/* Exposure controls from sensor */
#define OV08D10_REG_EXPOSURE_H 0 x02
#define OV08D10_REG_EXPOSURE_M 0 x03
#define OV08D10_REG_EXPOSURE_L 0 x04
#define OV08D10_EXPOSURE_MIN 6
#define OV08D10_EXPOSURE_MAX_MARGIN 6
#define OV08D10_EXPOSURE_STEP 1
/* Analog gain controls from sensor */
#define OV08D10_REG_ANALOG_GAIN 0 x24
#define OV08D10_ANAL_GAIN_MIN 128
#define OV08D10_ANAL_GAIN_MAX 2047
#define OV08D10_ANAL_GAIN_STEP 1
/* Digital gain controls from sensor */
#define OV08D10_REG_MWB_DGAIN_C 0 x21
#define OV08D10_REG_MWB_DGAIN_F 0 x22
#define OV08D10_DGTL_GAIN_MIN 0
#define OV08D10_DGTL_GAIN_MAX 4095
#define OV08D10_DGTL_GAIN_STEP 1
#define OV08D10_DGTL_GAIN_DEFAULT 1024
/* Test Pattern Control */
#define OV08D10_REG_TEST_PATTERN 0 x12
#define OV08D10_TEST_PATTERN_ENABLE 0 x01
#define OV08D10_TEST_PATTERN_DISABLE 0 x00
/* Flip Mirror Controls from sensor */
#define OV08D10_REG_FLIP_OPT 0 x32
#define OV08D10_REG_FLIP_MASK 0 x3
#define to_ov08d10(_sd) container_of(_sd, struct ov08d10, sd)
struct ov08d10_reg {
u8 address;
u8 val;
};
struct ov08d10_reg_list {
u32 num_of_regs;
const struct ov08d10_reg *regs;
};
struct ov08d10_link_freq_config {
const struct ov08d10_reg_list reg_list;
};
struct ov08d10_mode {
/* Frame width in pixels */
u32 width;
/* Frame height in pixels */
u32 height;
/* Horizontal timining size */
u32 hts;
/* Default vertical timining size */
u32 vts_def;
/* Min vertical timining size */
u32 vts_min;
/* Link frequency needed for this resolution */
u32 link_freq_index;
/* Sensor register settings for this resolution */
const struct ov08d10_reg_list reg_list;
/* Number of data lanes */
u8 data_lanes;
};
/* 3280x2460, 3264x2448 need 720Mbps/lane, 2 lanes */
static const struct ov08d10_reg mipi_data_rate_720mbps[] = {
{0 xfd, 0 x00},
{0 x11, 0 x2a},
{0 x14, 0 x43},
{0 x1a, 0 x04},
{0 x1b, 0 xe1},
{0 x1e, 0 x13},
{0 xb7, 0 x02}
};
/* 1632x1224 needs 360Mbps/lane, 2 lanes */
static const struct ov08d10_reg mipi_data_rate_360mbps[] = {
{0 xfd, 0 x00},
{0 x1a, 0 x04},
{0 x1b, 0 xe1},
{0 x1d, 0 x00},
{0 x1c, 0 x19},
{0 x11, 0 x2a},
{0 x14, 0 x54},
{0 x1e, 0 x13},
{0 xb7, 0 x02}
};
static const struct ov08d10_reg lane_2_mode_3280x2460[] = {
/* 3280x2460 resolution */
{0 xfd, 0 x01},
{0 x12, 0 x00},
{0 x03, 0 x12},
{0 x04, 0 x58},
{0 x07, 0 x05},
{0 x21, 0 x02},
{0 x24, 0 x30},
{0 x33, 0 x03},
{0 x01, 0 x03},
{0 x19, 0 x10},
{0 x42, 0 x55},
{0 x43, 0 x00},
{0 x47, 0 x07},
{0 x48, 0 x08},
{0 xb2, 0 x7f},
{0 xb3, 0 x7b},
{0 xbd, 0 x08},
{0 xd2, 0 x57},
{0 xd3, 0 x10},
{0 xd4, 0 x08},
{0 xd5, 0 x08},
{0 xd6, 0 x06},
{0 xb1, 0 x00},
{0 xb4, 0 x00},
{0 xb7, 0 x0a},
{0 xbc, 0 x44},
{0 xbf, 0 x48},
{0 xc1, 0 x10},
{0 xc3, 0 x24},
{0 xc8, 0 x03},
{0 xc9, 0 xf8},
{0 xe1, 0 x33},
{0 xe2, 0 xbb},
{0 x51, 0 x0c},
{0 x52, 0 x0a},
{0 x57, 0 x8c},
{0 x59, 0 x09},
{0 x5a, 0 x08},
{0 x5e, 0 x10},
{0 x60, 0 x02},
{0 x6d, 0 x5c},
{0 x76, 0 x16},
{0 x7c, 0 x11},
{0 x90, 0 x28},
{0 x91, 0 x16},
{0 x92, 0 x1c},
{0 x93, 0 x24},
{0 x95, 0 x48},
{0 x9c, 0 x06},
{0 xca, 0 x0c},
{0 xce, 0 x0d},
{0 xfd, 0 x01},
{0 xc0, 0 x00},
{0 xdd, 0 x18},
{0 xde, 0 x19},
{0 xdf, 0 x32},
{0 xe0, 0 x70},
{0 xfd, 0 x01},
{0 xc2, 0 x05},
{0 xd7, 0 x88},
{0 xd8, 0 x77},
{0 xd9, 0 x00},
{0 xfd, 0 x07},
{0 x00, 0 xf8},
{0 x01, 0 x2b},
{0 x05, 0 x40},
{0 x08, 0 x06},
{0 x09, 0 x11},
{0 x28, 0 x6f},
{0 x2a, 0 x20},
{0 x2b, 0 x05},
{0 x5e, 0 x10},
{0 x52, 0 x00},
{0 x53, 0 x7c},
{0 x54, 0 x00},
{0 x55, 0 x7c},
{0 x56, 0 x00},
{0 x57, 0 x7c},
{0 x58, 0 x00},
{0 x59, 0 x7c},
{0 xfd, 0 x02},
{0 x9a, 0 x30},
{0 xa8, 0 x02},
{0 xfd, 0 x02},
{0 xa1, 0 x01},
{0 xa2, 0 x09},
{0 xa3, 0 x9c},
{0 xa5, 0 x00},
{0 xa6, 0 x0c},
{0 xa7, 0 xd0},
{0 xfd, 0 x00},
{0 x24, 0 x01},
{0 xc0, 0 x16},
{0 xc1, 0 x08},
{0 xc2, 0 x30},
{0 x8e, 0 x0c},
{0 x8f, 0 xd0},
{0 x90, 0 x09},
{0 x91, 0 x9c},
{0 xfd, 0 x05},
{0 x04, 0 x40},
{0 x07, 0 x00},
{0 x0d, 0 x01},
{0 x0f, 0 x01},
{0 x10, 0 x00},
{0 x11, 0 x00},
{0 x12, 0 x0c},
{0 x13, 0 xcf},
{0 x14, 0 x00},
{0 x15, 0 x00},
{0 xfd, 0 x00},
{0 x20, 0 x0f},
{0 xe7, 0 x03},
{0 xe7, 0 x00}
};
static const struct ov08d10_reg lane_2_mode_3264x2448[] = {
/* 3264x2448 resolution */
{0 xfd, 0 x01},
{0 x12, 0 x00},
{0 x03, 0 x12},
{0 x04, 0 x58},
{0 x07, 0 x05},
{0 x21, 0 x02},
{0 x24, 0 x30},
{0 x33, 0 x03},
{0 x01, 0 x03},
{0 x19, 0 x10},
{0 x42, 0 x55},
{0 x43, 0 x00},
{0 x47, 0 x07},
{0 x48, 0 x08},
{0 xb2, 0 x7f},
{0 xb3, 0 x7b},
{0 xbd, 0 x08},
{0 xd2, 0 x57},
{0 xd3, 0 x10},
{0 xd4, 0 x08},
{0 xd5, 0 x08},
{0 xd6, 0 x06},
{0 xb1, 0 x00},
{0 xb4, 0 x00},
{0 xb7, 0 x0a},
{0 xbc, 0 x44},
{0 xbf, 0 x48},
{0 xc1, 0 x10},
{0 xc3, 0 x24},
{0 xc8, 0 x03},
{0 xc9, 0 xf8},
{0 xe1, 0 x33},
{0 xe2, 0 xbb},
{0 x51, 0 x0c},
{0 x52, 0 x0a},
{0 x57, 0 x8c},
{0 x59, 0 x09},
{0 x5a, 0 x08},
{0 x5e, 0 x10},
{0 x60, 0 x02},
{0 x6d, 0 x5c},
{0 x76, 0 x16},
{0 x7c, 0 x11},
{0 x90, 0 x28},
{0 x91, 0 x16},
{0 x92, 0 x1c},
{0 x93, 0 x24},
{0 x95, 0 x48},
{0 x9c, 0 x06},
{0 xca, 0 x0c},
{0 xce, 0 x0d},
{0 xfd, 0 x01},
{0 xc0, 0 x00},
{0 xdd, 0 x18},
{0 xde, 0 x19},
{0 xdf, 0 x32},
{0 xe0, 0 x70},
{0 xfd, 0 x01},
{0 xc2, 0 x05},
{0 xd7, 0 x88},
{0 xd8, 0 x77},
{0 xd9, 0 x00},
{0 xfd, 0 x07},
{0 x00, 0 xf8},
{0 x01, 0 x2b},
{0 x05, 0 x40},
{0 x08, 0 x06},
{0 x09, 0 x11},
{0 x28, 0 x6f},
{0 x2a, 0 x20},
{0 x2b, 0 x05},
{0 x5e, 0 x10},
{0 x52, 0 x00},
{0 x53, 0 x7c},
{0 x54, 0 x00},
{0 x55, 0 x7c},
{0 x56, 0 x00},
{0 x57, 0 x7c},
{0 x58, 0 x00},
{0 x59, 0 x7c},
{0 xfd, 0 x02},
{0 x9a, 0 x30},
{0 xa8, 0 x02},
{0 xfd, 0 x02},
{0 xa1, 0 x09},
{0 xa2, 0 x09},
{0 xa3, 0 x90},
{0 xa5, 0 x08},
{0 xa6, 0 x0c},
{0 xa7, 0 xc0},
{0 xfd, 0 x00},
{0 x24, 0 x01},
{0 xc0, 0 x16},
{0 xc1, 0 x08},
{0 xc2, 0 x30},
{0 x8e, 0 x0c},
{0 x8f, 0 xc0},
{0 x90, 0 x09},
{0 x91, 0 x90},
{0 xfd, 0 x05},
{0 x04, 0 x40},
{0 x07, 0 x00},
{0 x0d, 0 x01},
{0 x0f, 0 x01},
{0 x10, 0 x00},
{0 x11, 0 x00},
{0 x12, 0 x0c},
{0 x13, 0 xcf},
{0 x14, 0 x00},
{0 x15, 0 x00},
{0 xfd, 0 x00},
{0 x20, 0 x0f},
{0 xe7, 0 x03},
{0 xe7, 0 x00}
};
static const struct ov08d10_reg lane_2_mode_1632x1224[] = {
/* 1640x1232 resolution */
{0 xfd, 0 x01},
{0 x1a, 0 x0a},
{0 x1b, 0 x08},
{0 x2a, 0 x01},
{0 x2b, 0 x9a},
{0 xfd, 0 x01},
{0 x12, 0 x00},
{0 x03, 0 x05},
{0 x04, 0 xe2},
{0 x07, 0 x05},
{0 x21, 0 x02},
{0 x24, 0 x30},
{0 x33, 0 x03},
{0 x31, 0 x06},
{0 x33, 0 x03},
{0 x01, 0 x03},
{0 x19, 0 x10},
{0 x42, 0 x55},
{0 x43, 0 x00},
{0 x47, 0 x07},
{0 x48, 0 x08},
{0 xb2, 0 x7f},
{0 xb3, 0 x7b},
{0 xbd, 0 x08},
{0 xd2, 0 x57},
{0 xd3, 0 x10},
{0 xd4, 0 x08},
{0 xd5, 0 x08},
{0 xd6, 0 x06},
{0 xb1, 0 x00},
{0 xb4, 0 x00},
{0 xb7, 0 x0a},
{0 xbc, 0 x44},
{0 xbf, 0 x48},
{0 xc1, 0 x10},
{0 xc3, 0 x24},
{0 xc8, 0 x03},
{0 xc9, 0 xf8},
{0 xe1, 0 x33},
{0 xe2, 0 xbb},
{0 x51, 0 x0c},
{0 x52, 0 x0a},
{0 x57, 0 x8c},
{0 x59, 0 x09},
{0 x5a, 0 x08},
{0 x5e, 0 x10},
{0 x60, 0 x02},
{0 x6d, 0 x5c},
{0 x76, 0 x16},
{0 x7c, 0 x1a},
{0 x90, 0 x28},
{0 x91, 0 x16},
{0 x92, 0 x1c},
{0 x93, 0 x24},
{0 x95, 0 x48},
{0 x9c, 0 x06},
{0 xca, 0 x0c},
{0 xce, 0 x0d},
{0 xfd, 0 x01},
{0 xc0, 0 x00},
{0 xdd, 0 x18},
{0 xde, 0 x19},
{0 xdf, 0 x32},
{0 xe0, 0 x70},
{0 xfd, 0 x01},
{0 xc2, 0 x05},
{0 xd7, 0 x88},
{0 xd8, 0 x77},
{0 xd9, 0 x00},
{0 xfd, 0 x07},
{0 x00, 0 xf8},
{0 x01, 0 x2b},
{0 x05, 0 x40},
{0 x08, 0 x03},
{0 x09, 0 x08},
{0 x28, 0 x6f},
{0 x2a, 0 x20},
{0 x2b, 0 x05},
{0 x2c, 0 x01},
{0 x50, 0 x02},
{0 x51, 0 x03},
{0 x5e, 0 x00},
{0 x52, 0 x00},
{0 x53, 0 x7c},
{0 x54, 0 x00},
{0 x55, 0 x7c},
{0 x56, 0 x00},
{0 x57, 0 x7c},
{0 x58, 0 x00},
{0 x59, 0 x7c},
{0 xfd, 0 x02},
{0 x9a, 0 x30},
{0 xa8, 0 x02},
{0 xfd, 0 x02},
{0 xa9, 0 x04},
{0 xaa, 0 xd0},
{0 xab, 0 x06},
{0 xac, 0 x68},
{0 xa1, 0 x09},
{0 xa2, 0 x04},
{0 xa3, 0 xc8},
{0 xa5, 0 x04},
{0 xa6, 0 x06},
{0 xa7, 0 x60},
{0 xfd, 0 x05},
{0 x06, 0 x80},
{0 x18, 0 x06},
{0 x19, 0 x68},
{0 xfd, 0 x00},
{0 x24, 0 x01},
{0 xc0, 0 x16},
{0 xc1, 0 x08},
{0 xc2, 0 x30},
{0 x8e, 0 x06},
{0 x8f, 0 x60},
{0 x90, 0 x04},
{0 x91, 0 xc8},
{0 x93, 0 x0e},
{0 x94, 0 x77},
{0 x95, 0 x77},
{0 x96, 0 x10},
{0 x98, 0 x88},
{0 x9c, 0 x1a},
{0 xfd, 0 x05},
{0 x04, 0 x40},
{0 x07, 0 x99},
{0 x0d, 0 x03},
{0 x0f, 0 x03},
{0 x10, 0 x00},
{0 x11, 0 x00},
{0 x12, 0 x0c},
{0 x13, 0 xcf},
{0 x14, 0 x00},
{0 x15, 0 x00},
{0 xfd, 0 x00},
{0 x20, 0 x0f},
{0 xe7, 0 x03},
{0 xe7, 0 x00},
};
static const char * const ov08d10_test_pattern_menu[] = {
"Disabled" ,
"Standard Color Bar" ,
};
struct ov08d10 {
struct v4l2_subdev sd;
struct media_pad pad;
struct v4l2_ctrl_handler ctrl_handler;
struct clk *xvclk;
/* V4L2 Controls */
struct v4l2_ctrl *link_freq;
struct v4l2_ctrl *pixel_rate;
struct v4l2_ctrl *vblank;
struct v4l2_ctrl *hblank;
struct v4l2_ctrl *vflip;
struct v4l2_ctrl *hflip;
struct v4l2_ctrl *exposure;
/* Current mode */
const struct ov08d10_mode *cur_mode;
/* To serialize asynchronus callbacks */
struct mutex mutex;
/* lanes index */
u8 nlanes;
const struct ov08d10_lane_cfg *priv_lane;
u8 modes_size;
};
struct ov08d10_lane_cfg {
const s64 link_freq_menu[2 ];
const struct ov08d10_link_freq_config link_freq_configs[2 ];
const struct ov08d10_mode sp_modes[3 ];
};
static const struct ov08d10_lane_cfg lane_cfg_2 = {
{
720000000 ,
360000000 ,
},
{{
.reg_list = {
.num_of_regs =
ARRAY_SIZE(mipi_data_rate_720mbps),
.regs = mipi_data_rate_720mbps,
}
},
{
.reg_list = {
.num_of_regs =
ARRAY_SIZE(mipi_data_rate_360mbps),
.regs = mipi_data_rate_360mbps,
}
}},
{{
.width = 3280 ,
.height = 2460 ,
.hts = 1840 ,
.vts_def = 2504 ,
.vts_min = 2504 ,
.reg_list = {
.num_of_regs = ARRAY_SIZE(lane_2_mode_3280x2460),
.regs = lane_2_mode_3280x2460,
},
.link_freq_index = 0 ,
.data_lanes = 2 ,
},
{
.width = 3264 ,
.height = 2448 ,
.hts = 1840 ,
.vts_def = 2504 ,
.vts_min = 2504 ,
.reg_list = {
.num_of_regs = ARRAY_SIZE(lane_2_mode_3264x2448),
.regs = lane_2_mode_3264x2448,
},
.link_freq_index = 0 ,
.data_lanes = 2 ,
},
{
.width = 1632 ,
.height = 1224 ,
.hts = 1912 ,
.vts_def = 3736 ,
.vts_min = 3736 ,
.reg_list = {
.num_of_regs = ARRAY_SIZE(lane_2_mode_1632x1224),
.regs = lane_2_mode_1632x1224,
},
.link_freq_index = 1 ,
.data_lanes = 2 ,
}}
};
static u32 ov08d10_get_format_code(struct ov08d10 *ov08d10)
{
static const u32 codes[2 ][2 ] = {
{ MEDIA_BUS_FMT_SGRBG10_1X10, MEDIA_BUS_FMT_SRGGB10_1X10},
{ MEDIA_BUS_FMT_SBGGR10_1X10, MEDIA_BUS_FMT_SGBRG10_1X10},
};
return codes[ov08d10->vflip->val][ov08d10->hflip->val];
}
static unsigned int ov08d10_modes_num(const struct ov08d10 *ov08d10)
{
unsigned int i, count = 0 ;
for (i = 0 ; i < ARRAY_SIZE(ov08d10->priv_lane->sp_modes); i++) {
if (ov08d10->priv_lane->sp_modes[i].width == 0 )
break ;
count++;
}
return count;
}
static u64 to_rate(const s64 *link_freq_menu,
u32 f_index, u8 nlanes)
{
u64 pixel_rate = link_freq_menu[f_index] * 2 * nlanes;
do_div(pixel_rate, OV08D10_RGB_DEPTH);
return pixel_rate;
}
static u64 to_pixels_per_line(const s64 *link_freq_menu, u32 hts,
u32 f_index, u8 nlanes)
{
u64 ppl = hts * to_rate(link_freq_menu, f_index, nlanes);
do_div(ppl, OV08D10_SCLK);
return ppl;
}
static int ov08d10_write_reg_list(struct ov08d10 *ov08d10,
const struct ov08d10_reg_list *r_list)
{
struct i2c_client *client = v4l2_get_subdevdata(&ov08d10->sd);
unsigned int i;
int ret;
for (i = 0 ; i < r_list->num_of_regs; i++) {
ret = i2c_smbus_write_byte_data(client, r_list->regs[i].address,
r_list->regs[i].val);
if (ret) {
dev_err_ratelimited(&client->dev,
"failed to write reg 0x%2.2x. error = %d" ,
r_list->regs[i].address, ret);
return ret;
}
}
return 0 ;
}
static int ov08d10_update_analog_gain(struct ov08d10 *ov08d10, u32 a_gain)
{
struct i2c_client *client = v4l2_get_subdevdata(&ov08d10->sd);
u8 val;
int ret;
val = ((a_gain >> 3 ) & 0 xFF);
/* CIS control registers */
ret = i2c_smbus_write_byte_data(client, OV08D10_REG_PAGE, 0 x01);
if (ret < 0 )
return ret;
/* update AGAIN */
ret = i2c_smbus_write_byte_data(client, OV08D10_REG_ANALOG_GAIN, val);
if (ret < 0 )
return ret;
return i2c_smbus_write_byte_data(client,
OV08D10_REG_GLOBAL_EFFECTIVE, 0 x01);
}
static int ov08d10_update_digital_gain(struct ov08d10 *ov08d10, u32 d_gain)
{
struct i2c_client *client = v4l2_get_subdevdata(&ov08d10->sd);
u8 val;
int ret;
d_gain = (d_gain >> 1 );
/* CIS control registers */
ret = i2c_smbus_write_byte_data(client, OV08D10_REG_PAGE, 0 x01);
if (ret < 0 )
return ret;
val = ((d_gain >> 8 ) & 0 x3F);
/* update DGAIN */
ret = i2c_smbus_write_byte_data(client, OV08D10_REG_MWB_DGAIN_C, val);
if (ret < 0 )
return ret;
val = d_gain & 0 xFF;
ret = i2c_smbus_write_byte_data(client, OV08D10_REG_MWB_DGAIN_F, val);
if (ret < 0 )
return ret;
return i2c_smbus_write_byte_data(client,
OV08D10_REG_GLOBAL_EFFECTIVE, 0 x01);
}
static int ov08d10_set_exposure(struct ov08d10 *ov08d10, u32 exposure)
{
struct i2c_client *client = v4l2_get_subdevdata(&ov08d10->sd);
u8 val;
u8 hts_h, hts_l;
u32 hts, cur_vts, exp_cal;
int ret;
cur_vts = ov08d10->cur_mode->vts_def;
ret = i2c_smbus_write_byte_data(client, OV08D10_REG_PAGE, 0 x01);
if (ret < 0 )
return ret;
hts_h = i2c_smbus_read_byte_data(client, 0 x37);
hts_l = i2c_smbus_read_byte_data(client, 0 x38);
hts = ((hts_h << 8 ) | (hts_l));
exp_cal = 66 * OV08D10_ROWCLK / hts;
exposure = exposure * exp_cal / (cur_vts - OV08D10_EXPOSURE_MAX_MARGIN);
/* CIS control registers */
ret = i2c_smbus_write_byte_data(client, OV08D10_REG_PAGE, 0 x01);
if (ret < 0 )
return ret;
/* update exposure */
val = ((exposure >> 16 ) & 0 xFF);
ret = i2c_smbus_write_byte_data(client, OV08D10_REG_EXPOSURE_H, val);
if (ret < 0 )
return ret;
val = ((exposure >> 8 ) & 0 xFF);
ret = i2c_smbus_write_byte_data(client, OV08D10_REG_EXPOSURE_M, val);
if (ret < 0 )
return ret;
val = exposure & 0 xFF;
ret = i2c_smbus_write_byte_data(client, OV08D10_REG_EXPOSURE_L, val);
if (ret < 0 )
return ret;
return i2c_smbus_write_byte_data(client,
OV08D10_REG_GLOBAL_EFFECTIVE, 0 x01);
}
static int ov08d10_set_vblank(struct ov08d10 *ov08d10, u32 vblank)
{
struct i2c_client *client = v4l2_get_subdevdata(&ov08d10->sd);
u8 val;
int ret;
/* CIS control registers */
ret = i2c_smbus_write_byte_data(client, OV08D10_REG_PAGE, 0 x01);
if (ret < 0 )
return ret;
val = ((vblank >> 8 ) & 0 xFF);
/* update vblank */
ret = i2c_smbus_write_byte_data(client, OV08D10_REG_VTS_H, val);
if (ret < 0 )
return ret;
val = vblank & 0 xFF;
ret = i2c_smbus_write_byte_data(client, OV08D10_REG_VTS_L, val);
if (ret < 0 )
return ret;
return i2c_smbus_write_byte_data(client,
OV08D10_REG_GLOBAL_EFFECTIVE, 0 x01);
}
static int ov08d10_test_pattern(struct ov08d10 *ov08d10, u32 pattern)
{
struct i2c_client *client = v4l2_get_subdevdata(&ov08d10->sd);
u8 val;
int ret;
if (pattern)
val = OV08D10_TEST_PATTERN_ENABLE;
else
val = OV08D10_TEST_PATTERN_DISABLE;
/* CIS control registers */
ret = i2c_smbus_write_byte_data(client, OV08D10_REG_PAGE, 0 x01);
if (ret < 0 )
return ret;
ret = i2c_smbus_write_byte_data(client,
OV08D10_REG_TEST_PATTERN, val);
if (ret < 0 )
return ret;
return i2c_smbus_write_byte_data(client,
OV08D10_REG_GLOBAL_EFFECTIVE, 0 x01);
}
static int ov08d10_set_ctrl_flip(struct ov08d10 *ov08d10, u32 ctrl_val)
{
struct i2c_client *client = v4l2_get_subdevdata(&ov08d10->sd);
u8 val;
int ret;
/* System control registers */
ret = i2c_smbus_write_byte_data(client, OV08D10_REG_PAGE, 0 x01);
if (ret < 0 )
return ret;
ret = i2c_smbus_read_byte_data(client, OV08D10_REG_FLIP_OPT);
if (ret < 0 )
return ret;
val = ret | (ctrl_val & OV08D10_REG_FLIP_MASK);
ret = i2c_smbus_write_byte_data(client, OV08D10_REG_PAGE, 0 x01);
if (ret < 0 )
return ret;
ret = i2c_smbus_write_byte_data(client, OV08D10_REG_FLIP_OPT, val);
if (ret < 0 )
return ret;
return i2c_smbus_write_byte_data(client,
OV08D10_REG_GLOBAL_EFFECTIVE, 0 x01);
}
static int ov08d10_set_ctrl(struct v4l2_ctrl *ctrl)
{
struct ov08d10 *ov08d10 = container_of(ctrl->handler,
struct ov08d10, ctrl_handler);
struct i2c_client *client = v4l2_get_subdevdata(&ov08d10->sd);
s64 exposure_max;
int ret;
/* Propagate change of current control to all related controls */
if (ctrl->id == V4L2_CID_VBLANK) {
/* Update max exposure while meeting expected vblanking */
exposure_max = ov08d10->cur_mode->height + ctrl->val -
OV08D10_EXPOSURE_MAX_MARGIN;
__v4l2_ctrl_modify_range(ov08d10->exposure,
ov08d10->exposure->minimum,
exposure_max, ov08d10->exposure->step,
exposure_max);
}
/* V4L2 controls values will be applied only when power is already up */
if (!pm_runtime_get_if_in_use(&client->dev))
return 0 ;
switch (ctrl->id) {
case V4L2_CID_ANALOGUE_GAIN:
ret = ov08d10_update_analog_gain(ov08d10, ctrl->val);
break ;
case V4L2_CID_DIGITAL_GAIN:
ret = ov08d10_update_digital_gain(ov08d10, ctrl->val);
break ;
case V4L2_CID_EXPOSURE:
ret = ov08d10_set_exposure(ov08d10, ctrl->val);
break ;
case V4L2_CID_VBLANK:
ret = ov08d10_set_vblank(ov08d10, ctrl->val);
break ;
case V4L2_CID_TEST_PATTERN:
ret = ov08d10_test_pattern(ov08d10, ctrl->val);
break ;
case V4L2_CID_HFLIP:
case V4L2_CID_VFLIP:
ret = ov08d10_set_ctrl_flip(ov08d10,
ov08d10->hflip->val |
ov08d10->vflip->val << 1 );
break ;
default :
ret = -EINVAL;
break ;
}
pm_runtime_put(&client->dev);
return ret;
}
static const struct v4l2_ctrl_ops ov08d10_ctrl_ops = {
.s_ctrl = ov08d10_set_ctrl,
};
static int ov08d10_init_controls(struct ov08d10 *ov08d10)
{
struct v4l2_ctrl_handler *ctrl_hdlr;
u8 link_freq_size;
s64 exposure_max;
s64 vblank_def;
s64 vblank_min;
s64 h_blank;
s64 pixel_rate_max;
const struct ov08d10_mode *mode;
int ret;
ctrl_hdlr = &ov08d10->ctrl_handler;
ret = v4l2_ctrl_handler_init(ctrl_hdlr, 8 );
if (ret)
return ret;
ctrl_hdlr->lock = &ov08d10->mutex;
link_freq_size = ARRAY_SIZE(ov08d10->priv_lane->link_freq_menu);
ov08d10->link_freq =
v4l2_ctrl_new_int_menu(ctrl_hdlr, &ov08d10_ctrl_ops,
V4L2_CID_LINK_FREQ,
link_freq_size - 1 ,
0 ,
ov08d10->priv_lane->link_freq_menu);
if (ov08d10->link_freq)
ov08d10->link_freq->flags |= V4L2_CTRL_FLAG_READ_ONLY;
pixel_rate_max = to_rate(ov08d10->priv_lane->link_freq_menu, 0 ,
ov08d10->cur_mode->data_lanes);
ov08d10->pixel_rate =
v4l2_ctrl_new_std(ctrl_hdlr, &ov08d10_ctrl_ops,
V4L2_CID_PIXEL_RATE, 0 , pixel_rate_max, 1 ,
pixel_rate_max);
mode = ov08d10->cur_mode;
vblank_def = mode->vts_def - mode->height;
vblank_min = mode->vts_min - mode->height;
ov08d10->vblank =
v4l2_ctrl_new_std(ctrl_hdlr, &ov08d10_ctrl_ops,
V4L2_CID_VBLANK, vblank_min,
OV08D10_VTS_MAX - mode->height, 1 ,
vblank_def);
h_blank = to_pixels_per_line(ov08d10->priv_lane->link_freq_menu,
mode->hts, mode->link_freq_index,
mode->data_lanes) -
mode->width;
ov08d10->hblank = v4l2_ctrl_new_std(ctrl_hdlr, &ov08d10_ctrl_ops,
V4L2_CID_HBLANK, h_blank, h_blank,
1 , h_blank);
if (ov08d10->hblank)
ov08d10->hblank->flags |= V4L2_CTRL_FLAG_READ_ONLY;
v4l2_ctrl_new_std(ctrl_hdlr, &ov08d10_ctrl_ops, V4L2_CID_ANALOGUE_GAIN,
OV08D10_ANAL_GAIN_MIN, OV08D10_ANAL_GAIN_MAX,
OV08D10_ANAL_GAIN_STEP, OV08D10_ANAL_GAIN_MIN);
v4l2_ctrl_new_std(ctrl_hdlr, &ov08d10_ctrl_ops, V4L2_CID_DIGITAL_GAIN,
OV08D10_DGTL_GAIN_MIN, OV08D10_DGTL_GAIN_MAX,
OV08D10_DGTL_GAIN_STEP, OV08D10_DGTL_GAIN_DEFAULT);
exposure_max = mode->vts_def - OV08D10_EXPOSURE_MAX_MARGIN;
ov08d10->exposure = v4l2_ctrl_new_std(ctrl_hdlr, &ov08d10_ctrl_ops,
V4L2_CID_EXPOSURE,
OV08D10_EXPOSURE_MIN,
exposure_max,
OV08D10_EXPOSURE_STEP,
exposure_max);
v4l2_ctrl_new_std_menu_items(ctrl_hdlr, &ov08d10_ctrl_ops,
V4L2_CID_TEST_PATTERN,
ARRAY_SIZE(ov08d10_test_pattern_menu) - 1 ,
0 , 0 , ov08d10_test_pattern_menu);
ov08d10->hflip = v4l2_ctrl_new_std(ctrl_hdlr, &ov08d10_ctrl_ops,
V4L2_CID_HFLIP, 0 , 1 , 1 , 0 );
if (ov08d10->hflip)
ov08d10->hflip->flags |= V4L2_CTRL_FLAG_MODIFY_LAYOUT;
ov08d10->vflip = v4l2_ctrl_new_std(ctrl_hdlr, &ov08d10_ctrl_ops,
V4L2_CID_VFLIP, 0 , 1 , 1 , 0 );
if (ov08d10->vflip)
ov08d10->vflip->flags |= V4L2_CTRL_FLAG_MODIFY_LAYOUT;
if (ctrl_hdlr->error)
return ctrl_hdlr->error;
ov08d10->sd.ctrl_handler = ctrl_hdlr;
return 0 ;
}
static void ov08d10_update_pad_format(struct ov08d10 *ov08d10,
const struct ov08d10_mode *mode,
struct v4l2_mbus_framefmt *fmt)
{
fmt->width = mode->width;
fmt->height = mode->height;
fmt->code = ov08d10_get_format_code(ov08d10);
fmt->field = V4L2_FIELD_NONE;
}
static int ov08d10_start_streaming(struct ov08d10 *ov08d10)
{
struct i2c_client *client = v4l2_get_subdevdata(&ov08d10->sd);
const struct ov08d10_reg_list *reg_list;
int link_freq_index, ret;
link_freq_index = ov08d10->cur_mode->link_freq_index;
reg_list =
&ov08d10->priv_lane->link_freq_configs[link_freq_index].reg_list;
/* soft reset */
ret = i2c_smbus_write_byte_data(client, OV08D10_REG_PAGE, 0 x00);
if (ret < 0 ) {
dev_err(&client->dev, "failed to reset sensor" );
return ret;
}
ret = i2c_smbus_write_byte_data(client, 0 x20, 0 x0e);
if (ret < 0 ) {
dev_err(&client->dev, "failed to reset sensor" );
return ret;
}
usleep_range(3000 , 4000 );
ret = i2c_smbus_write_byte_data(client, 0 x20, 0 x0b);
if (ret < 0 ) {
dev_err(&client->dev, "failed to reset sensor" );
return ret;
}
/* update sensor setting */
ret = ov08d10_write_reg_list(ov08d10, reg_list);
if (ret) {
dev_err(&client->dev, "failed to set plls" );
return ret;
}
reg_list = &ov08d10->cur_mode->reg_list;
ret = ov08d10_write_reg_list(ov08d10, reg_list);
if (ret) {
dev_err(&client->dev, "failed to set mode" );
return ret;
}
ret = __v4l2_ctrl_handler_setup(ov08d10->sd.ctrl_handler);
if (ret)
return ret;
ret = i2c_smbus_write_byte_data(client, OV08D10_REG_PAGE, 0 x00);
if (ret < 0 )
return ret;
ret = i2c_smbus_write_byte_data(client, OV08D10_REG_MODE_SELECT,
OV08D10_MODE_STREAMING);
if (ret < 0 )
return ret;
return i2c_smbus_write_byte_data(client, OV08D10_REG_PAGE, 0 x01);
}
static void ov08d10_stop_streaming(struct ov08d10 *ov08d10)
{
struct i2c_client *client = v4l2_get_subdevdata(&ov08d10->sd);
int ret;
ret = i2c_smbus_write_byte_data(client, OV08D10_REG_PAGE, 0 x00);
if (ret < 0 ) {
dev_err(&client->dev, "failed to stop streaming" );
return ;
}
ret = i2c_smbus_write_byte_data(client, OV08D10_REG_MODE_SELECT,
OV08D10_MODE_STANDBY);
if (ret < 0 ) {
dev_err(&client->dev, "failed to stop streaming" );
return ;
}
ret = i2c_smbus_write_byte_data(client, OV08D10_REG_PAGE, 0 x01);
if (ret < 0 ) {
dev_err(&client->dev, "failed to stop streaming" );
return ;
}
}
static int ov08d10_set_stream(struct v4l2_subdev *sd, int enable)
{
struct ov08d10 *ov08d10 = to_ov08d10(sd);
struct i2c_client *client = v4l2_get_subdevdata(sd);
int ret = 0 ;
mutex_lock(&ov08d10->mutex);
if (enable) {
ret = pm_runtime_resume_and_get(&client->dev);
if (ret < 0 ) {
mutex_unlock(&ov08d10->mutex);
return ret;
}
ret = ov08d10_start_streaming(ov08d10);
if (ret) {
enable = 0 ;
ov08d10_stop_streaming(ov08d10);
pm_runtime_put(&client->dev);
}
} else {
ov08d10_stop_streaming(ov08d10);
pm_runtime_put(&client->dev);
}
/* vflip and hflip cannot change during streaming */
__v4l2_ctrl_grab(ov08d10->vflip, enable);
__v4l2_ctrl_grab(ov08d10->hflip, enable);
mutex_unlock(&ov08d10->mutex);
return ret;
}
static int ov08d10_set_format(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt)
{
struct ov08d10 *ov08d10 = to_ov08d10(sd);
const struct ov08d10_mode *mode;
s32 vblank_def, h_blank;
s64 pixel_rate;
mode = v4l2_find_nearest_size(ov08d10->priv_lane->sp_modes,
ov08d10->modes_size,
width, height, fmt->format.width,
fmt->format.height);
mutex_lock(&ov08d10->mutex);
ov08d10_update_pad_format(ov08d10, mode, &fmt->format);
if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
*v4l2_subdev_state_get_format(sd_state, fmt->pad) =
fmt->format;
} else {
ov08d10->cur_mode = mode;
__v4l2_ctrl_s_ctrl(ov08d10->link_freq, mode->link_freq_index);
pixel_rate = to_rate(ov08d10->priv_lane->link_freq_menu,
mode->link_freq_index,
ov08d10->cur_mode->data_lanes);
__v4l2_ctrl_s_ctrl_int64(ov08d10->pixel_rate, pixel_rate);
/* Update limits and set FPS to default */
vblank_def = mode->vts_def - mode->height;
__v4l2_ctrl_modify_range(ov08d10->vblank,
mode->vts_min - mode->height,
OV08D10_VTS_MAX - mode->height, 1 ,
vblank_def);
__v4l2_ctrl_s_ctrl(ov08d10->vblank, vblank_def);
h_blank = to_pixels_per_line(ov08d10->priv_lane->link_freq_menu,
mode->hts,
mode->link_freq_index,
ov08d10->cur_mode->data_lanes)
- mode->width;
__v4l2_ctrl_modify_range(ov08d10->hblank, h_blank, h_blank, 1 ,
h_blank);
}
mutex_unlock(&ov08d10->mutex);
return 0 ;
}
static int ov08d10_get_format(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt)
{
struct ov08d10 *ov08d10 = to_ov08d10(sd);
mutex_lock(&ov08d10->mutex);
if (fmt->which == V4L2_SUBDEV_FORMAT_TRY)
fmt->format = *v4l2_subdev_state_get_format(sd_state,
fmt->pad);
else
ov08d10_update_pad_format(ov08d10, ov08d10->cur_mode,
&fmt->format);
mutex_unlock(&ov08d10->mutex);
return 0 ;
}
static int ov08d10_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_mbus_code_enum *code)
{
struct ov08d10 *ov08d10 = to_ov08d10(sd);
if (code->index > 0 )
return -EINVAL;
mutex_lock(&ov08d10->mutex);
code->code = ov08d10_get_format_code(ov08d10);
mutex_unlock(&ov08d10->mutex);
return 0 ;
}
static int ov08d10_enum_frame_size(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_frame_size_enum *fse)
{
struct ov08d10 *ov08d10 = to_ov08d10(sd);
if (fse->index >= ov08d10->modes_size)
return -EINVAL;
mutex_lock(&ov08d10->mutex);
if (fse->code != ov08d10_get_format_code(ov08d10)) {
mutex_unlock(&ov08d10->mutex);
return -EINVAL;
}
mutex_unlock(&ov08d10->mutex);
fse->min_width = ov08d10->priv_lane->sp_modes[fse->index].width;
fse->max_width = fse->min_width;
fse->min_height = ov08d10->priv_lane->sp_modes[fse->index].height;
fse->max_height = fse->min_height;
return 0 ;
}
static int ov08d10_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
{
struct ov08d10 *ov08d10 = to_ov08d10(sd);
mutex_lock(&ov08d10->mutex);
ov08d10_update_pad_format(ov08d10, &ov08d10->priv_lane->sp_modes[0 ],
v4l2_subdev_state_get_format(fh->state, 0 ));
mutex_unlock(&ov08d10->mutex);
return 0 ;
}
static const struct v4l2_subdev_video_ops ov08d10_video_ops = {
.s_stream = ov08d10_set_stream,
};
static const struct v4l2_subdev_pad_ops ov08d10_pad_ops = {
.set_fmt = ov08d10_set_format,
.get_fmt = ov08d10_get_format,
.enum_mbus_code = ov08d10_enum_mbus_code,
.enum_frame_size = ov08d10_enum_frame_size,
};
static const struct v4l2_subdev_ops ov08d10_subdev_ops = {
.video = &ov08d10_video_ops,
.pad = &ov08d10_pad_ops,
};
static const struct v4l2_subdev_internal_ops ov08d10_internal_ops = {
.open = ov08d10_open,
};
static int ov08d10_identify_module(struct ov08d10 *ov08d10)
{
struct i2c_client *client = v4l2_get_subdevdata(&ov08d10->sd);
u32 val;
u16 chip_id;
int ret;
/* System control registers */
ret = i2c_smbus_write_byte_data(client, OV08D10_REG_PAGE, 0 x00);
if (ret < 0 )
return ret;
/* Validate the chip ID */
ret = i2c_smbus_read_byte_data(client, OV08D10_REG_CHIP_ID_0);
if (ret < 0 )
return ret;
val = ret << 8 ;
ret = i2c_smbus_read_byte_data(client, OV08D10_REG_CHIP_ID_1);
if (ret < 0 )
return ret;
chip_id = val | ret;
if ((chip_id & OV08D10_ID_MASK) != OV08D10_CHIP_ID) {
dev_err(&client->dev, "unexpected sensor id(0x%04x)\n" ,
chip_id);
return -EINVAL;
}
return 0 ;
}
static int ov08d10_get_hwcfg(struct ov08d10 *ov08d10, struct device *dev)
{
struct fwnode_handle *ep;
struct fwnode_handle *fwnode = dev_fwnode(dev);
struct v4l2_fwnode_endpoint bus_cfg = {
.bus_type = V4L2_MBUS_CSI2_DPHY
};
u32 xvclk_rate;
unsigned int i, j;
int ret;
if (!fwnode)
return -ENXIO;
ret = fwnode_property_read_u32(fwnode, "clock-frequency" , &xvclk_rate);
if (ret)
return ret;
if (xvclk_rate != OV08D10_XVCLK_19_2)
dev_warn(dev, "external clock rate %u is unsupported" ,
xvclk_rate);
ep = fwnode_graph_get_next_endpoint(fwnode, NULL);
if (!ep)
return -ENXIO;
ret = v4l2_fwnode_endpoint_alloc_parse(ep, &bus_cfg);
fwnode_handle_put(ep);
if (ret)
return ret;
/* Get number of data lanes */
if (bus_cfg.bus.mipi_csi2.num_data_lanes != 2 ) {
dev_err(dev, "number of CSI2 data lanes %d is not supported" ,
bus_cfg.bus.mipi_csi2.num_data_lanes);
ret = -EINVAL;
goto check_hwcfg_error;
}
dev_dbg(dev, "Using %u data lanes\n" , ov08d10->cur_mode->data_lanes);
ov08d10->priv_lane = &lane_cfg_2;
ov08d10->modes_size = ov08d10_modes_num(ov08d10);
if (!bus_cfg.nr_of_link_frequencies) {
dev_err(dev, "no link frequencies defined" );
ret = -EINVAL;
goto check_hwcfg_error;
}
for (i = 0 ; i < ARRAY_SIZE(ov08d10->priv_lane->link_freq_menu); i++) {
for (j = 0 ; j < bus_cfg.nr_of_link_frequencies; j++) {
if (ov08d10->priv_lane->link_freq_menu[i] ==
bus_cfg.link_frequencies[j])
break ;
}
if (j == bus_cfg.nr_of_link_frequencies) {
dev_err(dev, "no link frequency %lld supported" ,
ov08d10->priv_lane->link_freq_menu[i]);
ret = -EINVAL;
goto check_hwcfg_error;
}
}
check_hwcfg_error:
v4l2_fwnode_endpoint_free(&bus_cfg);
return ret;
}
static void ov08d10_remove(struct i2c_client *client)
{
struct v4l2_subdev *sd = i2c_get_clientdata(client);
struct ov08d10 *ov08d10 = to_ov08d10(sd);
v4l2_async_unregister_subdev(sd);
media_entity_cleanup(&sd->entity);
v4l2_ctrl_handler_free(sd->ctrl_handler);
pm_runtime_disable(&client->dev);
mutex_destroy(&ov08d10->mutex);
}
static int ov08d10_probe(struct i2c_client *client)
{
struct ov08d10 *ov08d10;
int ret;
ov08d10 = devm_kzalloc(&client->dev, sizeof (*ov08d10), GFP_KERNEL);
if (!ov08d10)
return -ENOMEM;
ret = ov08d10_get_hwcfg(ov08d10, &client->dev);
if (ret) {
dev_err(&client->dev, "failed to get HW configuration: %d" ,
ret);
return ret;
}
v4l2_i2c_subdev_init(&ov08d10->sd, client, &ov08d10_subdev_ops);
ret = ov08d10_identify_module(ov08d10);
if (ret) {
dev_err(&client->dev, "failed to find sensor: %d" , ret);
return ret;
}
mutex_init(&ov08d10->mutex);
ov08d10->cur_mode = &ov08d10->priv_lane->sp_modes[0 ];
ret = ov08d10_init_controls(ov08d10);
if (ret) {
dev_err(&client->dev, "failed to init controls: %d" , ret);
goto probe_error_v4l2_ctrl_handler_free;
}
ov08d10->sd.internal_ops = &ov08d10_internal_ops;
ov08d10->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
ov08d10->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR;
ov08d10->pad.flags = MEDIA_PAD_FL_SOURCE;
ret = media_entity_pads_init(&ov08d10->sd.entity, 1 , &ov08d10->pad);
if (ret) {
dev_err(&client->dev, "failed to init entity pads: %d" , ret);
goto probe_error_v4l2_ctrl_handler_free;
}
ret = v4l2_async_register_subdev_sensor(&ov08d10->sd);
if (ret < 0 ) {
dev_err(&client->dev, "failed to register V4L2 subdev: %d" ,
ret);
goto probe_error_media_entity_cleanup;
}
/*
* Device is already turned on by i2c-core with ACPI domain PM.
* Enable runtime PM and turn off the device.
*/
pm_runtime_set_active(&client->dev);
pm_runtime_enable(&client->dev);
pm_runtime_idle(&client->dev);
return 0 ;
probe_error_media_entity_cleanup:
media_entity_cleanup(&ov08d10->sd.entity);
probe_error_v4l2_ctrl_handler_free:
v4l2_ctrl_handler_free(ov08d10->sd.ctrl_handler);
mutex_destroy(&ov08d10->mutex);
return ret;
}
#ifdef CONFIG_ACPI
static const struct acpi_device_id ov08d10_acpi_ids[] = {
{ "OVTI08D1" },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(acpi, ov08d10_acpi_ids);
#endif
static struct i2c_driver ov08d10_i2c_driver = {
.driver = {
.name = "ov08d10" ,
.acpi_match_table = ACPI_PTR(ov08d10_acpi_ids),
},
.probe = ov08d10_probe,
.remove = ov08d10_remove,
};
module_i2c_driver(ov08d10_i2c_driver);
MODULE_AUTHOR("Su, Jimmy <jimmy.su@intel.com>" );
MODULE_DESCRIPTION("OmniVision ov08d10 sensor driver" );
MODULE_LICENSE("GPL v2" );
Messung V0.5 in Prozent C=94 H=93 G=93
¤ Dauer der Verarbeitung: 0.15 Sekunden
(vorverarbeitet am 2026-06-08)
¤
*© Formatika GbR, Deutschland