#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/videodev2.h>
#include <linux/i2c.h>
#include <linux/delay.h>
#include <linux/math64.h>
#include <media/v4l2-common.h>
#include <media/drv-intf/cx25840.h>
#include "cx25840-core.h"
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
#define CX25840_VID_INT_STAT_REG …
#define CX25840_VID_INT_STAT_BITS …
#define CX25840_VID_INT_MASK_BITS …
#define CX25840_VID_INT_MASK_SHFT …
#define CX25840_VID_INT_MASK_REG …
#define CX23885_AUD_MC_INT_MASK_REG …
#define CX23885_AUD_MC_INT_STAT_BITS …
#define CX23885_AUD_MC_INT_CTRL_BITS …
#define CX23885_AUD_MC_INT_STAT_SHFT …
#define CX25840_AUD_INT_CTRL_REG …
#define CX25840_AUD_INT_STAT_REG …
#define CX23885_PIN_CTRL_IRQ_REG …
#define CX23885_PIN_CTRL_IRQ_IR_STAT …
#define CX23885_PIN_CTRL_IRQ_AUD_STAT …
#define CX23885_PIN_CTRL_IRQ_VID_STAT …
#define CX25840_IR_STATS_REG …
#define CX25840_IR_IRQEN_REG …
static int cx25840_debug;
module_param_named(debug, cx25840_debug, int, 0644);
MODULE_PARM_DESC(…) …;
static void cx23888_std_setup(struct i2c_client *client);
int cx25840_write(struct i2c_client *client, u16 addr, u8 value)
{ … }
int cx25840_write4(struct i2c_client *client, u16 addr, u32 value)
{ … }
u8 cx25840_read(struct i2c_client *client, u16 addr)
{ … }
u32 cx25840_read4(struct i2c_client *client, u16 addr)
{ … }
int cx25840_and_or(struct i2c_client *client, u16 addr, unsigned int and_mask,
u8 or_value)
{ … }
int cx25840_and_or4(struct i2c_client *client, u16 addr, u32 and_mask,
u32 or_value)
{ … }
static int set_input(struct i2c_client *client,
enum cx25840_video_input vid_input,
enum cx25840_audio_input aud_input);
static int cx23885_s_io_pin_config(struct v4l2_subdev *sd, size_t n,
struct v4l2_subdev_io_pin_config *p)
{ … }
static u8 cx25840_function_to_pad(struct i2c_client *client, u8 function)
{ … }
static void cx25840_set_invert(u8 *pinctrl3, u8 *voutctrl4, u8 function,
u8 pin, bool invert)
{ … }
static int cx25840_s_io_pin_config(struct v4l2_subdev *sd, size_t n,
struct v4l2_subdev_io_pin_config *p)
{ … }
static int common_s_io_pin_config(struct v4l2_subdev *sd, size_t n,
struct v4l2_subdev_io_pin_config *pincfg)
{ … }
static void init_dll1(struct i2c_client *client)
{ … }
static void init_dll2(struct i2c_client *client)
{ … }
static void cx25836_initialize(struct i2c_client *client)
{ … }
static void cx25840_work_handler(struct work_struct *work)
{ … }
#define CX25840_VCONFIG_SET_BIT(state, opt_msk, voc, idx, bit, oneval) …
static void cx25840_vconfig_apply(struct i2c_client *client)
{ … }
static void cx25840_initialize(struct i2c_client *client)
{ … }
static void cx23885_initialize(struct i2c_client *client)
{ … }
static void cx231xx_initialize(struct i2c_client *client)
{ … }
void cx25840_std_setup(struct i2c_client *client)
{ … }
static void input_change(struct i2c_client *client)
{ … }
static int set_input(struct i2c_client *client,
enum cx25840_video_input vid_input,
enum cx25840_audio_input aud_input)
{ … }
static int set_v4lstd(struct i2c_client *client)
{ … }
static int cx25840_s_ctrl(struct v4l2_ctrl *ctrl)
{ … }
static int cx25840_set_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *format)
{ … }
static void log_video_status(struct i2c_client *client)
{ … }
static void log_audio_status(struct i2c_client *client)
{ … }
#define CX25840_VCONFIG_OPTION(state, cfg_in, opt_msk) …
static void cx25840_vconfig_add(struct cx25840_state *state, u32 cfg_in)
{ … }
static int cx25840_init(struct v4l2_subdev *sd, u32 val)
{ … }
static int cx25840_reset(struct v4l2_subdev *sd, u32 val)
{ … }
static int cx25840_load_fw(struct v4l2_subdev *sd)
{ … }
#ifdef CONFIG_VIDEO_ADV_DEBUG
static int cx25840_g_register(struct v4l2_subdev *sd,
struct v4l2_dbg_register *reg)
{ … }
static int cx25840_s_register(struct v4l2_subdev *sd,
const struct v4l2_dbg_register *reg)
{ … }
#endif
static int cx25840_s_audio_stream(struct v4l2_subdev *sd, int enable)
{ … }
static int cx25840_s_stream(struct v4l2_subdev *sd, int enable)
{ … }
static int cx25840_querystd(struct v4l2_subdev *sd, v4l2_std_id *std)
{ … }
static int cx25840_g_input_status(struct v4l2_subdev *sd, u32 *status)
{ … }
static int cx25840_g_std(struct v4l2_subdev *sd, v4l2_std_id *std)
{ … }
static int cx25840_s_std(struct v4l2_subdev *sd, v4l2_std_id std)
{ … }
static int cx25840_s_radio(struct v4l2_subdev *sd)
{ … }
static int cx25840_s_video_routing(struct v4l2_subdev *sd,
u32 input, u32 output, u32 config)
{ … }
static int cx25840_s_audio_routing(struct v4l2_subdev *sd,
u32 input, u32 output, u32 config)
{ … }
static int cx25840_s_frequency(struct v4l2_subdev *sd,
const struct v4l2_frequency *freq)
{ … }
static int cx25840_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
{ … }
static int cx25840_s_tuner(struct v4l2_subdev *sd, const struct v4l2_tuner *vt)
{ … }
static int cx25840_log_status(struct v4l2_subdev *sd)
{ … }
static int cx23885_irq_handler(struct v4l2_subdev *sd, u32 status,
bool *handled)
{ … }
static int cx25840_irq_handler(struct v4l2_subdev *sd, u32 status,
bool *handled)
{ … }
#define DIF_PLL_FREQ_WORD …
#define DIF_BPF_COEFF01 …
#define DIF_BPF_COEFF23 …
#define DIF_BPF_COEFF45 …
#define DIF_BPF_COEFF67 …
#define DIF_BPF_COEFF89 …
#define DIF_BPF_COEFF1011 …
#define DIF_BPF_COEFF1213 …
#define DIF_BPF_COEFF1415 …
#define DIF_BPF_COEFF1617 …
#define DIF_BPF_COEFF1819 …
#define DIF_BPF_COEFF2021 …
#define DIF_BPF_COEFF2223 …
#define DIF_BPF_COEFF2425 …
#define DIF_BPF_COEFF2627 …
#define DIF_BPF_COEFF2829 …
#define DIF_BPF_COEFF3031 …
#define DIF_BPF_COEFF3233 …
#define DIF_BPF_COEFF3435 …
#define DIF_BPF_COEFF36 …
static const u32 ifhz_coeffs[][19] = …;
static void cx23885_dif_setup(struct i2c_client *client, u32 ifHz)
{ … }
static void cx23888_std_setup(struct i2c_client *client)
{ … }
static const struct v4l2_ctrl_ops cx25840_ctrl_ops = …;
static const struct v4l2_subdev_core_ops cx25840_core_ops = …;
static const struct v4l2_subdev_tuner_ops cx25840_tuner_ops = …;
static const struct v4l2_subdev_audio_ops cx25840_audio_ops = …;
static const struct v4l2_subdev_video_ops cx25840_video_ops = …;
static const struct v4l2_subdev_vbi_ops cx25840_vbi_ops = …;
static const struct v4l2_subdev_pad_ops cx25840_pad_ops = …;
static const struct v4l2_subdev_ops cx25840_ops = …;
static u32 get_cx2388x_ident(struct i2c_client *client)
{ … }
static int cx25840_probe(struct i2c_client *client)
{ … }
static void cx25840_remove(struct i2c_client *client)
{ … }
static const struct i2c_device_id cx25840_id[] = …;
MODULE_DEVICE_TABLE(i2c, cx25840_id);
static struct i2c_driver cx25840_driver = …;
module_i2c_driver(…) …;