#include <linux/init.h>
#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/videodev2.h>
#include <media/v4l2-device.h>
#include <linux/slab.h>
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
struct reg_val { … };
static const struct reg_val regval_init[] = …;
static int write_regs(struct i2c_client *client,
const struct reg_val *rv, int len)
{ … }
static const struct v4l2_subdev_ops ov7640_ops;
static int ov7640_probe(struct i2c_client *client)
{ … }
static void ov7640_remove(struct i2c_client *client)
{ … }
static const struct i2c_device_id ov7640_id[] = …;
MODULE_DEVICE_TABLE(i2c, ov7640_id);
static struct i2c_driver ov7640_driver = …;
module_i2c_driver(…) …;