2 Frontend-driver for TwinHan DST Frontend
4 Copyright (C) 2003 Jamie Honan
5 Copyright (C) 2004, 2005 Manu Abraham (manu@kromtek.com)
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 #include <linux/dvb/frontend.h>
26 #include <linux/device.h>
27 #include <linux/mutex.h>
39 #define DST_TYPE_IS_SAT 0
40 #define DST_TYPE_IS_TERR 1
41 #define DST_TYPE_IS_CABLE 2
42 #define DST_TYPE_IS_ATSC 3
44 #define DST_TYPE_HAS_TS188 1
45 #define DST_TYPE_HAS_TS204 2
46 #define DST_TYPE_HAS_SYMDIV 4
47 #define DST_TYPE_HAS_FW_1 8
48 #define DST_TYPE_HAS_FW_2 16
49 #define DST_TYPE_HAS_FW_3 32
50 #define DST_TYPE_HAS_FW_BUILD 64
51 #define DST_TYPE_HAS_OBS_REGS 128
52 #define DST_TYPE_HAS_INC_COUNT 256
53 #define DST_TYPE_HAS_MULTI_FE 512
54 #define DST_TYPE_HAS_NEWTUNE_2 1024
55 #define DST_TYPE_HAS_DBOARD 2048
56 #define DST_TYPE_HAS_VLF 4096
58 /* Card capability list */
60 #define DST_TYPE_HAS_MAC 1
61 #define DST_TYPE_HAS_DISEQC3 2
62 #define DST_TYPE_HAS_DISEQC4 4
63 #define DST_TYPE_HAS_DISEQC5 8
64 #define DST_TYPE_HAS_MOTO 16
65 #define DST_TYPE_HAS_CA 32
66 #define DST_TYPE_HAS_ANALOG 64 /* Analog inputs */
67 #define DST_TYPE_HAS_SESSION 128
69 #define TUNER_TYPE_MULTI 1
70 #define TUNER_TYPE_UNKNOWN 2
72 #define TUNER_TYPE_L64724 4
73 #define TUNER_TYPE_STV0299 8
74 #define TUNER_TYPE_MB86A15 16
77 #define TUNER_TYPE_TDA10046 32
80 #define TUNER_TYPE_NXT200x 64
83 #define RDC_8820_PIO_0_DISABLE 0
84 #define RDC_8820_PIO_0_ENABLE 1
85 #define RDC_8820_INT 2
86 #define RDC_8820_RESET 4
88 /* DST Communication */
99 struct i2c_adapter
* i2c
;
103 /* configuration settings */
104 const struct dst_config
* config
;
106 struct dvb_frontend frontend
;
108 /* private ASIC data */
115 u32 frequency
; /* intermediate frequency in kHz for QPSK */
116 fe_spectral_inversion_t inversion
;
117 u32 symbol_rate
; /* symbol rate in Symbols per second */
119 fe_sec_voltage_t voltage
;
120 fe_sec_tone_mode_t tone
;
125 unsigned long cur_jiff
;
127 fe_bandwidth_t bandwidth
;
130 fe_sec_mini_cmd_t minicmd
;
131 fe_modulation_t modulation
;
140 struct mutex dst_mutex
;
142 struct dvb_device
*dst_ca
;
163 /* the ASIC i2c address */
167 int rdc_reset_state(struct dst_state
*state
);
168 int rdc_8820_reset(struct dst_state
*state
);
170 int dst_wait_dst_ready(struct dst_state
*state
, u8 delay_mode
);
171 int dst_pio_enable(struct dst_state
*state
);
172 int dst_pio_disable(struct dst_state
*state
);
173 int dst_error_recovery(struct dst_state
* state
);
174 int dst_error_bailout(struct dst_state
*state
);
175 int dst_comm_init(struct dst_state
* state
);
177 int write_dst(struct dst_state
*state
, u8
* data
, u8 len
);
178 int read_dst(struct dst_state
*state
, u8
* ret
, u8 len
);
179 u8
dst_check_sum(u8
* buf
, u32 len
);
180 struct dst_state
* dst_attach(struct dst_state
* state
, struct dvb_adapter
*dvb_adapter
);
181 struct dvb_device
*dst_ca_attach(struct dst_state
*state
, struct dvb_adapter
*dvb_adapter
);
182 int dst_gpio_outb(struct dst_state
* state
, u32 mask
, u32 enbb
, u32 outhigh
, int delay
);
184 int dst_command(struct dst_state
* state
, u8
* data
, u8 len
);
187 #endif // DST_COMMON_H