linux/drivers/media/i2c/saa717x.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * saa717x - Philips SAA717xHL video decoder driver
 *
 * Based on the saa7115 driver
 *
 * Changes by Ohta Kyuma <[email protected]>
 *    - Apply to SAA717x,NEC uPD64031,uPD64083. (1/31/2004)
 *
 * Changes by T.Adachi ([email protected])
 *    - support audio, video scaler etc, and checked the initialize sequence.
 *
 * Cleaned up by Hans Verkuil <[email protected]>
 *
 * Note: this is a reversed engineered driver based on captures from
 * the I2C bus under Windows. This chip is very similar to the saa7134,
 * though. Unfortunately, this driver is currently only working for NTSC.
 */

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/sched.h>

#include <linux/videodev2.h>
#include <linux/i2c.h>
#include <media/v4l2-device.h>
#include <media/v4l2-ctrls.h>

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

static int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC();

/*
 * Generic i2c probe
 * concerning the addresses: i2c wants 7 bit (without the r/w bit), so '>>1'
 */

struct saa717x_state {};

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

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

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

/* for audio mode */
#define TUNER_AUDIO_MONO
#define TUNER_AUDIO_STEREO
#define TUNER_AUDIO_LANG1
#define TUNER_AUDIO_LANG2

#define SAA717X_NTSC_WIDTH
#define SAA717X_NTSC_HEIGHT

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

static int saa717x_write(struct v4l2_subdev *sd, u32 reg, u32 value)
{}

static void saa717x_write_regs(struct v4l2_subdev *sd, u32 *data)
{}

static u32 saa717x_read(struct v4l2_subdev *sd, u32 reg)
{}

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

static u32 reg_init_initialize[] =;

/* Tuner */
static u32 reg_init_tuner_input[] =;

/* Composite */
static u32 reg_init_composite_input[] =;

/* S-Video */
static u32 reg_init_svideo_input[] =;

static u32 reg_set_audio_template[4][2] =;


/* Get detected audio flags (from saa7134 driver) */
static void get_inf_dev_status(struct v4l2_subdev *sd,
		int *dual_flag, int *stereo_flag)
{}

/* regs write to set audio mode */
static void set_audio_mode(struct v4l2_subdev *sd, int audio_mode)
{}

/* write regs to set audio volume, bass and treble */
static int set_audio_regs(struct v4l2_subdev *sd,
		struct saa717x_state *decoder)
{}

/********** scaling staff ***********/
static void set_h_prescale(struct v4l2_subdev *sd,
		int task, int prescale)
{}

/********** scaling staff ***********/
static void set_v_scale(struct v4l2_subdev *sd, int task, int yscale)
{}

static int saa717x_s_ctrl(struct v4l2_ctrl *ctrl)
{}

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

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

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

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

static int saa717x_s_radio(struct v4l2_subdev *sd)
{}

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

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

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

/* change audio mode */
static int saa717x_s_tuner(struct v4l2_subdev *sd, const struct v4l2_tuner *vt)
{}

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

static int saa717x_log_status(struct v4l2_subdev *sd)
{}

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

static const struct v4l2_ctrl_ops saa717x_ctrl_ops =;

static const struct v4l2_subdev_core_ops saa717x_core_ops =;

static const struct v4l2_subdev_tuner_ops saa717x_tuner_ops =;

static const struct v4l2_subdev_video_ops saa717x_video_ops =;

static const struct v4l2_subdev_audio_ops saa717x_audio_ops =;

static const struct v4l2_subdev_pad_ops saa717x_pad_ops =;

static const struct v4l2_subdev_ops saa717x_ops =;

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


/* i2c implementation */

/* ----------------------------------------------------------------------- */
static int saa717x_probe(struct i2c_client *client)
{}

static void saa717x_remove(struct i2c_client *client)
{}

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

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

static struct i2c_driver saa717x_driver =;

module_i2c_driver();