linux/drivers/media/i2c/cx25840/cx25840-core.c

// SPDX-License-Identifier: GPL-2.0-or-later
/* cx25840 - Conexant CX25840 audio/video decoder driver
 *
 * Copyright (C) 2004 Ulf Eklund
 *
 * Based on the saa7115 driver and on the first version of Chris Kennedy's
 * cx25840 driver.
 *
 * Changes by Tyler Trafford <[email protected]>
 *    - cleanup/rewrite for V4L2 API (2005)
 *
 * VBI support by Hans Verkuil <[email protected]>.
 *
 * NTSC sliced VBI support by Christopher Neufeld <[email protected]>
 * with additional fixes by Hans Verkuil <[email protected]>.
 *
 * CX23885 support by Steven Toth <[email protected]>.
 *
 * CX2388[578] IRQ handling, IO Pin mux configuration and other small fixes are
 * Copyright (C) 2010 Andy Walls <[email protected]>
 *
 * CX23888 DIF support for the HVR1850
 * Copyright (C) 2011 Steven Toth <[email protected]>
 *
 * CX2584x pin to pad mapping and output format configuration support are
 * Copyright (C) 2011 Maciej S. Szmigiero <[email protected]>
 */

#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)

/* apply current vconfig to hardware regs */
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)

/* apply incoming options to the current vconfig */
static void cx25840_vconfig_add(struct cx25840_state *state, u32 cfg_in)
{}

/* ----------------------------------------------------------------------- */

/*
 * Initializes the device in the generic mode.
 * For cx2584x chips also adds additional video output settings provided
 * in @val parameter (CX25840_VCONFIG_*).
 *
 * The generic mode disables some of the ivtv-related hacks in this driver.
 * For cx2584x chips it also enables setting video output configuration while
 * setting it according to datasheet defaults by default.
 */
static int cx25840_init(struct v4l2_subdev *sd, u32 val)
{}

static int cx25840_reset(struct v4l2_subdev *sd, u32 val)
{}

/*
 * This load_fw operation must be called to load the driver's firmware.
 * This will load the firmware on the first invocation (further ones are NOP).
 * Without this the audio standard detection will fail and you will
 * only get mono.
 * Alternatively, you can call the reset operation instead of this one.
 *
 * Since loading the firmware is often problematic when the driver is
 * compiled into the kernel I recommend postponing calling this function
 * until the first open of the video device. Another reason for
 * postponing it is that loading this firmware takes a long time (seconds)
 * due to the slow i2c bus speed. So it will speed up the boot process if
 * you can avoid loading the fw as long as the video device isn't used.
 */
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)
{}

/* Query the current detected video format */
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();