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@posteo.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 #ifndef __BCM3510_PRIV_H__
19 #define __BCM3510_PRIV_H__
21 #define PACKED __attribute__((packed))
24 #define err(format, arg...) printk(KERN_ERR "bcm3510: " format "\n" , ## arg)
26 #define info(format, arg...) printk(KERN_INFO "bcm3510: " format "\n" , ## arg)
28 #define warn(format, arg...) printk(KERN_WARNING "bcm3510: " format "\n" , ## arg)
31 #define PANASONIC_FIRST_IF_BASE_IN_KHz 1407500
32 #define BCM3510_SYMBOL_RATE 5381000
116 #define JDEC_WAIT_AT_RAM 0x7
117 #define JDEC_EEPROM_LOAD_WAIT 0x4
160 } bcm3510_register_value
;
165 #define CMD_GET_VERSION_INFO 0x3D
166 #define MSGID_GET_VERSION_INFO 0x15
167 struct bcm3510_hab_cmd_get_version_info
{
168 u8 microcode_version
;
174 #define BCM3510_DEF_MICROCODE_VERSION 0x0E
175 #define BCM3510_DEF_SCRIPT_VERSION 0x06
176 #define BCM3510_DEF_CONFIG_VERSION 0x01
177 #define BCM3510_DEF_DEMOD_VERSION 0xB1
180 #define CMD_ACQUIRE 0x38
182 #define MSGID_EXT_TUNER_ACQUIRE 0x0A
183 struct bcm3510_hab_cmd_ext_acquire
{
190 } PACKED ACQUIRE0
; /* control_byte */
197 } PACKED ACQUIRE1
; /* sym_if */
199 u8 IF_OFFSET0
; /* IF_Offset_10hz */
201 u8 SYM_OFFSET0
; /* SymbolRateOffset */
203 u8 NTSC_OFFSET0
; /* NTSC_Offset_10hz */
207 #define MSGID_INT_TUNER_ACQUIRE 0x0B
208 struct bcm3510_hab_cmd_int_acquire
{
215 } PACKED ACQUIRE0
; /* control_byte */
222 } PACKED ACQUIRE1
; /* sym_if */
228 u8 IF_OFFSET0
; /* IF_Offset_10hz */
230 u8 SYM_OFFSET0
; /* SymbolRateOffset */
232 u8 NTSC_OFFSET0
; /* NTSC_Offset_10hz */
237 #define BCM3510_QAM16 = 0x01
238 #define BCM3510_QAM32 = 0x02
239 #define BCM3510_QAM64 = 0x03
240 #define BCM3510_QAM128 = 0x04
241 #define BCM3510_QAM256 = 0x05
242 #define BCM3510_8VSB = 0x0B
243 #define BCM3510_16VSB = 0x0D
246 #define BCM3510_IF_TERRESTRIAL 0x0
247 #define BCM3510_IF_CABLE 0x1
248 #define BCM3510_IF_USE_CMD 0x7
251 #define BCM3510_SR_8VSB 0x0 /* 5381119 s/sec */
252 #define BCM3510_SR_256QAM 0x1 /* 5360537 s/sec */
253 #define BCM3510_SR_16QAM 0x2 /* 5056971 s/sec */
254 #define BCM3510_SR_MISC 0x3 /* 5000000 s/sec */
255 #define BCM3510_SR_USE_CMD 0x7
257 /* special symbol rate */
258 #define CMD_SET_VALUE_NOT_LISTED 0x2d
259 #define MSGID_SET_SYMBOL_RATE_NOT_LISTED 0x0c
260 struct bcm3510_hab_cmd_set_sr_not_listed
{
268 #define MSGID_SET_IF_FREQ_NOT_LISTED 0x0d
269 struct bcm3510_hab_cmd_set_if_freq_not_listed
{
277 #define CMD_AUTO_PARAM 0x2a
278 #define MSGID_AUTO_REACQUIRE 0x0e
279 struct bcm3510_hab_cmd_auto_reacquire
{
280 u8 ACQ
:1; /* on/off*/
284 #define MSGID_SET_RF_AGC_SEL 0x12
285 struct bcm3510_hab_cmd_set_agc
{
291 #define MSGID_SET_AUTO_INVERSION 0x14
292 struct bcm3510_hab_cmd_auto_inversion
{
299 #define CMD_STATE_CONTROL 0x12
300 #define MSGID_BERT_CONTROL 0x0e
301 #define MSGID_BERT_SET 0xfa
302 struct bcm3510_hab_cmd_bert_control
{
307 #define MSGID_TRI_STATE 0x2e
308 struct bcm3510_hab_cmd_tri_state
{
309 u8 RE
:1; /* a/d ram port pins */
310 u8 PE
:1; /* baud clock pin */
311 u8 AC
:1; /* a/d clock pin */
312 u8 BE
:1; /* baud clock pin */
318 #define CMD_TUNE 0x38
319 #define MSGID_TUNE 0x16
320 struct bcm3510_hab_cmd_tune_ctrl_data_pair
{
341 struct bcm3510_hab_cmd_tune
{
347 struct bcm3510_hab_cmd_tune_ctrl_data_pair ctl_dat
[16];
350 #define CMD_STATUS 0x38
351 #define MSGID_STATUS1 0x08
352 struct bcm3510_hab_cmd_status1
{
356 u8 QRE
:1; /* if QSE and the spectrum is inversed */
357 u8 QSE
:1; /* automatic spectral inversion */
370 u8 NTE
:1; /* NTSC filter sweep enabled */
371 u8 AQI
:1; /* currently acquiring */
372 u8 FA
:1; /* fast acquisition */
373 u8 ARI
:1; /* auto reacquire */
374 u8 TI
:1; /* programming the tuner */
413 #define MSGID_STATUS2 0x14
414 struct bcm3510_hab_cmd_status2
{
444 u8 MODE_TYPE
:4; /* acquire mode 0 */
452 #define CMD_SET_RF_BW_NOT_LISTED 0x3f
453 #define MSGID_SET_RF_BW_NOT_LISTED 0x11