1 /* DVB USB compliant Linux driver for the
2  *  - GENPIX 8pks/qpsk/DCII USB2.0 DVB-S module
3  *
4  * Copyright (C) 2006 Alan Nisota (alannisota@gmail.com)
5  * Copyright (C) 2006,2007 Alan Nisota (alannisota@gmail.com)
6  *
7  * Thanks to GENPIX for the sample code used to implement this module.
8  *
9  * This module is based off the vp7045 and vp702x modules
10  *
11  *	This program is free software; you can redistribute it and/or modify it
12  *	under the terms of the GNU General Public License as published by the Free
13  *	Software Foundation, version 2.
14  *
15  * see Documentation/dvb/README.dvb-usb for more information
16  */
17 #ifndef _DVB_USB_GP8PSK_H_
18 #define _DVB_USB_GP8PSK_H_
19 
20 #define DVB_USB_LOG_PREFIX "gp8psk"
21 #include "dvb-usb.h"
22 
23 extern int dvb_usb_gp8psk_debug;
24 #define deb_info(args...) dprintk(dvb_usb_gp8psk_debug,0x01,args)
25 #define deb_xfer(args...) dprintk(dvb_usb_gp8psk_debug,0x02,args)
26 #define deb_rc(args...)   dprintk(dvb_usb_gp8psk_debug,0x04,args)
27 #define deb_fe(args...)   dprintk(dvb_usb_gp8psk_debug,0x08,args)
28 
29 /* Twinhan Vendor requests */
30 #define TH_COMMAND_IN                     0xC0
31 #define TH_COMMAND_OUT                    0xC1
32 
33 /* gp8psk commands */
34 
35 #define GET_8PSK_CONFIG                 0x80    /* in */
36 #define SET_8PSK_CONFIG                 0x81
37 #define I2C_WRITE			0x83
38 #define I2C_READ			0x84
39 #define ARM_TRANSFER                    0x85
40 #define TUNE_8PSK                       0x86
41 #define GET_SIGNAL_STRENGTH             0x87    /* in */
42 #define LOAD_BCM4500                    0x88
43 #define BOOT_8PSK                       0x89    /* in */
44 #define START_INTERSIL                  0x8A    /* in */
45 #define SET_LNB_VOLTAGE                 0x8B
46 #define SET_22KHZ_TONE                  0x8C
47 #define SEND_DISEQC_COMMAND             0x8D
48 #define SET_DVB_MODE                    0x8E
49 #define SET_DN_SWITCH                   0x8F
50 #define GET_SIGNAL_LOCK                 0x90    /* in */
51 #define GET_FW_VERS			0x92
52 #define GET_SERIAL_NUMBER               0x93    /* in */
53 #define USE_EXTRA_VOLT                  0x94
54 #define GET_FPGA_VERS			0x95
55 #define CW3K_INIT			0x9d
56 
57 /* PSK_configuration bits */
58 #define bm8pskStarted                   0x01
59 #define bm8pskFW_Loaded                 0x02
60 #define bmIntersilOn                    0x04
61 #define bmDVBmode                       0x08
62 #define bm22kHz                         0x10
63 #define bmSEL18V                        0x20
64 #define bmDCtuned                       0x40
65 #define bmArmed                         0x80
66 
67 /* Satellite modulation modes */
68 #define ADV_MOD_DVB_QPSK 0     /* DVB-S QPSK */
69 #define ADV_MOD_TURBO_QPSK 1   /* Turbo QPSK */
70 #define ADV_MOD_TURBO_8PSK 2   /* Turbo 8PSK (also used for Trellis 8PSK) */
71 #define ADV_MOD_TURBO_16QAM 3  /* Turbo 16QAM (also used for Trellis 8PSK) */
72 
73 #define ADV_MOD_DCII_C_QPSK 4  /* Digicipher II Combo */
74 #define ADV_MOD_DCII_I_QPSK 5  /* Digicipher II I-stream */
75 #define ADV_MOD_DCII_Q_QPSK 6  /* Digicipher II Q-stream */
76 #define ADV_MOD_DCII_C_OQPSK 7 /* Digicipher II offset QPSK */
77 #define ADV_MOD_DSS_QPSK 8     /* DSS (DIRECTV) QPSK */
78 #define ADV_MOD_DVB_BPSK 9     /* DVB-S BPSK */
79 
80 #define GET_USB_SPEED                     0x07
81  #define USB_SPEED_LOW                    0
82  #define USB_SPEED_FULL                   1
83  #define USB_SPEED_HIGH                   2
84 
85 #define RESET_FX2                         0x13
86 
87 #define FW_VERSION_READ                   0x0B
88 #define VENDOR_STRING_READ                0x0C
89 #define PRODUCT_STRING_READ               0x0D
90 #define FW_BCD_VERSION_READ               0x14
91 
92 /* firmware revision id's */
93 #define GP8PSK_FW_REV1			0x020604
94 #define GP8PSK_FW_REV2			0x020704
95 #define GP8PSK_FW_VERS(_fw_vers)	((_fw_vers)[2]<<0x10 | (_fw_vers)[1]<<0x08 | (_fw_vers)[0])
96 
97 extern struct dvb_frontend * gp8psk_fe_attach(struct dvb_usb_device *d);
98 extern int gp8psk_usb_in_op(struct dvb_usb_device *d, u8 req, u16 value, u16 index, u8 *b, int blen);
99 extern int gp8psk_usb_out_op(struct dvb_usb_device *d, u8 req, u16 value,
100 			     u16 index, u8 *b, int blen);
101 extern int gp8psk_bcm4500_reload(struct dvb_usb_device *d);
102 
103 #endif
104