#include <linux/clk.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/v4l2-mediabus.h>
#include <linux/videodev2.h>
#include <media/v4l2-async.h>
#include <media/v4l2-common.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
#include <media/v4l2-event.h>
#include <linux/gpio/consumer.h>
#include "ov9640.h"
#define to_ov9640_sensor(sd) …
static const struct ov9640_reg ov9640_regs_dflt[] = …;
static const struct ov9640_reg ov9640_regs_qqcif[] = …;
static const struct ov9640_reg ov9640_regs_qqvga[] = …;
static const struct ov9640_reg ov9640_regs_qcif[] = …;
static const struct ov9640_reg ov9640_regs_qvga[] = …;
static const struct ov9640_reg ov9640_regs_cif[] = …;
static const struct ov9640_reg ov9640_regs_vga[] = …;
static const struct ov9640_reg ov9640_regs_sxga[] = …;
static const struct ov9640_reg ov9640_regs_yuv[] = …;
static const struct ov9640_reg ov9640_regs_rgb[] = …;
static const u32 ov9640_codes[] = …;
static int ov9640_reg_read(struct i2c_client *client, u8 reg, u8 *val)
{ … }
static int ov9640_reg_write(struct i2c_client *client, u8 reg, u8 val)
{ … }
static int ov9640_reg_rmw(struct i2c_client *client, u8 reg, u8 set, u8 unset)
{ … }
static int ov9640_reset(struct i2c_client *client)
{ … }
static int ov9640_s_stream(struct v4l2_subdev *sd, int enable)
{ … }
static int ov9640_s_ctrl(struct v4l2_ctrl *ctrl)
{ … }
#ifdef CONFIG_VIDEO_ADV_DEBUG
static int ov9640_get_register(struct v4l2_subdev *sd,
struct v4l2_dbg_register *reg)
{ … }
static int ov9640_set_register(struct v4l2_subdev *sd,
const struct v4l2_dbg_register *reg)
{ … }
#endif
static int ov9640_s_power(struct v4l2_subdev *sd, int on)
{ … }
static void ov9640_res_roundup(u32 *width, u32 *height)
{ … }
static void ov9640_alter_regs(u32 code,
struct ov9640_reg_alt *alt)
{ … }
static int ov9640_write_regs(struct i2c_client *client, u32 width,
u32 code, struct ov9640_reg_alt *alts)
{ … }
static int ov9640_prog_dflt(struct i2c_client *client)
{ … }
static int ov9640_s_fmt(struct v4l2_subdev *sd,
struct v4l2_mbus_framefmt *mf)
{ … }
static int ov9640_set_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *format)
{ … }
static int ov9640_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_mbus_code_enum *code)
{ … }
static int ov9640_get_selection(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_selection *sel)
{ … }
static int ov9640_video_probe(struct i2c_client *client)
{ … }
static const struct v4l2_ctrl_ops ov9640_ctrl_ops = …;
static const struct v4l2_subdev_core_ops ov9640_core_ops = …;
static int ov9640_get_mbus_config(struct v4l2_subdev *sd,
unsigned int pad,
struct v4l2_mbus_config *cfg)
{ … }
static const struct v4l2_subdev_video_ops ov9640_video_ops = …;
static const struct v4l2_subdev_pad_ops ov9640_pad_ops = …;
static const struct v4l2_subdev_ops ov9640_subdev_ops = …;
static int ov9640_probe(struct i2c_client *client)
{ … }
static void ov9640_remove(struct i2c_client *client)
{ … }
static const struct i2c_device_id ov9640_id[] = …;
MODULE_DEVICE_TABLE(i2c, ov9640_id);
static struct i2c_driver ov9640_i2c_driver = …;
module_i2c_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;