#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/i2c.h>
#include <linux/videodev2.h>
#include <linux/slab.h>
#include <media/v4l2-device.h>
#include <media/v4l2-ctrls.h>
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
static bool debug;
module_param(debug, bool, 0644);
MODULE_PARM_DESC(…) …;
struct cs5345_state { … };
static inline struct cs5345_state *to_state(struct v4l2_subdev *sd)
{ … }
static inline struct v4l2_subdev *to_sd(struct v4l2_ctrl *ctrl)
{ … }
static inline int cs5345_write(struct v4l2_subdev *sd, u8 reg, u8 value)
{ … }
static inline int cs5345_read(struct v4l2_subdev *sd, u8 reg)
{ … }
static int cs5345_s_routing(struct v4l2_subdev *sd,
u32 input, u32 output, u32 config)
{ … }
static int cs5345_s_ctrl(struct v4l2_ctrl *ctrl)
{ … }
#ifdef CONFIG_VIDEO_ADV_DEBUG
static int cs5345_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
{ … }
static int cs5345_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
{ … }
#endif
static int cs5345_log_status(struct v4l2_subdev *sd)
{ … }
static const struct v4l2_ctrl_ops cs5345_ctrl_ops = …;
static const struct v4l2_subdev_core_ops cs5345_core_ops = …;
static const struct v4l2_subdev_audio_ops cs5345_audio_ops = …;
static const struct v4l2_subdev_ops cs5345_ops = …;
static int cs5345_probe(struct i2c_client *client)
{ … }
static void cs5345_remove(struct i2c_client *client)
{ … }
static const struct i2c_device_id cs5345_id[] = …;
MODULE_DEVICE_TABLE(i2c, cs5345_id);
static struct i2c_driver cs5345_driver = …;
module_i2c_driver(…) …;