linux/drivers/media/i2c/saa7115.c

// SPDX-License-Identifier: GPL-2.0+
// saa711x - Philips SAA711x video decoder driver
// This driver can work with saa7111, saa7111a, saa7113, saa7114,
//			     saa7115 and saa7118.
//
// Based on saa7114 driver by Maxim Yevtyushkin, which is based on
// the saa7111 driver by Dave Perks.
//
// Copyright (C) 1998 Dave Perks <[email protected]>
// Copyright (C) 2002 Maxim Yevtyushkin <[email protected]>
//
// Slight changes for video timing and attachment output by
// Wolfgang Scherr <[email protected]>
//
// Moved over to the linux >= 2.4.x i2c protocol (1/1/2003)
// by Ronald Bultje <[email protected]>
//
// Added saa7115 support by Kevin Thayer <nufan_wfk at yahoo.com>
// (2/17/2003)
//
// VBI support (2004) and cleanups (2005) by Hans Verkuil <[email protected]>
//
// Copyright (c) 2005-2006 Mauro Carvalho Chehab <[email protected]>
//	SAA7111, SAA7113 and SAA7118 support

#include "saa711x_regs.h"

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/i2c.h>
#include <linux/videodev2.h>
#include <media/v4l2-device.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-mc.h>
#include <media/i2c/saa7115.h>
#include <asm/div64.h>

#define VRES_60HZ

MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_LICENSE();

static bool debug;
module_param(debug, bool, 0644);

MODULE_PARM_DESC();


enum saa711x_model {};

enum saa711x_pads {};

struct saa711x_state {};

static inline struct saa711x_state *to_state(struct v4l2_subdev *sd)
{}

static inline struct v4l2_subdev *to_sd(struct v4l2_ctrl *ctrl)
{}

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

static inline int saa711x_write(struct v4l2_subdev *sd, u8 reg, u8 value)
{}

/* Sanity routine to check if a register is present */
static int saa711x_has_reg(const int id, const u8 reg)
{}

static int saa711x_writeregs(struct v4l2_subdev *sd, const unsigned char *regs)
{}

static inline int saa711x_read(struct v4l2_subdev *sd, u8 reg)
{}

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

/* SAA7111 initialization table */
static const unsigned char saa7111_init[] =;

/*
 * This table has one illegal value, and some values that are not
 * correct according to the datasheet initialization table.
 *
 *  If you need a table with legal/default values tell the driver in
 *  i2c_board_info.platform_data, and you will get the gm7113c_init
 *  table instead.
 */

/* SAA7113 Init codes */
static const unsigned char saa7113_init[] =;

/*
 * GM7113C is a clone of the SAA7113 chip
 *  This init table is copied out of the saa7113 datasheet.
 *  In R_08 we enable "Automatic Field Detection" [AUFD],
 *  this is disabled when saa711x_set_v4lstd is called.
 */
static const unsigned char gm7113c_init[] =;

/* If a value differs from the Hauppauge driver values, then the comment starts with
   'was 0xXX' to denote the Hauppauge value. Otherwise the value is identical to what the
   Hauppauge driver sets. */

/* SAA7114 and SAA7115 initialization table */
static const unsigned char saa7115_init_auto_input[] =;

/* Used to reset saa7113, saa7114 and saa7115 */
static const unsigned char saa7115_cfg_reset_scaler[] =;

/* ============== SAA7715 VIDEO templates =============  */

static const unsigned char saa7115_cfg_60hz_video[] =;

static const unsigned char saa7115_cfg_50hz_video[] =;

/* ============== SAA7715 VIDEO templates (end) =======  */

static const unsigned char saa7115_cfg_vbi_on[] =;

static const unsigned char saa7115_cfg_vbi_off[] =;


static const unsigned char saa7115_init_misc[] =;

static int saa711x_odd_parity(u8 c)
{}

static int saa711x_decode_vps(u8 *dst, u8 *p)
{}

static int saa711x_decode_wss(u8 *p)
{}

static int saa711x_s_clock_freq(struct v4l2_subdev *sd, u32 freq)
{}

static int saa711x_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
{}

static int saa711x_s_ctrl(struct v4l2_ctrl *ctrl)
{}

