#include <linux/bitops.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/slab.h>
#include <linux/v4l2-mediabus.h>
#include <linux/module.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
#define REG_GAIN …
#define REG_BLUE …
#define REG_RED …
#define REG_SAT …
#define REG_HUE …
#define REG_BRT …
#define REG_PIDH …
#define REG_PIDL …
#define REG_AECH …
#define REG_CLKRC …
#define REG_COMA …
#define REG_COMB …
#define REG_COMC …
#define REG_COMD …
#define REG_COML …
#define REG_HSTRT …
#define REG_HSTOP …
#define REG_VSTRT …
#define REG_VSTOP …
#define REG_PSHFT …
#define REG_MIDH …
#define REG_MIDL …
#define REG_HSYNS …
#define REG_HSYNE …
#define REG_COME …
#define REG_YOFF …
#define REG_UOFF …
#define REG_VOFF …
#define REG_AEW …
#define REG_AEB …
#define REG_COMF …
#define REG_COMG …
#define REG_COMH …
#define REG_COMI …
#define REG_FRARL …
#define REG_COMJ …
#define REG_COMK …
#define REG_AVGY …
#define REG_REF0 …
#define REG_REF1 …
#define REG_REF2 …
#define REG_FRAJH …
#define REG_FRAJL …
#define REG_FACT …
#define REG_L1AEC …
#define REG_AVGU …
#define REG_AVGV …
#define REG_SPCB …
#define REG_SPCC …
#define REG_GAM1 …
#define REG_GAM2 …
#define REG_GAM3 …
#define REG_SPCD …
#define REG_SPCE …
#define REG_ADCL …
#define REG_RMCO …
#define REG_GMCO …
#define REG_BMCO …
#define OV6650_PIDH …
#define OV6650_PIDL …
#define OV6650_MIDH …
#define OV6650_MIDL …
#define DEF_GAIN …
#define DEF_BLUE …
#define DEF_RED …
#define SAT_SHIFT …
#define SAT_MASK …
#define SET_SAT(x) …
#define HUE_EN …
#define HUE_MASK …
#define DEF_HUE …
#define SET_HUE(x) …
#define DEF_AECH …
#define CLKRC_8MHz …
#define CLKRC_12MHz …
#define CLKRC_16MHz …
#define CLKRC_24MHz …
#define CLKRC_DIV_MASK …
#define GET_CLKRC_DIV(x) …
#define DEF_CLKRC …
#define COMA_RESET …
#define COMA_QCIF …
#define COMA_RAW_RGB …
#define COMA_RGB …
#define COMA_BW …
#define COMA_WORD_SWAP …
#define COMA_BYTE_SWAP …
#define DEF_COMA …
#define COMB_FLIP_V …
#define COMB_FLIP_H …
#define COMB_BAND_FILTER …
#define COMB_AWB …
#define COMB_AGC …
#define COMB_AEC …
#define DEF_COMB …
#define COML_ONE_CHANNEL …
#define DEF_HSTRT …
#define DEF_HSTOP …
#define DEF_VSTRT …
#define DEF_VSTOP …
#define COMF_HREF_LOW …
#define COMJ_PCLK_RISING …
#define COMJ_VSYNC_HIGH …
#define W_QCIF …
#define W_CIF …
#define H_QCIF …
#define H_CIF …
#define FRAME_RATE_MAX …
struct ov6650_reg { … };
struct ov6650 { … };
struct ov6650_xclk { … };
static const struct ov6650_xclk ov6650_xclk[] = …;
static u32 ov6650_codes[] = …;
static const struct v4l2_mbus_framefmt ov6650_def_fmt = …;
static int ov6650_reg_read(struct i2c_client *client, u8 reg, u8 *val)
{ … }
static int ov6650_reg_write(struct i2c_client *client, u8 reg, u8 val)
{ … }
static int ov6650_reg_rmw(struct i2c_client *client, u8 reg, u8 set, u8 mask)
{ … }
static struct ov6650 *to_ov6650(const struct i2c_client *client)
{ … }
static int ov6650_s_stream(struct v4l2_subdev *sd, int enable)
{ … }
static int ov6550_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
{ … }
static int ov6550_s_ctrl(struct v4l2_ctrl *ctrl)
{ … }
#ifdef CONFIG_VIDEO_ADV_DEBUG
static int ov6650_get_register(struct v4l2_subdev *sd,
struct v4l2_dbg_register *reg)
{ … }
static int ov6650_set_register(struct v4l2_subdev *sd,
const struct v4l2_dbg_register *reg)
{ … }
#endif
static int ov6650_s_power(struct v4l2_subdev *sd, int on)
{ … }
static int ov6650_get_selection(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_selection *sel)
{ … }
static bool is_unscaled_ok(int width, int height, struct v4l2_rect *rect)
{ … }
static void ov6650_bind_align_crop_rectangle(struct v4l2_rect *rect)
{ … }
static int ov6650_set_selection(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_selection *sel)
{ … }
static int ov6650_get_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *format)
{ … }
#define to_clkrc(div) …
static int ov6650_s_fmt(struct v4l2_subdev *sd, u32 code, bool half_scale)
{ … }
static int ov6650_set_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *format)
{ … }
static int ov6650_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_mbus_code_enum *code)
{ … }
static int ov6650_enum_frame_interval(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_frame_interval_enum *fie)
{ … }
static int ov6650_get_frame_interval(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_frame_interval *ival)
{ … }
static int ov6650_set_frame_interval(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_frame_interval *ival)
{ … }
static int ov6650_reset(struct i2c_client *client)
{ … }
static int ov6650_prog_dflt(struct i2c_client *client, u8 clkrc)
{ … }
static int ov6650_video_probe(struct v4l2_subdev *sd)
{ … }
static const struct v4l2_ctrl_ops ov6550_ctrl_ops = …;
static const struct v4l2_subdev_core_ops ov6650_core_ops = …;
static int ov6650_get_mbus_config(struct v4l2_subdev *sd,
unsigned int pad,
struct v4l2_mbus_config *cfg)
{ … }
static const struct v4l2_subdev_video_ops ov6650_video_ops = …;
static const struct v4l2_subdev_pad_ops ov6650_pad_ops = …;
static const struct v4l2_subdev_ops ov6650_subdev_ops = …;
static const struct v4l2_subdev_internal_ops ov6650_internal_ops = …;
static int ov6650_probe(struct i2c_client *client)
{ … }
static void ov6650_remove(struct i2c_client *client)
{ … }
static const struct i2c_device_id ov6650_id[] = …;
MODULE_DEVICE_TABLE(i2c, ov6650_id);
static struct i2c_driver ov6650_i2c_driver = …;
module_i2c_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;