aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/b2c2/flexcop-usb.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/b2c2/flexcop-usb.h')
-rw-r--r--drivers/media/dvb/b2c2/flexcop-usb.h62
1 files changed, 27 insertions, 35 deletions
diff --git a/drivers/media/dvb/b2c2/flexcop-usb.h b/drivers/media/dvb/b2c2/flexcop-usb.h
index 630e647a2caa..92529a9c4475 100644
--- a/drivers/media/dvb/b2c2/flexcop-usb.h
+++ b/drivers/media/dvb/b2c2/flexcop-usb.h
@@ -1,15 +1,20 @@
1/*
2 * Linux driver for digital TV devices equipped with B2C2 FlexcopII(b)/III
3 * flexcop-usb.h - header file for the USB part
4 * see flexcop.c for copyright information
5 */
1#ifndef __FLEXCOP_USB_H_INCLUDED__ 6#ifndef __FLEXCOP_USB_H_INCLUDED__
2#define __FLEXCOP_USB_H_INCLUDED__ 7#define __FLEXCOP_USB_H_INCLUDED__
3 8
4#include <linux/usb.h> 9#include <linux/usb.h>
5 10
6/* transfer parameters */ 11/* transfer parameters */
7#define B2C2_USB_FRAMES_PER_ISO 4 12#define B2C2_USB_FRAMES_PER_ISO 4
8#define B2C2_USB_NUM_ISO_URB 4 13#define B2C2_USB_NUM_ISO_URB 4
9 14
10#define B2C2_USB_CTRL_PIPE_IN usb_rcvctrlpipe(fc_usb->udev,0) 15#define B2C2_USB_CTRL_PIPE_IN usb_rcvctrlpipe(fc_usb->udev, 0)
11#define B2C2_USB_CTRL_PIPE_OUT usb_sndctrlpipe(fc_usb->udev,0) 16#define B2C2_USB_CTRL_PIPE_OUT usb_sndctrlpipe(fc_usb->udev, 0)
12#define B2C2_USB_DATA_PIPE usb_rcvisocpipe(fc_usb->udev,0x81) 17#define B2C2_USB_DATA_PIPE usb_rcvisocpipe(fc_usb->udev, 0x81)
13 18
14struct flexcop_usb { 19struct flexcop_usb {
15 struct usb_device *udev; 20 struct usb_device *udev;
@@ -18,8 +23,8 @@ struct flexcop_usb {
18 u8 *iso_buffer; 23 u8 *iso_buffer;
19 int buffer_size; 24 int buffer_size;
20 dma_addr_t dma_addr; 25 dma_addr_t dma_addr;
21 struct urb *iso_urb[B2C2_USB_NUM_ISO_URB];
22 26
27 struct urb *iso_urb[B2C2_USB_NUM_ISO_URB];
23 struct flexcop_device *fc_dev; 28 struct flexcop_device *fc_dev;
24 29
25 u8 tmp_buffer[1023+190]; 30 u8 tmp_buffer[1023+190];
@@ -30,14 +35,6 @@ struct flexcop_usb {
30/* request types TODO What is its use?*/ 35/* request types TODO What is its use?*/
31typedef enum { 36typedef enum {
32 37
33/* something is wrong with this part
34 RTYPE_READ_DW = (1 << 6),
35 RTYPE_WRITE_DW_1 = (3 << 6),
36 RTYPE_READ_V8_MEMORY = (6 << 6),
37 RTYPE_WRITE_V8_MEMORY = (7 << 6),
38 RTYPE_WRITE_V8_FLASH = (8 << 6),
39 RTYPE_GENERIC = (9 << 6),
40*/
41} flexcop_usb_request_type_t; 38} flexcop_usb_request_type_t;
42#endif 39#endif
43 40
@@ -47,7 +44,6 @@ typedef enum {
47 B2C2_USB_READ_V8_MEM = 0x05, 44 B2C2_USB_READ_V8_MEM = 0x05,
48 B2C2_USB_READ_REG = 0x08, 45 B2C2_USB_READ_REG = 0x08,
49 B2C2_USB_WRITE_REG = 0x0A, 46 B2C2_USB_WRITE_REG = 0x0A,
50/* B2C2_USB_WRITEREGLO = 0x0A, */
51 B2C2_USB_WRITEREGHI = 0x0B, 47 B2C2_USB_WRITEREGHI = 0x0B,
52 B2C2_USB_FLASH_BLOCK = 0x10, 48 B2C2_USB_FLASH_BLOCK = 0x10,
53 B2C2_USB_I2C_REQUEST = 0x11, 49 B2C2_USB_I2C_REQUEST = 0x11,
@@ -62,15 +58,13 @@ typedef enum {
62 USB_FUNC_I2C_REPEATWRITE = 0x04, 58 USB_FUNC_I2C_REPEATWRITE = 0x04,
63 USB_FUNC_GET_DESCRIPTOR = 0x05, 59 USB_FUNC_GET_DESCRIPTOR = 0x05,
64 USB_FUNC_I2C_REPEATREAD = 0x06, 60 USB_FUNC_I2C_REPEATREAD = 0x06,
65/* DKT 020208 - add this to support special case of DiSEqC */ 61 /* DKT 020208 - add this to support special case of DiSEqC */
66 USB_FUNC_I2C_CHECKWRITE = 0x07, 62 USB_FUNC_I2C_CHECKWRITE = 0x07,
67 USB_FUNC_I2C_CHECKRESULT = 0x08, 63 USB_FUNC_I2C_CHECKRESULT = 0x08,
68} flexcop_usb_i2c_function_t; 64} flexcop_usb_i2c_function_t;
69 65
70/* 66/* function definition for UTILITY request 0x12
71 * function definition for UTILITY request 0x12 67 * DKT 020304 - new utility function */
72 * DKT 020304 - new utility function
73 */
74typedef enum { 68typedef enum {
75 UTILITY_SET_FILTER = 0x01, 69 UTILITY_SET_FILTER = 0x01,
76 UTILITY_DATA_ENABLE = 0x02, 70 UTILITY_DATA_ENABLE = 0x02,
@@ -84,7 +78,7 @@ typedef enum {
84 UTILITY_DATA_RESET = 0x0A, 78 UTILITY_DATA_RESET = 0x0A,
85 UTILITY_GET_DATA_STATUS = 0x10, 79 UTILITY_GET_DATA_STATUS = 0x10,
86 UTILITY_GET_V8_REG = 0x11, 80 UTILITY_GET_V8_REG = 0x11,
87/* DKT 020326 - add function for v1.14 */ 81 /* DKT 020326 - add function for v1.14 */
88 UTILITY_SRAM_WRITE = 0x12, 82 UTILITY_SRAM_WRITE = 0x12,
89 UTILITY_SRAM_READ = 0x13, 83 UTILITY_SRAM_READ = 0x13,
90 UTILITY_SRAM_TESTFILL = 0x14, 84 UTILITY_SRAM_TESTFILL = 0x14,
@@ -92,13 +86,13 @@ typedef enum {
92 UTILITY_SRAM_TESTVERIFY = 0x16, 86 UTILITY_SRAM_TESTVERIFY = 0x16,
93} flexcop_usb_utility_function_t; 87} flexcop_usb_utility_function_t;
94 88
95#define B2C2_WAIT_FOR_OPERATION_RW 1*HZ /* 1 s */ 89#define B2C2_WAIT_FOR_OPERATION_RW (1*HZ)
96#define B2C2_WAIT_FOR_OPERATION_RDW 3*HZ /* 3 s */ 90#define B2C2_WAIT_FOR_OPERATION_RDW (3*HZ)
97#define B2C2_WAIT_FOR_OPERATION_WDW 1*HZ /* 1 s */ 91#define B2C2_WAIT_FOR_OPERATION_WDW (1*HZ)
98 92
99#define B2C2_WAIT_FOR_OPERATION_V8READ 3*HZ /* 3 s */ 93#define B2C2_WAIT_FOR_OPERATION_V8READ (3*HZ)
100#define B2C2_WAIT_FOR_OPERATION_V8WRITE 3*HZ /* 3 s */ 94#define B2C2_WAIT_FOR_OPERATION_V8WRITE (3*HZ)
101#define B2C2_WAIT_FOR_OPERATION_V8FLASH 3*HZ /* 3 s */ 95#define B2C2_WAIT_FOR_OPERATION_V8FLASH (3*HZ)
102 96
103typedef enum { 97typedef enum {
104 V8_MEMORY_PAGE_DVB_CI = 0x20, 98 V8_MEMORY_PAGE_DVB_CI = 0x20,
@@ -107,13 +101,11 @@ typedef enum {
107 V8_MEMORY_PAGE_FLASH = 0x80 101 V8_MEMORY_PAGE_FLASH = 0x80
108} flexcop_usb_mem_page_t; 102} flexcop_usb_mem_page_t;
109 103
110#define V8_MEMORY_EXTENDED (1 << 15) 104#define V8_MEMORY_EXTENDED (1 << 15)
111 105#define USB_MEM_READ_MAX 32
112#define USB_MEM_READ_MAX 32 106#define USB_MEM_WRITE_MAX 1
113#define USB_MEM_WRITE_MAX 1 107#define USB_FLASH_MAX 8
114#define USB_FLASH_MAX 8 108#define V8_MEMORY_PAGE_SIZE 0x8000 /* 32K */
115 109#define V8_MEMORY_PAGE_MASK 0x7FFF
116#define V8_MEMORY_PAGE_SIZE 0x8000 // 32K
117#define V8_MEMORY_PAGE_MASK 0x7FFF
118 110
119#endif 111#endif