static int saa711x_set_size(struct v4l2_subdev *sd, int width, int height)
{}

static void saa711x_set_v4lstd(struct v4l2_subdev *sd, v4l2_std_id std)
{}

/* setup the sliced VBI lcr registers according to the sliced VBI format */
static void saa711x_set_lcr(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_format *fmt)
{}

static int saa711x_g_sliced_fmt(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_format *sliced)
{}

static int saa711x_s_raw_fmt(struct v4l2_subdev *sd, struct v4l2_vbi_format *fmt)
{}

static int saa711x_s_sliced_fmt(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_format *fmt)
{}

static int saa711x_set_fmt(struct v4l2_subdev *sd,
		struct v4l2_subdev_state *sd_state,
		struct v4l2_subdev_format *format)
{}

/* Decode the sliced VBI data stream as created by the saa7115.
   The format is described in the saa7115 datasheet in Tables 25 and 26
   and in Figure 33.
   The current implementation uses SAV/EAV codes and not the ancillary data
   headers. The vbi->p pointer points to the R_5E_SDID byte right after the SAV
   code. */
static int saa711x_decode_vbi_line(struct v4l2_subdev *sd, struct v4l2_decode_vbi_line *vbi)
{}

/* ============ SAA7115 AUDIO settings (end) ============= */

static int saa711x_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
{}

static int saa711x_s_std(struct v4l2_subdev *sd, v4l2_std_id std)
{}

static int saa711x_s_radio(struct v4l2_subdev *sd)
{}

static int saa711x_s_routing(struct v4l2_subdev *sd,
			     u32 input, u32 output, u32 config)
{}

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

static int saa711x_s_stream(struct v4l2_subdev *sd, int enable)
{}

static int saa711x_s_crystal_freq(struct v4l2_subdev *sd, u32 freq, u32 flags)
{}

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

static int saa711x_g_vbi_data(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_data *data)
{}

static int saa711x_querystd(struct v4l2_subdev *sd, v4l2_std_id *std)
{}

static int saa711x_g_input_status(struct v4l2_subdev *sd, u32 *status)
{}

#ifdef CONFIG_VIDEO_ADV_DEBUG
static int saa711x_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
{}

static int saa711x_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
{}
#endif

static int saa711x_log_status(struct v4l2_subdev *sd)
{}

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

static const struct v4l2_ctrl_ops saa711x_ctrl_ops =;

static const struct v4l2_subdev_core_ops saa711x_core_ops =;

static const struct v4l2_subdev_tuner_ops saa711x_tuner_ops =;

static const struct v4l2_subdev_audio_ops saa711x_audio_ops =;

static const struct v4l2_subdev_video_ops saa711x_video_ops =;

static const struct v4l2_subdev_vbi_ops saa711x_vbi_ops =;

static const struct v4l2_subdev_pad_ops saa711x_pad_ops =;

static const struct v4l2_subdev_ops saa711x_ops =;

#define CHIP_VER_SIZE

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

static void saa711x_write_platform_data(struct saa711x_state *state,
					struct saa7115_platform_data *data)
{}

/**
 * saa711x_detect_chip - Detects the saa711x (or clone) variant
 * @client:		I2C client structure.
 * @id:			I2C device ID structure.
 * @name:		Name of the device to be filled.
 *
 * Detects the Philips/NXP saa711x chip, or some clone of it.
 * if 'id' is NULL or id->driver_data is equal to 1, it auto-probes
 * the analog demod.
 * If the tuner is not found, it returns -ENODEV.
 * If auto-detection is disabled and the tuner doesn't match what it was
 *	required, it returns -EINVAL and fills 'name'.
 * If the chip is found, it returns the chip ID and fills 'name'.
 */
static int saa711x_detect_chip(struct i2c_client *client,
			       const struct i2c_device_id *id,
			       char *name)
{}

static int saa711x_probe(struct i2c_client *client)
{}

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

static void saa711x_remove(struct i2c_client *client)
{}

static const struct i2c_device_id saa711x_id[] =;
MODULE_DEVICE_TABLE(i2c, saa711x_id);

static struct i2c_driver saa711x_driver =;

module_i2c_driver();