#include <linux/module.h>
#include <linux/init.h>
#include <linux/i2c.h>
#include <linux/videodev2.h>
#include <linux/ioctl.h>
#include <linux/slab.h>
#include <media/v4l2-subdev.h>
#include <media/v4l2-device.h>
#include <media/v4l2-ctrls.h>
#define TW2804_REG_AUTOGAIN …
#define TW2804_REG_HUE …
#define TW2804_REG_SATURATION …
#define TW2804_REG_CONTRAST …
#define TW2804_REG_BRIGHTNESS …
#define TW2804_REG_COLOR_KILLER …
#define TW2804_REG_GAIN …
#define TW2804_REG_CHROMA_GAIN …
#define TW2804_REG_BLUE_BALANCE …
#define TW2804_REG_RED_BALANCE …
struct tw2804 { … };
static const u8 global_registers[] = …;
static const u8 channel_registers[] = …;
static int write_reg(struct i2c_client *client, u8 reg, u8 value, u8 channel)
{ … }
static int write_regs(struct i2c_client *client, const u8 *regs, u8 channel)
{ … }
static int read_reg(struct i2c_client *client, u8 reg, u8 channel)
{ … }
static inline struct tw2804 *to_state(struct v4l2_subdev *sd)
{ … }
static inline struct tw2804 *to_state_from_ctrl(struct v4l2_ctrl *ctrl)
{ … }
static int tw2804_log_status(struct v4l2_subdev *sd)
{ … }
static int tw2804_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
{ … }
static int tw2804_s_ctrl(struct v4l2_ctrl *ctrl)
{ … }
static int tw2804_s_std(struct v4l2_subdev *sd, v4l2_std_id norm)
{ … }
static int tw2804_s_video_routing(struct v4l2_subdev *sd, u32 input, u32 output,
u32 config)
{ … }
static const struct v4l2_ctrl_ops tw2804_ctrl_ops = …;
static const struct v4l2_subdev_video_ops tw2804_video_ops = …;
static const struct v4l2_subdev_core_ops tw2804_core_ops = …;
static const struct v4l2_subdev_ops tw2804_ops = …;
static int tw2804_probe(struct i2c_client *client)
{ … }
static void tw2804_remove(struct i2c_client *client)
{ … }
static const struct i2c_device_id tw2804_id[] = …;
MODULE_DEVICE_TABLE(i2c, tw2804_id);
static struct i2c_driver tw2804_driver = …;
module_i2c_driver(…) …;
MODULE_LICENSE(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;