2 * DVB USB Linux driver for Anysee E30 DVB-C & DVB-T USB2.0 receiver
4 * Copyright (C) 2007 Antti Palosaari <crope@iki.fi>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 * - add smart card reader support for Conditional Access (CA)
23 * Card reader in Anysee is nothing more than ISO 7816 card reader.
24 * There is no hardware CAM in any Anysee device sold.
25 * In my understanding it should be implemented by making own module
26 * for ISO 7816 card reader, like dvb_ca_en50221 is implemented. This
27 * module registers serial interface that can be used to communicate
28 * with any ISO 7816 smart card.
30 * Any help according to implement serial smart card reader support
34 #ifndef _DVB_USB_ANYSEE_H_
35 #define _DVB_USB_ANYSEE_H_
37 #define DVB_USB_LOG_PREFIX "anysee"
39 #include "dvb_ca_en50221.h"
46 CMD_STREAMING_CTRL
= 0x12,
47 CMD_LED_AND_IR_CTRL
= 0x16,
48 CMD_GET_IR_CODE
= 0x41,
49 CMD_GET_HW_INFO
= 0x19,
58 #define ANYSEE_I2C_CLIENT_MAX 1
59 struct i2c_client
*i2c_client
[ANYSEE_I2C_CLIENT_MAX
];
60 u8 fe_id
:1; /* frondend ID */
64 struct dvb_ca_en50221 ci
;
65 unsigned long ci_cam_ready
; /* jiffies */
68 #define ANYSEE_HW_507T 2 /* E30 */
69 #define ANYSEE_HW_507CD 6 /* E30 Plus */
70 #define ANYSEE_HW_507DC 10 /* E30 C Plus */
71 #define ANYSEE_HW_507SI 11 /* E30 S2 Plus */
72 #define ANYSEE_HW_507FA 15 /* E30 Combo Plus / E30 C Plus */
73 #define ANYSEE_HW_508TC 18 /* E7 TC */
74 #define ANYSEE_HW_508S2 19 /* E7 S2 */
75 #define ANYSEE_HW_508T2C 20 /* E7 T2C */
76 #define ANYSEE_HW_508PTC 21 /* E7 PTC Plus */
77 #define ANYSEE_HW_508PS2 22 /* E7 PS2 Plus */
79 #define REG_IOA 0x80 /* Port A (bit addressable) */
80 #define REG_IOB 0x90 /* Port B (bit addressable) */
81 #define REG_IOC 0xa0 /* Port C (bit addressable) */
82 #define REG_IOD 0xb0 /* Port D (bit addressable) */
83 #define REG_IOE 0xb1 /* Port E (NOT bit addressable) */
84 #define REG_OEA 0xb2 /* Port A Output Enable */
85 #define REG_OEB 0xb3 /* Port B Output Enable */
86 #define REG_OEC 0xb4 /* Port C Output Enable */
87 #define REG_OED 0xb5 /* Port D Output Enable */
88 #define REG_OEE 0xb6 /* Port E Output Enable */
92 /***************************************************************************
93 * USB API description (reverse engineered)
94 ***************************************************************************
98 BULK[00001] >>> REQUEST PACKET 64 bytes
99 BULK[00081] <<< REPLY PACKET #1 64 bytes (PREVIOUS TRANSACTION REPLY)
100 BULK[00081] <<< REPLY PACKET #2 64 bytes (CURRENT TRANSACTION REPLY)
102 General reply packet(s) are always used if not own reply defined.
104 ============================================================================
105 | 00-63 | GENERAL REPLY PACKET #1 (PREVIOUS REPLY)
106 ============================================================================
107 | 00 | reply data (if any) from previous transaction
108 | | Just same reply packet as returned during previous transaction.
109 | | Needed only if reply is missed in previous transaction.
110 | | Just skip normally.
111 ----------------------------------------------------------------------------
113 ----------------------------------------------------------------------------
114 | 60 | packet sequence number
115 ----------------------------------------------------------------------------
117 ----------------------------------------------------------------------------
119 ============================================================================
120 | 00-63 | GENERAL REPLY PACKET #2 (CURRENT REPLY)
121 ============================================================================
122 | 00 | reply data (if any)
123 ----------------------------------------------------------------------------
125 ----------------------------------------------------------------------------
126 | 60 | packet sequence number
127 ----------------------------------------------------------------------------
129 ----------------------------------------------------------------------------
131 ============================================================================
132 | 00-63 | I2C WRITE REQUEST PACKET
133 ============================================================================
134 | 00 | 0x31 I2C write command
135 ----------------------------------------------------------------------------
137 ----------------------------------------------------------------------------
139 | | 0x02 (for typical I2C reg / val pair)
140 ----------------------------------------------------------------------------
142 ----------------------------------------------------------------------------
144 ----------------------------------------------------------------------------
146 ----------------------------------------------------------------------------
147 | 60 | packet sequence number
148 ----------------------------------------------------------------------------
150 ----------------------------------------------------------------------------
152 ============================================================================
153 | 00-63 | I2C READ REQUEST PACKET
154 ============================================================================
155 | 00 | 0x33 I2C read command
156 ----------------------------------------------------------------------------
157 | 01 | i2c address + 1
158 ----------------------------------------------------------------------------
160 ----------------------------------------------------------------------------
162 ----------------------------------------------------------------------------
164 ----------------------------------------------------------------------------
166 ----------------------------------------------------------------------------
168 ----------------------------------------------------------------------------
169 | 60 | packet sequence number
170 ----------------------------------------------------------------------------
172 ----------------------------------------------------------------------------
174 ============================================================================
175 | 00-63 | USB CONTROLLER REGISTER WRITE REQUEST PACKET
176 ============================================================================
177 | 00 | 0xb1 register write command
178 ----------------------------------------------------------------------------
180 ----------------------------------------------------------------------------
182 ----------------------------------------------------------------------------
184 ----------------------------------------------------------------------------
186 ----------------------------------------------------------------------------
187 | 60 | packet sequence number
188 ----------------------------------------------------------------------------
190 ----------------------------------------------------------------------------
192 ============================================================================
193 | 00-63 | USB CONTROLLER REGISTER READ REQUEST PACKET
194 ============================================================================
195 | 00 | 0xb0 register read command
196 ----------------------------------------------------------------------------
198 ----------------------------------------------------------------------------
200 ----------------------------------------------------------------------------
202 ----------------------------------------------------------------------------
203 | 60 | packet sequence number
204 ----------------------------------------------------------------------------
206 ----------------------------------------------------------------------------
208 ============================================================================
209 | 00-63 | LED CONTROL REQUEST PACKET
210 ============================================================================
211 | 00 | 0x16 LED and IR control command
212 ----------------------------------------------------------------------------
214 ----------------------------------------------------------------------------
216 | | 0x01 lights continuously
217 ----------------------------------------------------------------------------
218 | 04 | blink interval
219 | | 0x00 fastest (looks like LED lights continuously)
221 ----------------------------------------------------------------------------
223 ----------------------------------------------------------------------------
224 | 60 | packet sequence number
225 ----------------------------------------------------------------------------
227 ----------------------------------------------------------------------------
229 ============================================================================
230 | 00-63 | IR CONTROL REQUEST PACKET
231 ============================================================================
232 | 00 | 0x16 LED and IR control command
233 ----------------------------------------------------------------------------
235 ----------------------------------------------------------------------------
236 | 03 | 0x00 IR disabled
238 ----------------------------------------------------------------------------
240 ----------------------------------------------------------------------------
241 | 60 | packet sequence number
242 ----------------------------------------------------------------------------
244 ----------------------------------------------------------------------------
246 ============================================================================
247 | 00-63 | STREAMING CONTROL REQUEST PACKET
248 ============================================================================
249 | 00 | 0x12 streaming control command
250 ----------------------------------------------------------------------------
251 | 01 | 0x00 streaming disabled
252 | | 0x01 streaming enabled
253 ----------------------------------------------------------------------------
255 ----------------------------------------------------------------------------
257 ----------------------------------------------------------------------------
258 | 60 | packet sequence number
259 ----------------------------------------------------------------------------
261 ----------------------------------------------------------------------------
263 ============================================================================
264 | 00-63 | REMOTE CONTROL REQUEST PACKET
265 ============================================================================
266 | 00 | 0x41 remote control command
267 ----------------------------------------------------------------------------
269 ----------------------------------------------------------------------------
270 | 60 | packet sequence number
271 ----------------------------------------------------------------------------
273 ----------------------------------------------------------------------------
275 ============================================================================
276 | 00-63 | REMOTE CONTROL REPLY PACKET
277 ============================================================================
278 | 00 | 0x00 code not received
279 | | 0x01 code received
280 ----------------------------------------------------------------------------
281 | 01 | remote control code
282 ----------------------------------------------------------------------------
284 ----------------------------------------------------------------------------
285 | 60 | packet sequence number
286 ----------------------------------------------------------------------------
288 ----------------------------------------------------------------------------
290 ============================================================================
291 | 00-63 | GET HARDWARE INFO REQUEST PACKET
292 ============================================================================
293 | 00 | 0x19 get hardware info command
294 ----------------------------------------------------------------------------
296 ----------------------------------------------------------------------------
297 | 60 | packet sequence number
298 ----------------------------------------------------------------------------
300 ----------------------------------------------------------------------------
302 ============================================================================
303 | 00-63 | GET HARDWARE INFO REPLY PACKET
304 ============================================================================
306 ----------------------------------------------------------------------------
307 | 01-02 | firmware version
308 ----------------------------------------------------------------------------
310 ----------------------------------------------------------------------------
311 | 60 | packet sequence number
312 ----------------------------------------------------------------------------
314 ----------------------------------------------------------------------------
316 ============================================================================
317 | 00-63 | SMART CARD READER PACKET
318 ============================================================================
319 | 00 | 0x34 smart card reader command
320 ----------------------------------------------------------------------------
322 ----------------------------------------------------------------------------
324 ----------------------------------------------------------------------------
325 | 60 | packet sequence number
326 ----------------------------------------------------------------------------
328 ----------------------------------------------------------------------------