linux/drivers/media/tuners/tda18271-common.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
    tda18271-common.c - driver for the Philips / NXP TDA18271 silicon tuner

    Copyright (C) 2007, 2008 Michael Krufky <[email protected]>

*/

#include "tda18271-priv.h"

static int tda18271_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
{
	struct tda18271_priv *priv = fe->tuner_priv;
	enum tda18271_i2c_gate gate;
	int ret = 0;

	switch (priv->gate) {
	case TDA18271_GATE_DIGITAL:
	case TDA18271_GATE_ANALOG:
		gate = priv->gate;
		break;
	case TDA18271_GATE_AUTO:
	default:
		switch (priv->mode) {
		case TDA18271_DIGITAL:
			gate = TDA18271_GATE_DIGITAL;
			break;
		case TDA18271_ANALOG:
		default:
			gate = TDA18271_GATE_ANALOG;
			break;
		}
	}

	switch (gate) {
	case TDA18271_GATE_ANALOG:
		if (fe->ops.analog_ops.i2c_gate_ctrl)
			ret = fe->ops.analog_ops.i2c_gate_ctrl(fe, enable);
		break;
	case TDA18271_GATE_DIGITAL:
		if (fe->ops.i2c_gate_ctrl)
			ret = fe->ops.i2c_gate_ctrl(fe, enable);
		break;
	default:
		ret = -EINVAL;
		break;
	}

	return ret;
};

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

static void tda18271_dump_regs(struct dvb_frontend *fe, int extended)
{}

int tda18271_read_regs(struct dvb_frontend *fe)
{}

int tda18271_read_extended(struct dvb_frontend *fe)
{}

static int __tda18271_write_regs(struct dvb_frontend *fe, int idx, int len,
			bool lock_i2c)
{}

int tda18271_write_regs(struct dvb_frontend *fe, int idx, int len)
{}

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

static int __tda18271_charge_pump_source(struct dvb_frontend *fe,
					 enum tda18271_pll pll, int force,
					 bool lock_i2c)
{}

int tda18271_charge_pump_source(struct dvb_frontend *fe,
				enum tda18271_pll pll, int force)
{}


int tda18271_init_regs(struct dvb_frontend *fe)
{}

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

/*
 *  Standby modes, EP3 [7:5]
 *
 *  | SM  || SM_LT || SM_XT || mode description
 *  |=====\\=======\\=======\\====================================
 *  |  0  ||   0   ||   0   || normal mode
 *  |-----||-------||-------||------------------------------------
 *  |     ||       ||       || standby mode w/ slave tuner output
 *  |  1  ||   0   ||   0   || & loop through & xtal oscillator on
 *  |-----||-------||-------||------------------------------------
 *  |  1  ||   1   ||   0   || standby mode w/ xtal oscillator on
 *  |-----||-------||-------||------------------------------------
 *  |  1  ||   1   ||   1   || power off
 *
 */

int tda18271_set_standby_mode(struct dvb_frontend *fe,
			      int sm, int sm_lt, int sm_xt)
{}

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

int tda18271_calc_main_pll(struct dvb_frontend *fe, u32 freq)
{}

int tda18271_calc_cal_pll(struct dvb_frontend *fe, u32 freq)
{}

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

int tda18271_calc_bp_filter(struct dvb_frontend *fe, u32 *freq)
{}

int tda18271_calc_km(struct dvb_frontend *fe, u32 *freq)
{}

int tda18271_calc_rf_band(struct dvb_frontend *fe, u32 *freq)
{}

int tda18271_calc_gain_taper(struct dvb_frontend *fe, u32 *freq)
{}

int tda18271_calc_ir_measure(struct dvb_frontend *fe, u32 *freq)
{}

int tda18271_calc_rf_cal(struct dvb_frontend *fe, u32 *freq)
{}

void _tda_printk(struct tda18271_priv *state, const char *level,
		 const char *func, const char *fmt, ...)
{}