Path: blob/master/drivers/media/dvb/dvb-usb/af9015.h
15112 views
/*1* DVB USB Linux driver for Afatech AF9015 DVB-T USB2.0 receiver2*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 _DVB_USB_AF9015_H_24#define _DVB_USB_AF9015_H_2526#define DVB_USB_LOG_PREFIX "af9015"27#include "dvb-usb.h"2829#define deb_info(args...) dprintk(dvb_usb_af9015_debug, 0x01, args)30#define deb_rc(args...) dprintk(dvb_usb_af9015_debug, 0x02, args)31#define deb_xfer(args...) dprintk(dvb_usb_af9015_debug, 0x04, args)32#define deb_reg(args...) dprintk(dvb_usb_af9015_debug, 0x08, args)33#define deb_i2c(args...) dprintk(dvb_usb_af9015_debug, 0x10, args)34#define deb_fw(args...) dprintk(dvb_usb_af9015_debug, 0x20, args)3536#define AF9015_I2C_EEPROM 0xa037#define AF9015_I2C_DEMOD 0x3838#define AF9015_USB_TIMEOUT 20003940/* EEPROM locations */41#define AF9015_EEPROM_IR_MODE 0x1842#define AF9015_EEPROM_IR_REMOTE_TYPE 0x3443#define AF9015_EEPROM_TS_MODE 0x3144#define AF9015_EEPROM_DEMOD2_I2C 0x324546#define AF9015_EEPROM_SAW_BW1 0x3547#define AF9015_EEPROM_XTAL_TYPE1 0x3648#define AF9015_EEPROM_SPEC_INV1 0x3749#define AF9015_EEPROM_IF1L 0x3850#define AF9015_EEPROM_IF1H 0x3951#define AF9015_EEPROM_MT2060_IF1L 0x3a52#define AF9015_EEPROM_MT2060_IF1H 0x3b53#define AF9015_EEPROM_TUNER_ID1 0x3c5455#define AF9015_EEPROM_SAW_BW2 0x4556#define AF9015_EEPROM_XTAL_TYPE2 0x4657#define AF9015_EEPROM_SPEC_INV2 0x4758#define AF9015_EEPROM_IF2L 0x4859#define AF9015_EEPROM_IF2H 0x4960#define AF9015_EEPROM_MT2060_IF2L 0x4a61#define AF9015_EEPROM_MT2060_IF2H 0x4b62#define AF9015_EEPROM_TUNER_ID2 0x4c6364#define AF9015_EEPROM_OFFSET (AF9015_EEPROM_SAW_BW2 - AF9015_EEPROM_SAW_BW1)6566struct req_t {67u8 cmd; /* [0] */68/* seq */ /* [1] */69u8 i2c_addr; /* [2] */70u16 addr; /* [3|4] */71u8 mbox; /* [5] */72u8 addr_len; /* [6] */73u8 data_len; /* [7] */74u8 *data;75};7677enum af9015_cmd {78GET_CONFIG = 0x10,79DOWNLOAD_FIRMWARE = 0x11,80BOOT = 0x13,81READ_MEMORY = 0x20,82WRITE_MEMORY = 0x21,83READ_WRITE_I2C = 0x22,84COPY_FIRMWARE = 0x23,85RECONNECT_USB = 0x5a,86WRITE_VIRTUAL_MEMORY = 0x26,87GET_IR_CODE = 0x27,88READ_I2C,89WRITE_I2C,90};9192enum af9015_ir_mode {93AF9015_IR_MODE_DISABLED = 0,94AF9015_IR_MODE_HID,95AF9015_IR_MODE_RLC,96AF9015_IR_MODE_RC6,97AF9015_IR_MODE_POLLING, /* just guess */98};99100struct af9015_state {101struct i2c_adapter i2c_adap; /* I2C adapter for 2nd FE */102u8 rc_repeat;103u32 rc_keycode;104u8 rc_last[4];105};106107struct af9015_config {108u8 dual_mode:1;109u16 mt2060_if1[2];110u16 firmware_size;111u16 firmware_checksum;112u32 eeprom_sum;113};114115enum af9015_remote {116AF9015_REMOTE_NONE = 0,117/* 1 */ AF9015_REMOTE_A_LINK_DTU_M,118AF9015_REMOTE_MSI_DIGIVOX_MINI_II_V3,119AF9015_REMOTE_MYGICTV_U718,120AF9015_REMOTE_DIGITTRADE_DVB_T,121/* 5 */ AF9015_REMOTE_AVERMEDIA_KS,122};123124#endif125126127