Path: blob/master/drivers/media/dvb/frontends/af9013.h
15112 views
/*1* Afatech AF9013 demodulator driver2*3* Copyright (C) 2007 Antti Palosaari <[email protected]>4*5* Thanks to Afatech who kindly provided information.6*7* This program is free software; you can redistribute it and/or modify8* it under the terms of the GNU General Public License as published by9* the Free Software Foundation; either version 2 of the License, or10* (at your option) any later version.11*12* This program is distributed in the hope that it will be useful,13* but WITHOUT ANY WARRANTY; without even the implied warranty of14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the15* GNU General Public License for more details.16*17* You should have received a copy of the GNU General Public License18* along with this program; if not, write to the Free Software19* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.20*21*/2223#ifndef _AF9013_H_24#define _AF9013_H_2526#include <linux/dvb/frontend.h>2728enum af9013_ts_mode {29AF9013_OUTPUT_MODE_PARALLEL,30AF9013_OUTPUT_MODE_SERIAL,31AF9013_OUTPUT_MODE_USB, /* only for AF9015 */32};3334enum af9013_tuner {35AF9013_TUNER_MXL5003D = 3, /* MaxLinear */36AF9013_TUNER_MXL5005D = 13, /* MaxLinear */37AF9013_TUNER_MXL5005R = 30, /* MaxLinear */38AF9013_TUNER_ENV77H11D5 = 129, /* Panasonic */39AF9013_TUNER_MT2060 = 130, /* Microtune */40AF9013_TUNER_MC44S803 = 133, /* Freescale */41AF9013_TUNER_QT1010 = 134, /* Quantek */42AF9013_TUNER_UNKNOWN = 140, /* for can tuners ? */43AF9013_TUNER_MT2060_2 = 147, /* Microtune */44AF9013_TUNER_TDA18271 = 156, /* NXP */45AF9013_TUNER_QT1010A = 162, /* Quantek */46AF9013_TUNER_MXL5007T = 177, /* MaxLinear */47AF9013_TUNER_TDA18218 = 179, /* NXP */48};4950/* AF9013/5 GPIOs (mostly guessed)51demod#1-gpio#0 - set demod#2 i2c-addr for dual devices52demod#1-gpio#1 - xtal setting (?)53demod#1-gpio#3 - tuner#154demod#2-gpio#0 - tuner#255demod#2-gpio#1 - xtal setting (?)56*/57#define AF9013_GPIO_ON (1 << 0)58#define AF9013_GPIO_EN (1 << 1)59#define AF9013_GPIO_O (1 << 2)60#define AF9013_GPIO_I (1 << 3)6162#define AF9013_GPIO_LO (AF9013_GPIO_ON|AF9013_GPIO_EN)63#define AF9013_GPIO_HI (AF9013_GPIO_ON|AF9013_GPIO_EN|AF9013_GPIO_O)6465#define AF9013_GPIO_TUNER_ON (AF9013_GPIO_ON|AF9013_GPIO_EN)66#define AF9013_GPIO_TUNER_OFF (AF9013_GPIO_ON|AF9013_GPIO_EN|AF9013_GPIO_O)6768struct af9013_config {69/* demodulator's I2C address */70u8 demod_address;7172/* frequencies in kHz */73u32 adc_clock;7475/* tuner ID */76u8 tuner;7778/* tuner IF */79u16 tuner_if;8081/* TS data output mode */82u8 output_mode:2;8384/* RF spectrum inversion */85u8 rf_spec_inv:1;8687/* API version */88u8 api_version[4];8990/* GPIOs */91u8 gpio[4];92};939495#if defined(CONFIG_DVB_AF9013) || \96(defined(CONFIG_DVB_AF9013_MODULE) && defined(MODULE))97extern struct dvb_frontend *af9013_attach(const struct af9013_config *config,98struct i2c_adapter *i2c);99#else100static inline struct dvb_frontend *af9013_attach(101const struct af9013_config *config, struct i2c_adapter *i2c)102{103printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);104return NULL;105}106#endif /* CONFIG_DVB_AF9013 */107108#endif /* _AF9013_H_ */109110111