Auto-update from upstream
[linux-2.6] / drivers / media / dvb / dvb-usb / vp7045.h
1 /* Common header-file of the Linux driver for the TwinhanDTV Alpha/MagicBoxII
2  * USB2.0 DVB-T receiver.
3  *
4  * Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@desy.de)
5  *
6  * Thanks to Twinhan who kindly provided hardware and information.
7  *
8  *      This program is free software; you can redistribute it and/or modify it
9  *      under the terms of the GNU General Public License as published by the Free
10  *      Software Foundation, version 2.
11  *
12  * see Documentation/dvb/README.dvb-usb for more information
13  */
14 #ifndef _DVB_USB_VP7045_H_
15 #define _DVB_USB_VP7045_H_
16
17 #define DVB_USB_LOG_PREFIX "vp7045"
18 #include "dvb-usb.h"
19
20 extern int dvb_usb_vp7045_debug;
21 #define deb_info(args...) dprintk(dvb_usb_vp7045_debug,0x01,args)
22 #define deb_xfer(args...) dprintk(dvb_usb_vp7045_debug,0x02,args)
23 #define deb_rc(args...)   dprintk(dvb_usb_vp7045_debug,0x04,args)
24
25 /* vp7045 commands */
26
27 /* Twinhan Vendor requests */
28 #define TH_COMMAND_IN                     0xC0
29 #define TH_COMMAND_OUT                    0xC1
30
31 /* command bytes */
32 #define TUNER_REG_READ                    0x03
33 #define TUNER_REG_WRITE                   0x04
34
35 #define RC_VAL_READ                       0x05
36  #define RC_NO_KEY                        0x44
37
38 #define SET_TUNER_POWER                   0x06
39 #define CHECK_TUNER_POWER                 0x12
40  #define Tuner_Power_ON                   1
41  #define Tuner_Power_OFF                  0
42
43 #define GET_USB_SPEED                     0x07
44  #define USB_SPEED_LOW                    0
45  #define USB_SPEED_FULL                   1
46  #define USB_SPEED_HIGH                   2
47
48 #define LOCK_TUNER_COMMAND                0x09
49
50 #define TUNER_SIGNAL_READ                 0x0A
51
52 /* FX2 eeprom */
53 #define SET_EE_VALUE                      0x10
54 #define GET_EE_VALUE                      0x11
55  #define FX2_ID_ADDR                      0x00
56  #define VID_MSB_ADDR                     0x02
57  #define VID_LSB_ADDR                     0x01
58  #define PID_MSB_ADDR                     0x04
59  #define PID_LSB_ADDR                     0x03
60  #define MAC_0_ADDR                       0x07
61  #define MAC_1_ADDR                       0x08
62  #define MAC_2_ADDR                       0x09
63  #define MAC_3_ADDR                       0x0a
64  #define MAC_4_ADDR                       0x0b
65  #define MAC_5_ADDR                       0x0c
66
67 #define RESET_FX2                         0x13
68
69 #define FW_VERSION_READ                   0x0B
70 #define VENDOR_STRING_READ                0x0C
71 #define PRODUCT_STRING_READ               0x0D
72 #define FW_BCD_VERSION_READ               0x14
73
74 extern struct dvb_frontend * vp7045_fe_attach(struct dvb_usb_device *d);
75 extern int vp7045_usb_op(struct dvb_usb_device *d, u8 cmd, u8 *out, int outlen, u8 *in, int inlen,int msec);
76 extern u8 vp7045_read_reg(struct dvb_usb_device *d, u8 reg);
77
78 #endif