linux/drivers/media/i2c/msp3400-driver.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Programming the mspx4xx sound processor family
 *
 * (c) 1997-2001 Gerd Knorr <[email protected]>
 *
 * what works and what doesn't:
 *
 *  AM-Mono
 *      Support for Hauppauge cards added (decoding handled by tuner) added by
 *      Frederic Crozat <[email protected]>
 *
 *  FM-Mono
 *      should work. The stereo modes are backward compatible to FM-mono,
 *      therefore FM-Mono should be always available.
 *
 *  FM-Stereo (B/G, used in germany)
 *      should work, with autodetect
 *
 *  FM-Stereo (satellite)
 *      should work, no autodetect (i.e. default is mono, but you can
 *      switch to stereo -- untested)
 *
 *  NICAM (B/G, L , used in UK, Scandinavia, Spain and France)
 *      should work, with autodetect. Support for NICAM was added by
 *      Pekka Pietikainen <[email protected]>
 *
 * TODO:
 *   - better SAT support
 *
 * 980623  Thomas Sailer ([email protected])
 *         using soundcore instead of OSS
 */


#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/i2c.h>
#include <linux/kthread.h>
#include <linux/freezer.h>
#include <linux/videodev2.h>
#include <media/v4l2-device.h>
#include <media/v4l2-ioctl.h>
#include <media/drv-intf/msp3400.h>
#include <media/i2c/tvaudio.h>
#include "msp3400-driver.h"

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

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

/* module parameters */
static int opmode   =;
int msp_debug;		 /* msp_debug output */
bool msp_once;		 /* no continuous stereo monitoring */
bool msp_amsound;	 /* hard-wire AM sound at 6.5 Hz (france),
			    the autoscan seems work well only with FM... */
int msp_standard =;    /* Override auto detect of audio msp_standard,
			    if needed. */
bool msp_dolby;

int msp_stereo_thresh =; /* a2 threshold for stereo/bilingual
					(msp34xxg only) 0x00a0-0x03c0 */

/* read-only */
module_param(opmode,           int, 0444);

/* read-write */
module_param_named(once, msp_once,                      bool, 0644);
module_param_named(debug, msp_debug,                    int,  0644);
module_param_named(stereo_threshold, msp_stereo_thresh, int,  0644);
module_param_named(standard, msp_standard,              int,  0644);
module_param_named(amsound, msp_amsound,                bool, 0644);
module_param_named(dolby, msp_dolby,                    bool, 0644);

MODULE_PARM_DESC();
MODULE_PARM_DESC();
MODULE_PARM_DESC();
MODULE_PARM_DESC();
MODULE_PARM_DESC();
MODULE_PARM_DESC();
MODULE_PARM_DESC();

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

/* control subaddress */
#define I2C_MSP_CONTROL
/* demodulator unit subaddress */
#define I2C_MSP_DEM
/* DSP unit subaddress */
#define I2C_MSP_DSP


/* ----------------------------------------------------------------------- */
/* functions for talking to the MSP3400C Sound processor                   */

int msp_reset(struct i2c_client *client)
{}

static int msp_read(struct i2c_client *client, int dev, int addr)
{}

int msp_read_dem(struct i2c_client *client, int addr)
{}

int msp_read_dsp(struct i2c_client *client, int addr)
{}

static int msp_write(struct i2c_client *client, int dev, int addr, int val)
{}

int msp_write_dem(struct i2c_client *client, int addr, int val)
{}

int msp_write_dsp(struct i2c_client *client, int addr, int val)
{}

/* ----------------------------------------------------------------------- *
 * bits  9  8  5 - SCART DSP input Select:
 *       0  0  0 - SCART 1 to DSP input (reset position)
 *       0  1  0 - MONO to DSP input
 *       1  0  0 - SCART 2 to DSP input
 *       1  1  1 - Mute DSP input
 *
 * bits 11 10  6 - SCART 1 Output Select:
 *       0  0  0 - undefined (reset position)
 *       0  1  0 - SCART 2 Input to SCART 1 Output (for devices with 2 SCARTS)
 *       1  0  0 - MONO input to SCART 1 Output
 *       1  1  0 - SCART 1 DA to SCART 1 Output
 *       0  0  1 - SCART 2 DA to SCART 1 Output
 *       0  1  1 - SCART 1 Input to SCART 1 Output
 *       1  1  1 - Mute SCART 1 Output
 *
 * bits 13 12  7 - SCART 2 Output Select (for devices with 2 Output SCART):
 *       0  0  0 - SCART 1 DA to SCART 2 Output (reset position)
 *       0  1  0 - SCART 1 Input to SCART 2 Output
 *       1  0  0 - MONO input to SCART 2 Output
 *       0  0  1 - SCART 2 DA to SCART 2 Output
 *       0  1  1 - SCART 2 Input to SCART 2 Output
 *       1  1  0 - Mute SCART 2 Output
 *
 * Bits 4 to 0 should be zero.
 * ----------------------------------------------------------------------- */

static int scarts[3][9] =;

static char *scart_names[] =;

void msp_set_scart(struct i2c_client *client, int in, int out)
{}

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

static void msp_wake_thread(struct i2c_client *client)
{}

int msp_sleep(struct msp_state *state, int msec)
{}

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

static int msp_s_ctrl(struct v4l2_ctrl *ctrl)
{}

void msp_update_volume(struct msp_state *state)
{}

/* --- v4l2 ioctls --- */
static int msp_s_radio(struct v4l2_subdev *sd)
{}

static int msp_s_frequency(struct v4l2_subdev *sd, const struct v4l2_frequency *freq)
{}

static int msp_querystd(struct v4l2_subdev *sd, v4l2_std_id *id)
{}

static int msp_s_std(struct v4l2_subdev *sd, v4l2_std_id id)
{}

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

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

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

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

static int msp_log_status(struct v4l2_subdev *sd)
{}

#ifdef CONFIG_PM_SLEEP
static int msp_suspend(struct device *dev)
{}

static int msp_resume(struct device *dev)
{}
#endif

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

static const struct v4l2_ctrl_ops msp_ctrl_ops =;

static const struct v4l2_subdev_core_ops msp_core_ops =;

static const struct v4l2_subdev_video_ops msp_video_ops =;

static const struct v4l2_subdev_tuner_ops msp_tuner_ops =;

static const struct v4l2_subdev_audio_ops msp_audio_ops =;

static const struct v4l2_subdev_ops msp_ops =;

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


static const char * const opmode_str[] =;

static int msp_probe(struct i2c_client *client)
{}

static void msp_remove(struct i2c_client *client)
{}

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

static const struct dev_pm_ops msp3400_pm_ops =;

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

static struct i2c_driver msp_driver =;

module_i2c_driver();