Path: blob/master/drivers/media/common/tuners/tda18271.h
15112 views
/*1tda18271.h - header for the Philips / NXP TDA18271 silicon tuner23Copyright (C) 2007, 2008 Michael Krufky <[email protected]>45This program is free software; you can redistribute it and/or modify6it under the terms of the GNU General Public License as published by7the Free Software Foundation; either version 2 of the License, or8(at your option) any later version.910This program is distributed in the hope that it will be useful,11but WITHOUT ANY WARRANTY; without even the implied warranty of12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the13GNU General Public License for more details.1415You should have received a copy of the GNU General Public License16along with this program; if not, write to the Free Software17Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.18*/1920#ifndef __TDA18271_H__21#define __TDA18271_H__2223#include <linux/i2c.h>24#include "dvb_frontend.h"2526struct tda18271_std_map_item {27u16 if_freq;2829/* EP3[4:3] */30unsigned int agc_mode:2;31/* EP3[2:0] */32unsigned int std:3;33/* EP4[7] */34unsigned int fm_rfn:1;35/* EP4[4:2] */36unsigned int if_lvl:3;37/* EB22[6:0] */38unsigned int rfagc_top:7;39};4041struct tda18271_std_map {42struct tda18271_std_map_item fm_radio;43struct tda18271_std_map_item atv_b;44struct tda18271_std_map_item atv_dk;45struct tda18271_std_map_item atv_gh;46struct tda18271_std_map_item atv_i;47struct tda18271_std_map_item atv_l;48struct tda18271_std_map_item atv_lc;49struct tda18271_std_map_item atv_mn;50struct tda18271_std_map_item atsc_6;51struct tda18271_std_map_item dvbt_6;52struct tda18271_std_map_item dvbt_7;53struct tda18271_std_map_item dvbt_8;54struct tda18271_std_map_item qam_6;55struct tda18271_std_map_item qam_8;56};5758enum tda18271_role {59TDA18271_MASTER = 0,60TDA18271_SLAVE,61};6263enum tda18271_i2c_gate {64TDA18271_GATE_AUTO = 0,65TDA18271_GATE_ANALOG,66TDA18271_GATE_DIGITAL,67};6869enum tda18271_output_options {70/* slave tuner output & loop thru & xtal oscillator always on */71TDA18271_OUTPUT_LT_XT_ON = 0,7273/* slave tuner output loop thru off */74TDA18271_OUTPUT_LT_OFF = 1,7576/* xtal oscillator off */77TDA18271_OUTPUT_XT_OFF = 2,78};7980enum tda18271_small_i2c {81TDA18271_39_BYTE_CHUNK_INIT = 0,82TDA18271_16_BYTE_CHUNK_INIT = 16,83TDA18271_08_BYTE_CHUNK_INIT = 8,84TDA18271_03_BYTE_CHUNK_INIT = 3,85};8687struct tda18271_config {88/* override default if freq / std settings (optional) */89struct tda18271_std_map *std_map;9091/* master / slave tuner: master uses main pll, slave uses cal pll */92enum tda18271_role role;9394/* use i2c gate provided by analog or digital demod */95enum tda18271_i2c_gate gate;9697/* output options that can be disabled */98enum tda18271_output_options output_opt;99100/* some i2c providers can't write all 39 registers at once */101enum tda18271_small_i2c small_i2c;102103/* force rf tracking filter calibration on startup */104unsigned int rf_cal_on_startup:1;105106/* interface to saa713x / tda829x */107unsigned int config;108};109110#define TDA18271_CALLBACK_CMD_AGC_ENABLE 0111112enum tda18271_mode {113TDA18271_ANALOG = 0,114TDA18271_DIGITAL,115};116117#if defined(CONFIG_MEDIA_TUNER_TDA18271) || (defined(CONFIG_MEDIA_TUNER_TDA18271_MODULE) && defined(MODULE))118extern struct dvb_frontend *tda18271_attach(struct dvb_frontend *fe, u8 addr,119struct i2c_adapter *i2c,120struct tda18271_config *cfg);121#else122static inline struct dvb_frontend *tda18271_attach(struct dvb_frontend *fe,123u8 addr,124struct i2c_adapter *i2c,125struct tda18271_config *cfg)126{127printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);128return NULL;129}130#endif131132#endif /* __TDA18271_H__ */133134135