linux/drivers/media/tuners/tuner-simple.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * i2c tv tuner chip device driver
 * controls all those simple 4-control-bytes style tuners.
 *
 * This "tuner-simple" module was split apart from the original "tuner" module.
 */
#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/videodev2.h>
#include <media/tuner.h>
#include <media/v4l2-common.h>
#include <media/tuner-types.h>
#include "tuner-i2c.h"
#include "tuner-simple.h"

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

#define TUNER_SIMPLE_MAX
static unsigned int simple_devcount;

static int offset;
module_param(offset, int, 0664);
MODULE_PARM_DESC();

static unsigned int atv_input[TUNER_SIMPLE_MAX] =;
static unsigned int dtv_input[TUNER_SIMPLE_MAX] =;
module_param_array();
module_param_array();
MODULE_PARM_DESC();
MODULE_PARM_DESC();

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

/* tv standard selection for Temic 4046 FM5
   this value takes the low bits of control byte 2
   from datasheet Rev.01, Feb.00
     standard     BG      I       L       L2      D
     picture IF   38.9    38.9    38.9    33.95   38.9
     sound 1      33.4    32.9    32.4    40.45   32.4
     sound 2      33.16
     NICAM        33.05   32.348  33.05           33.05
 */
#define TEMIC_SET_PAL_I
#define TEMIC_SET_PAL_DK
#define TEMIC_SET_PAL_L
#define TEMIC_SET_PAL_L2
#define TEMIC_SET_PAL_BG

/* tv tuner system standard selection for Philips FQ1216ME
   this value takes the low bits of control byte 2
   from datasheet "1999 Nov 16" (supersedes "1999 Mar 23")
     standard		BG	DK	I	L	L`
     picture carrier	38.90	38.90	38.90	38.90	33.95
     colour		34.47	34.47	34.47	34.47	38.38
     sound 1		33.40	32.40	32.90	32.40	40.45
     sound 2		33.16	-	-	-	-
     NICAM		33.05	33.05	32.35	33.05	39.80
 */
#define PHILIPS_SET_PAL_I
#define PHILIPS_SET_PAL_BGDK
#define PHILIPS_SET_PAL_L2
#define PHILIPS_SET_PAL_L

/* system switching for Philips FI1216MF MK2
   from datasheet "1996 Jul 09",
    standard         BG     L      L'
    picture carrier  38.90  38.90  33.95
    colour	     34.47  34.37  38.38
    sound 1          33.40  32.40  40.45
    sound 2          33.16  -      -
    NICAM            33.05  33.05  39.80
 */
#define PHILIPS_MF_SET_STD_BG
#define PHILIPS_MF_SET_STD_L
#define PHILIPS_MF_SET_STD_LC

/* Control byte */

#define TUNER_RATIO_MASK
#define TUNER_RATIO_SELECT_50
#define TUNER_RATIO_SELECT_32
#define TUNER_RATIO_SELECT_166
#define TUNER_RATIO_SELECT_62

#define TUNER_CHARGE_PUMP

/* Status byte */

#define TUNER_POR
#define TUNER_FL
#define TUNER_MODE
#define TUNER_AFC
#define TUNER_SIGNAL
#define TUNER_STEREO

#define TUNER_PLL_LOCKED
#define TUNER_STEREO_MK3

static DEFINE_MUTEX(tuner_simple_list_mutex);
static LIST_HEAD(hybrid_tuner_instance_list);

struct tuner_simple_priv {};

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

static int tuner_read_status(struct dvb_frontend *fe)
{}

static inline int tuner_signal(const int status)
{}

static inline int tuner_stereo(const int type, const int status)
{}

static inline int tuner_islocked(const int status)
{}

static inline int tuner_afcstatus(const int status)
{}


static int simple_get_status(struct dvb_frontend *fe, u32 *status)
{}

static int simple_get_rf_strength(struct dvb_frontend *fe, u16 *strength)
{}

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

static inline char *tuner_param_name(enum param_type type)
{}

static struct tuner_params *simple_tuner_params(struct dvb_frontend *fe,
						enum param_type desired_type)
{}

static int simple_config_lookup(struct dvb_frontend *fe,
				struct tuner_params *t_params,
				unsigned *frequency, u8 *config, u8 *cb)
{}

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

static void simple_set_rf_input(struct dvb_frontend *fe,
				u8 *config, u8 *cb, unsigned int rf)
{}

static int simple_std_setup(struct dvb_frontend *fe,
			    struct analog_parameters *params,
			    u8 *config, u8 *cb)
{}

static int simple_set_aux_byte(struct dvb_frontend *fe, u8 config, u8 aux)
{}

static int simple_post_tune(struct dvb_frontend *fe, u8 *buffer,
			    u16 div, u8 config, u8 cb)
{}

static int simple_radio_bandswitch(struct dvb_frontend *fe, u8 *buffer)
{}

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

static int simple_set_tv_freq(struct dvb_frontend *fe,
			      struct analog_parameters *params)
{}

static int simple_set_radio_freq(struct dvb_frontend *fe,
				 struct analog_parameters *params)
{}

static int simple_set_params(struct dvb_frontend *fe,
			     struct analog_parameters *params)
{}

static void simple_set_dvb(struct dvb_frontend *fe, u8 *buf,
			   const u32 delsys,
			   const u32 frequency,
			   const u32 bandwidth)
{}

static u32 simple_dvb_configure(struct dvb_frontend *fe, u8 *buf,
				const u32 delsys,
				const u32 freq,
				const u32 bw)
{}

static int simple_dvb_calc_regs(struct dvb_frontend *fe,
				u8 *buf, int buf_len)
{}

static int simple_dvb_set_params(struct dvb_frontend *fe)
{}

static int simple_init(struct dvb_frontend *fe)
{}

static int simple_sleep(struct dvb_frontend *fe)
{}

static void simple_release(struct dvb_frontend *fe)
{}

static int simple_get_frequency(struct dvb_frontend *fe, u32 *frequency)
{}

static int simple_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
{}

static const struct dvb_tuner_ops simple_tuner_ops =;

struct dvb_frontend *simple_tuner_attach(struct dvb_frontend *fe,
					 struct i2c_adapter *i2c_adap,
					 u8 i2c_addr,
					 unsigned int type)
{}
EXPORT_SYMBOL_GPL();

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