[media] af9035: add remote control support
[linux-2.6-xlnx.git] / drivers / media / dvb / dvb-usb / af9035.h
blob27a484bdc961b927456c7b16894c6f8a019aec6b
1 /*
2 * Afatech AF9035 DVB USB driver
4 * Copyright (C) 2009 Antti Palosaari <crope@iki.fi>
5 * Copyright (C) 2012 Antti Palosaari <crope@iki.fi>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #ifndef AF9035_H
23 #define AF9035_H
25 /* prefix for dvb-usb log writings */
26 #define DVB_USB_LOG_PREFIX "af9035"
28 #include "dvb-usb.h"
30 struct reg_val {
31 u32 reg;
32 u8 val;
35 struct reg_val_mask {
36 u32 reg;
37 u8 val;
38 u8 mask;
41 struct usb_req {
42 u8 cmd;
43 u8 mbox;
44 u8 wlen;
45 u8 *wbuf;
46 u8 rlen;
47 u8 *rbuf;
50 struct config {
51 bool dual_mode;
52 bool hw_not_supported;
55 u32 clock_lut[] = {
56 20480000, /* FPGA */
57 16384000, /* 16.38 MHz */
58 20480000, /* 20.48 MHz */
59 36000000, /* 36.00 MHz */
60 30000000, /* 30.00 MHz */
61 26000000, /* 26.00 MHz */
62 28000000, /* 28.00 MHz */
63 32000000, /* 32.00 MHz */
64 34000000, /* 34.00 MHz */
65 24000000, /* 24.00 MHz */
66 22000000, /* 22.00 MHz */
67 12000000, /* 12.00 MHz */
70 u32 clock_lut_it9135[] = {
71 12000000, /* 12.00 MHz */
72 20480000, /* 20.48 MHz */
73 36000000, /* 36.00 MHz */
74 30000000, /* 30.00 MHz */
75 26000000, /* 26.00 MHz */
76 28000000, /* 28.00 MHz */
77 32000000, /* 32.00 MHz */
78 34000000, /* 34.00 MHz */
79 24000000, /* 24.00 MHz */
80 22000000, /* 22.00 MHz */
83 /* EEPROM locations */
84 #define EEPROM_IR_MODE 0x430d
85 #define EEPROM_DUAL_MODE 0x4326
86 #define EEPROM_IR_TYPE 0x4329
87 #define EEPROM_1_IFFREQ_L 0x432d
88 #define EEPROM_1_IFFREQ_H 0x432e
89 #define EEPROM_1_TUNER_ID 0x4331
90 #define EEPROM_2_IFFREQ_L 0x433d
91 #define EEPROM_2_IFFREQ_H 0x433e
92 #define EEPROM_2_TUNER_ID 0x4341
94 /* USB commands */
95 #define CMD_MEM_RD 0x00
96 #define CMD_MEM_WR 0x01
97 #define CMD_I2C_RD 0x02
98 #define CMD_I2C_WR 0x03
99 #define CMD_IR_GET 0x18
100 #define CMD_FW_DL 0x21
101 #define CMD_FW_QUERYINFO 0x22
102 #define CMD_FW_BOOT 0x23
103 #define CMD_FW_DL_BEGIN 0x24
104 #define CMD_FW_DL_END 0x25
105 #define CMD_FW_SCATTER_WR 0x29
107 #endif