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.
17 * - add smart card reader support for Conditional Access (CA)
19 * Card reader in Anysee is nothing more than ISO 7816 card reader.
20 * There is no hardware CAM in any Anysee device sold.
21 * In my understanding it should be implemented by making own module
22 * for ISO 7816 card reader, like dvb_ca_en50221 is implemented. This
23 * module registers serial interface that can be used to communicate
24 * with any ISO 7816 smart card.
26 * Any help according to implement serial smart card reader support
30 #ifndef _DVB_USB_ANYSEE_H_
31 #define _DVB_USB_ANYSEE_H_
33 #define DVB_USB_LOG_PREFIX "anysee"
35 #include <media/dvb_ca_en50221.h>
42 CMD_STREAMING_CTRL
= 0x12,
43 CMD_LED_AND_IR_CTRL
= 0x16,
44 CMD_GET_IR_CODE
= 0x41,
45 CMD_GET_HW_INFO
= 0x19,
54 #define ANYSEE_I2C_CLIENT_MAX 1
55 struct i2c_client
*i2c_client
[ANYSEE_I2C_CLIENT_MAX
];
56 u8 fe_id
:1; /* frondend ID */
60 struct dvb_ca_en50221 ci
;
61 unsigned long ci_cam_ready
; /* jiffies */
64 #define ANYSEE_HW_507T 2 /* E30 */
65 #define ANYSEE_HW_507CD 6 /* E30 Plus */
66 #define ANYSEE_HW_507DC 10 /* E30 C Plus */
67 #define ANYSEE_HW_507SI 11 /* E30 S2 Plus */
68 #define ANYSEE_HW_507FA 15 /* E30 Combo Plus / E30 C Plus */
69 #define ANYSEE_HW_508TC 18 /* E7 TC */
70 #define ANYSEE_HW_508S2 19 /* E7 S2 */
71 #define ANYSEE_HW_508T2C 20 /* E7 T2C */
72 #define ANYSEE_HW_508PTC 21 /* E7 PTC Plus */
73 #define ANYSEE_HW_508PS2 22 /* E7 PS2 Plus */
75 #define REG_IOA 0x80 /* Port A (bit addressable) */
76 #define REG_IOB 0x90 /* Port B (bit addressable) */
77 #define REG_IOC 0xa0 /* Port C (bit addressable) */
78 #define REG_IOD 0xb0 /* Port D (bit addressable) */
79 #define REG_IOE 0xb1 /* Port E (NOT bit addressable) */
80 #define REG_OEA 0xb2 /* Port A Output Enable */
81 #define REG_OEB 0xb3 /* Port B Output Enable */
82 #define REG_OEC 0xb4 /* Port C Output Enable */
83 #define REG_OED 0xb5 /* Port D Output Enable */
84 #define REG_OEE 0xb6 /* Port E Output Enable */
88 /***************************************************************************
89 * USB API description (reverse engineered)
90 ***************************************************************************
94 BULK[00001] >>> REQUEST PACKET 64 bytes
95 BULK[00081] <<< REPLY PACKET #1 64 bytes (PREVIOUS TRANSACTION REPLY)
96 BULK[00081] <<< REPLY PACKET #2 64 bytes (CURRENT TRANSACTION REPLY)
98 General reply packet(s) are always used if not own reply defined.
100 ============================================================================
101 | 00-63 | GENERAL REPLY PACKET #1 (PREVIOUS REPLY)
102 ============================================================================
103 | 00 | reply data (if any) from previous transaction
104 | | Just same reply packet as returned during previous transaction.
105 | | Needed only if reply is missed in previous transaction.
106 | | Just skip normally.
107 ----------------------------------------------------------------------------
109 ----------------------------------------------------------------------------
110 | 60 | packet sequence number
111 ----------------------------------------------------------------------------
113 ----------------------------------------------------------------------------
115 ============================================================================
116 | 00-63 | GENERAL REPLY PACKET #2 (CURRENT REPLY)
117 ============================================================================
118 | 00 | reply data (if any)
119 ----------------------------------------------------------------------------
121 ----------------------------------------------------------------------------
122 | 60 | packet sequence number
123 ----------------------------------------------------------------------------
125 ----------------------------------------------------------------------------
127 ============================================================================
128 | 00-63 | I2C WRITE REQUEST PACKET
129 ============================================================================
130 | 00 | 0x31 I2C write command
131 ----------------------------------------------------------------------------
133 ----------------------------------------------------------------------------
135 | | 0x02 (for typical I2C reg / val pair)
136 ----------------------------------------------------------------------------
138 ----------------------------------------------------------------------------
140 ----------------------------------------------------------------------------
142 ----------------------------------------------------------------------------
143 | 60 | packet sequence number
144 ----------------------------------------------------------------------------
146 ----------------------------------------------------------------------------
148 ============================================================================
149 | 00-63 | I2C READ REQUEST PACKET
150 ============================================================================
151 | 00 | 0x33 I2C read command
152 ----------------------------------------------------------------------------
153 | 01 | i2c address + 1
154 ----------------------------------------------------------------------------
156 ----------------------------------------------------------------------------
158 ----------------------------------------------------------------------------
160 ----------------------------------------------------------------------------
162 ----------------------------------------------------------------------------
164 ----------------------------------------------------------------------------
165 | 60 | packet sequence number
166 ----------------------------------------------------------------------------
168 ----------------------------------------------------------------------------
170 ============================================================================
171 | 00-63 | USB CONTROLLER REGISTER WRITE REQUEST PACKET
172 ============================================================================
173 | 00 | 0xb1 register write command
174 ----------------------------------------------------------------------------
176 ----------------------------------------------------------------------------
178 ----------------------------------------------------------------------------
180 ----------------------------------------------------------------------------
182 ----------------------------------------------------------------------------
183 | 60 | packet sequence number
184 ----------------------------------------------------------------------------
186 ----------------------------------------------------------------------------
188 ============================================================================
189 | 00-63 | USB CONTROLLER REGISTER READ REQUEST PACKET
190 ============================================================================
191 | 00 | 0xb0 register read command
192 ----------------------------------------------------------------------------
194 ----------------------------------------------------------------------------
196 ----------------------------------------------------------------------------
198 ----------------------------------------------------------------------------
199 | 60 | packet sequence number
200 ----------------------------------------------------------------------------
202 ----------------------------------------------------------------------------
204 ============================================================================
205 | 00-63 | LED CONTROL REQUEST PACKET
206 ============================================================================
207 | 00 | 0x16 LED and IR control command
208 ----------------------------------------------------------------------------
210 ----------------------------------------------------------------------------
212 | | 0x01 lights continuously
213 ----------------------------------------------------------------------------
214 | 04 | blink interval
215 | | 0x00 fastest (looks like LED lights continuously)
217 ----------------------------------------------------------------------------
219 ----------------------------------------------------------------------------
220 | 60 | packet sequence number
221 ----------------------------------------------------------------------------
223 ----------------------------------------------------------------------------
225 ============================================================================
226 | 00-63 | IR CONTROL REQUEST PACKET
227 ============================================================================
228 | 00 | 0x16 LED and IR control command
229 ----------------------------------------------------------------------------
231 ----------------------------------------------------------------------------
232 | 03 | 0x00 IR disabled
234 ----------------------------------------------------------------------------
236 ----------------------------------------------------------------------------
237 | 60 | packet sequence number
238 ----------------------------------------------------------------------------
240 ----------------------------------------------------------------------------
242 ============================================================================
243 | 00-63 | STREAMING CONTROL REQUEST PACKET
244 ============================================================================
245 | 00 | 0x12 streaming control command
246 ----------------------------------------------------------------------------
247 | 01 | 0x00 streaming disabled
248 | | 0x01 streaming enabled
249 ----------------------------------------------------------------------------
251 ----------------------------------------------------------------------------
253 ----------------------------------------------------------------------------
254 | 60 | packet sequence number
255 ----------------------------------------------------------------------------
257 ----------------------------------------------------------------------------
259 ============================================================================
260 | 00-63 | REMOTE CONTROL REQUEST PACKET
261 ============================================================================
262 | 00 | 0x41 remote control command
263 ----------------------------------------------------------------------------
265 ----------------------------------------------------------------------------
266 | 60 | packet sequence number
267 ----------------------------------------------------------------------------
269 ----------------------------------------------------------------------------
271 ============================================================================
272 | 00-63 | REMOTE CONTROL REPLY PACKET
273 ============================================================================
274 | 00 | 0x00 code not received
275 | | 0x01 code received
276 ----------------------------------------------------------------------------
277 | 01 | remote control code
278 ----------------------------------------------------------------------------
280 ----------------------------------------------------------------------------
281 | 60 | packet sequence number
282 ----------------------------------------------------------------------------
284 ----------------------------------------------------------------------------
286 ============================================================================
287 | 00-63 | GET HARDWARE INFO REQUEST PACKET
288 ============================================================================
289 | 00 | 0x19 get hardware info command
290 ----------------------------------------------------------------------------
292 ----------------------------------------------------------------------------
293 | 60 | packet sequence number
294 ----------------------------------------------------------------------------
296 ----------------------------------------------------------------------------
298 ============================================================================
299 | 00-63 | GET HARDWARE INFO REPLY PACKET
300 ============================================================================
302 ----------------------------------------------------------------------------
303 | 01-02 | firmware version
304 ----------------------------------------------------------------------------
306 ----------------------------------------------------------------------------
307 | 60 | packet sequence number
308 ----------------------------------------------------------------------------
310 ----------------------------------------------------------------------------
312 ============================================================================
313 | 00-63 | SMART CARD READER PACKET
314 ============================================================================
315 | 00 | 0x34 smart card reader command
316 ----------------------------------------------------------------------------
318 ----------------------------------------------------------------------------
320 ----------------------------------------------------------------------------
321 | 60 | packet sequence number
322 ----------------------------------------------------------------------------
324 ----------------------------------------------------------------------------