2
* Support for the Broadcom BCM3510 ATSC demodulator (1st generation Air2PC)
4
* Copyright (C) 2001-5, B2C2 inc.
6
* GPL/Linux driver written by Patrick Boettcher <patrick.boettcher@desy.de>
8
* This program is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation; either version 2 of the License, or
11
* (at your option) any later version.
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
18
* You should have received a copy of the GNU General Public License
19
* along with this program; if not, write to the Free Software
20
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22
#ifndef __BCM3510_PRIV_H__
23
#define __BCM3510_PRIV_H__
25
#define PACKED __attribute__((packed))
28
#define err(format, arg...) printk(KERN_ERR "bcm3510: " format "\n" , ## arg)
30
#define info(format, arg...) printk(KERN_INFO "bcm3510: " format "\n" , ## arg)
32
#define warn(format, arg...) printk(KERN_WARNING "bcm3510: " format "\n" , ## arg)
35
#define PANASONIC_FIRST_IF_BASE_IN_KHz 1407500
36
#define BCM3510_SYMBOL_RATE 5381000
120
#define JDEC_WAIT_AT_RAM 0x7
121
#define JDEC_EEPROM_LOAD_WAIT 0x4
164
} bcm3510_register_value;
169
#define CMD_GET_VERSION_INFO 0x3D
170
#define MSGID_GET_VERSION_INFO 0x15
171
struct bcm3510_hab_cmd_get_version_info {
172
u8 microcode_version;
178
#define BCM3510_DEF_MICROCODE_VERSION 0x0E
179
#define BCM3510_DEF_SCRIPT_VERSION 0x06
180
#define BCM3510_DEF_CONFIG_VERSION 0x01
181
#define BCM3510_DEF_DEMOD_VERSION 0xB1
184
#define CMD_ACQUIRE 0x38
186
#define MSGID_EXT_TUNER_ACQUIRE 0x0A
187
struct bcm3510_hab_cmd_ext_acquire {
194
} PACKED ACQUIRE0; /* control_byte */
201
} PACKED ACQUIRE1; /* sym_if */
203
u8 IF_OFFSET0; /* IF_Offset_10hz */
205
u8 SYM_OFFSET0; /* SymbolRateOffset */
207
u8 NTSC_OFFSET0; /* NTSC_Offset_10hz */
211
#define MSGID_INT_TUNER_ACQUIRE 0x0B
212
struct bcm3510_hab_cmd_int_acquire {
219
} PACKED ACQUIRE0; /* control_byte */
226
} PACKED ACQUIRE1; /* sym_if */
232
u8 IF_OFFSET0; /* IF_Offset_10hz */
234
u8 SYM_OFFSET0; /* SymbolRateOffset */
236
u8 NTSC_OFFSET0; /* NTSC_Offset_10hz */
241
#define BCM3510_QAM16 = 0x01
242
#define BCM3510_QAM32 = 0x02
243
#define BCM3510_QAM64 = 0x03
244
#define BCM3510_QAM128 = 0x04
245
#define BCM3510_QAM256 = 0x05
246
#define BCM3510_8VSB = 0x0B
247
#define BCM3510_16VSB = 0x0D
250
#define BCM3510_IF_TERRESTRIAL 0x0
251
#define BCM3510_IF_CABLE 0x1
252
#define BCM3510_IF_USE_CMD 0x7
255
#define BCM3510_SR_8VSB 0x0 /* 5381119 s/sec */
256
#define BCM3510_SR_256QAM 0x1 /* 5360537 s/sec */
257
#define BCM3510_SR_16QAM 0x2 /* 5056971 s/sec */
258
#define BCM3510_SR_MISC 0x3 /* 5000000 s/sec */
259
#define BCM3510_SR_USE_CMD 0x7
261
/* special symbol rate */
262
#define CMD_SET_VALUE_NOT_LISTED 0x2d
263
#define MSGID_SET_SYMBOL_RATE_NOT_LISTED 0x0c
264
struct bcm3510_hab_cmd_set_sr_not_listed {
272
#define MSGID_SET_IF_FREQ_NOT_LISTED 0x0d
273
struct bcm3510_hab_cmd_set_if_freq_not_listed {
281
#define CMD_AUTO_PARAM 0x2a
282
#define MSGID_AUTO_REACQUIRE 0x0e
283
struct bcm3510_hab_cmd_auto_reacquire {
284
u8 ACQ :1; /* on/off*/
288
#define MSGID_SET_RF_AGC_SEL 0x12
289
struct bcm3510_hab_cmd_set_agc {
295
#define MSGID_SET_AUTO_INVERSION 0x14
296
struct bcm3510_hab_cmd_auto_inversion {
303
#define CMD_STATE_CONTROL 0x12
304
#define MSGID_BERT_CONTROL 0x0e
305
#define MSGID_BERT_SET 0xfa
306
struct bcm3510_hab_cmd_bert_control {
311
#define MSGID_TRI_STATE 0x2e
312
struct bcm3510_hab_cmd_tri_state {
313
u8 RE :1; /* a/d ram port pins */
314
u8 PE :1; /* baud clock pin */
315
u8 AC :1; /* a/d clock pin */
316
u8 BE :1; /* baud clock pin */
322
#define CMD_TUNE 0x38
323
#define MSGID_TUNE 0x16
324
struct bcm3510_hab_cmd_tune_ctrl_data_pair {
345
struct bcm3510_hab_cmd_tune {
351
struct bcm3510_hab_cmd_tune_ctrl_data_pair ctl_dat[16];
354
#define CMD_STATUS 0x38
355
#define MSGID_STATUS1 0x08
356
struct bcm3510_hab_cmd_status1 {
360
u8 QRE :1; /* if QSE and the spectrum is inversed */
361
u8 QSE :1; /* automatic spectral inversion */
374
u8 NTE :1; /* NTSC filter sweep enabled */
375
u8 AQI :1; /* currently acquiring */
376
u8 FA :1; /* fast acquisition */
377
u8 ARI :1; /* auto reacquire */
378
u8 TI :1; /* programming the tuner */
417
#define MSGID_STATUS2 0x14
418
struct bcm3510_hab_cmd_status2 {
448
u8 MODE_TYPE :4; /* acquire mode 0 */
456
#define CMD_SET_RF_BW_NOT_LISTED 0x3f
457
#define MSGID_SET_RF_BW_NOT_LISTED 0x11