2 * Driver for Xceive XC4000 "QAM/8VSB single chip tuner"
4 * Copyright (c) 2007 Xceive Corporation
5 * Copyright (c) 2007 Steven Toth <stoth@linuxtv.org>
6 * Copyright (c) 2009 Devin Heitmueller <dheitmueller@kernellabs.com>
7 * Copyright (c) 2009 Davide Ferri <d.ferri@zero11.it>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 #include <linux/module.h>
26 #include <linux/moduleparam.h>
27 #include <linux/videodev2.h>
28 #include <linux/delay.h>
29 #include <linux/dvb/frontend.h>
30 #include <linux/i2c.h>
31 #include <asm/unaligned.h>
33 #include "dvb_frontend.h"
36 #include "tuner-i2c.h"
37 #include "tuner-xc2028-types.h"
40 module_param(debug
, int, 0644);
41 MODULE_PARM_DESC(debug
, "Turn on/off debugging (default:off).");
43 static int no_poweroff
;
44 module_param(no_poweroff
, int, 0644);
45 MODULE_PARM_DESC(no_poweroff
, "0 (default) powers device off when not used.\n"
46 "\t\t1 keep device energized and with tuner ready all the times.\n"
47 "\t\tFaster, but consumes more power and keeps the device hotter");
49 static DEFINE_MUTEX(xc4000_list_mutex
);
50 static LIST_HEAD(hybrid_tuner_instance_list
);
52 #define dprintk(level, fmt, arg...) if (debug >= level) \
53 printk(KERN_INFO "%s: " fmt, "xc4000", ## arg)
55 /* Note that the last version digit is my internal build number (so I can
56 rev the firmware even if the core Xceive firmware was unchanged) */
57 #define XC4000_DEFAULT_FIRMWARE "dvb-fe-xc4000-1.4.1.fw"
58 #define XC4000_DEFAULT_FIRMWARE_SIZE 18643
61 /* struct for storing firmware table */
62 struct firmware_description
{
70 struct firmware_properties
{
75 unsigned int scode_table
;
80 struct tuner_i2c_props i2c_props
;
81 struct list_head hybrid_tuner_instance_list
;
82 struct firmware_description
*firm
;
90 // struct xc2028_ctrl ctrl;
91 struct firmware_properties cur_fw
;
94 u8 ignore_i2c_write_errors
;
98 #define MAX_TV_STANDARD 23
99 #define XC_MAX_I2C_WRITE_LENGTH 64
102 #define XC_RF_MODE_AIR 0
103 #define XC_RF_MODE_CABLE 1
106 #define XC_RESULT_SUCCESS 0
107 #define XC_RESULT_RESET_FAILURE 1
108 #define XC_RESULT_I2C_WRITE_FAILURE 2
109 #define XC_RESULT_I2C_READ_FAILURE 3
110 #define XC_RESULT_OUT_OF_RANGE 5
113 #define XC_PRODUCT_ID_FW_NOT_LOADED 0x2000
114 #define XC_PRODUCT_ID_FW_LOADED 0x0FA0
116 /* Registers (Write-only) */
117 #define XREG_INIT 0x00
118 #define XREG_VIDEO_MODE 0x01
119 #define XREG_AUDIO_MODE 0x02
120 #define XREG_RF_FREQ 0x03
121 #define XREG_D_CODE 0x04
122 #define XREG_DIRECTSITTING_MODE 0x05
123 #define XREG_SEEK_MODE 0x06
124 #define XREG_POWER_DOWN 0x08
125 #define XREG_SIGNALSOURCE 0x0A
126 #define XREG_AMPLITUDE 0x10
128 /* Registers (Read-only) */
129 #define XREG_ADC_ENV 0x00
130 #define XREG_QUALITY 0x01
131 #define XREG_FRAME_LINES 0x02
132 #define XREG_HSYNC_FREQ 0x03
133 #define XREG_LOCK 0x04
134 #define XREG_FREQ_ERROR 0x05
135 #define XREG_SNR 0x06
136 #define XREG_VERSION 0x07
137 #define XREG_PRODUCT_ID 0x08
140 Basic firmware description. This will remain with
141 the driver for documentation purposes.
143 This represents an I2C firmware file encoded as a
144 string of unsigned char. Format is as follows:
146 char[0 ]=len0_MSB -> len = len_MSB * 256 + len_LSB
147 char[1 ]=len0_LSB -> length of first write transaction
148 char[2 ]=data0 -> first byte to be sent
152 char[M ]=dataN -> last byte to be sent
153 char[M+1]=len1_MSB -> len = len_MSB * 256 + len_LSB
154 char[M+2]=len1_LSB -> length of second write transaction
160 The [len] value should be interpreted as follows:
162 len= len_MSB _ len_LSB
163 len=1111_1111_1111_1111 : End of I2C_SEQUENCE
164 len=0000_0000_0000_0000 : Reset command: Do hardware reset
165 len=0NNN_NNNN_NNNN_NNNN : Normal transaction: number of bytes = {1:32767)
166 len=1WWW_WWWW_WWWW_WWWW : Wait command: wait for {1:32767} ms
168 For the RESET and WAIT commands, the two following bytes will contain
169 immediately the length of the following transaction.
172 struct XC_TV_STANDARD
{
178 /* Tuner standards */
179 #define XC4000_MN_NTSC_PAL_BTSC 0
180 #define XC4000_MN_NTSC_PAL_A2 1
181 #define XC4000_MN_NTSC_PAL_EIAJ 2
182 #define XC4000_MN_NTSC_PAL_Mono 3
183 #define XC4000_BG_PAL_A2 4
184 #define XC4000_BG_PAL_NICAM 5
185 #define XC4000_BG_PAL_MONO 6
186 #define XC4000_I_PAL_NICAM 7
187 #define XC4000_I_PAL_NICAM_MONO 8
188 #define XC4000_DK_PAL_A2 9
189 #define XC4000_DK_PAL_NICAM 10
190 #define XC4000_DK_PAL_MONO 11
191 #define XC4000_DK_SECAM_A2DK1 12
192 #define XC4000_DK_SECAM_A2LDK3 13
193 #define XC4000_DK_SECAM_A2MONO 14
194 #define XC4000_L_SECAM_NICAM 15
195 #define XC4000_LC_SECAM_NICAM 16
196 #define XC4000_DTV6 17
197 #define XC4000_DTV8 18
198 #define XC4000_DTV7_8 19
199 #define XC4000_DTV7 20
200 #define XC4000_FM_Radio_INPUT2 21
201 #define XC4000_FM_Radio_INPUT1 22
204 static struct XC_TV_STANDARD XC4000_Standard[MAX_TV_STANDARD] = {
205 {"M/N-NTSC/PAL-BTSC", 0x0400, 0x8020},
206 {"M/N-NTSC/PAL-A2", 0x0600, 0x8020},
207 {"M/N-NTSC/PAL-EIAJ", 0x0440, 0x8020},
208 {"M/N-NTSC/PAL-Mono", 0x0478, 0x8020},
209 {"B/G-PAL-A2", 0x0A00, 0x8049},
210 {"B/G-PAL-NICAM", 0x0C04, 0x8049},
211 {"B/G-PAL-MONO", 0x0878, 0x8059},
212 {"I-PAL-NICAM", 0x1080, 0x8009},
213 {"I-PAL-NICAM-MONO", 0x0E78, 0x8009},
214 {"D/K-PAL-A2", 0x1600, 0x8009},
215 {"D/K-PAL-NICAM", 0x0E80, 0x8009},
216 {"D/K-PAL-MONO", 0x1478, 0x8009},
217 {"D/K-SECAM-A2 DK1", 0x1200, 0x8009},
218 {"D/K-SECAM-A2 L/DK3", 0x0E00, 0x8009},
219 {"D/K-SECAM-A2 MONO", 0x1478, 0x8009},
220 {"L-SECAM-NICAM", 0x8E82, 0x0009},
221 {"L'-SECAM-NICAM", 0x8E82, 0x4009},
222 {"DTV6", 0x00C0, 0x8002},
223 {"DTV8", 0x00C0, 0x800B},
224 {"DTV7/8", 0x00C0, 0x801B},
225 {"DTV7", 0x00C0, 0x8007},
226 {"FM Radio-INPUT2", 0x9802, 0x9002},
227 {"FM Radio-INPUT1", 0x0208, 0x9002}
230 static struct XC_TV_STANDARD XC4000_Standard
[MAX_TV_STANDARD
] = {
231 {"M/N-NTSC/PAL-BTSC", 0x0000, 0x8020},
232 {"M/N-NTSC/PAL-A2", 0x0000, 0x8020},
233 {"M/N-NTSC/PAL-EIAJ", 0x0040, 0x8020},
234 {"M/N-NTSC/PAL-Mono", 0x0078, 0x8020},
235 {"B/G-PAL-A2", 0x0000, 0x8059},
236 {"B/G-PAL-NICAM", 0x0004, 0x8059},
237 {"B/G-PAL-MONO", 0x0078, 0x8059},
238 {"I-PAL-NICAM", 0x0080, 0x8049},
239 {"I-PAL-NICAM-MONO", 0x0078, 0x8049},
240 {"D/K-PAL-A2", 0x0000, 0x8049},
241 {"D/K-PAL-NICAM", 0x0080, 0x8049},
242 {"D/K-PAL-MONO", 0x0078, 0x8049},
243 {"D/K-SECAM-A2 DK1", 0x0000, 0x8049},
244 {"D/K-SECAM-A2 L/DK3", 0x0000, 0x8049},
245 {"D/K-SECAM-A2 MONO", 0x0078, 0x8049},
246 {"L-SECAM-NICAM", 0x8080, 0x0009},
247 {"L'-SECAM-NICAM", 0x8080, 0x4009},
248 {"DTV6", 0x00C0, 0x8002},
249 {"DTV8", 0x00C0, 0x800B},
250 {"DTV7/8", 0x00C0, 0x801B},
251 {"DTV7", 0x00C0, 0x8007},
252 {"FM Radio-INPUT2", 0x0008, 0x9800},
253 {"FM Radio-INPUT1", 0x0008, 0x9000}
256 static int xc4000_is_firmware_loaded(struct dvb_frontend
*fe
);
257 static int xc4000_readreg(struct xc4000_priv
*priv
, u16 reg
, u16
*val
);
258 static int xc4000_TunerReset(struct dvb_frontend
*fe
);
260 static int xc_send_i2c_data(struct xc4000_priv
*priv
, u8
*buf
, int len
)
262 struct i2c_msg msg
= { .addr
= priv
->i2c_props
.addr
,
263 .flags
= 0, .buf
= buf
, .len
= len
};
264 if (i2c_transfer(priv
->i2c_props
.adap
, &msg
, 1) != 1) {
265 if (priv
->ignore_i2c_write_errors
== 0) {
266 printk(KERN_ERR
"xc4000: I2C write failed (len=%i)\n",
269 printk("bytes %02x %02x %02x %02x\n", buf
[0],
270 buf
[1], buf
[2], buf
[3]);
272 return XC_RESULT_I2C_WRITE_FAILURE
;
275 return XC_RESULT_SUCCESS
;
278 /* This routine is never used because the only time we read data from the
279 i2c bus is when we read registers, and we want that to be an atomic i2c
280 transaction in case we are on a multi-master bus */
282 static void xc_wait(int wait_ms
)
287 static int xc4000_TunerReset(struct dvb_frontend
*fe
)
289 struct xc4000_priv
*priv
= fe
->tuner_priv
;
292 dprintk(1, "%s()\n", __func__
);
295 ret
= fe
->callback(((fe
->dvb
) && (fe
->dvb
->priv
)) ?
297 priv
->i2c_props
.adap
->algo_data
,
298 DVB_FRONTEND_COMPONENT_TUNER
,
299 XC4000_TUNER_RESET
, 0);
301 printk(KERN_ERR
"xc4000: reset failed\n");
302 return XC_RESULT_RESET_FAILURE
;
305 printk(KERN_ERR
"xc4000: no tuner reset callback function, fatal\n");
306 return XC_RESULT_RESET_FAILURE
;
308 return XC_RESULT_SUCCESS
;
311 static int xc_write_reg(struct xc4000_priv
*priv
, u16 regAddr
, u16 i2cData
)
316 buf
[0] = (regAddr
>> 8) & 0xFF;
317 buf
[1] = regAddr
& 0xFF;
318 buf
[2] = (i2cData
>> 8) & 0xFF;
319 buf
[3] = i2cData
& 0xFF;
320 result
= xc_send_i2c_data(priv
, buf
, 4);
325 static int xc_load_i2c_sequence(struct dvb_frontend
*fe
, const u8
*i2c_sequence
)
327 struct xc4000_priv
*priv
= fe
->tuner_priv
;
329 int i
, nbytes_to_send
, result
;
330 unsigned int len
, pos
, index
;
331 u8 buf
[XC_MAX_I2C_WRITE_LENGTH
];
334 while ((i2c_sequence
[index
] != 0xFF) ||
335 (i2c_sequence
[index
+ 1] != 0xFF)) {
336 len
= i2c_sequence
[index
] * 256 + i2c_sequence
[index
+1];
339 result
= xc4000_TunerReset(fe
);
341 if (result
!= XC_RESULT_SUCCESS
)
343 } else if (len
& 0x8000) {
345 xc_wait(len
& 0x7FFF);
348 /* Send i2c data whilst ensuring individual transactions
349 * do not exceed XC_MAX_I2C_WRITE_LENGTH bytes.
352 buf
[0] = i2c_sequence
[index
];
353 buf
[1] = i2c_sequence
[index
+ 1];
356 if ((len
- pos
) > XC_MAX_I2C_WRITE_LENGTH
- 2)
358 XC_MAX_I2C_WRITE_LENGTH
;
360 nbytes_to_send
= (len
- pos
+ 2);
361 for (i
= 2; i
< nbytes_to_send
; i
++) {
362 buf
[i
] = i2c_sequence
[index
+ pos
+
365 result
= xc_send_i2c_data(priv
, buf
,
368 if (result
!= XC_RESULT_SUCCESS
)
371 pos
+= nbytes_to_send
- 2;
376 return XC_RESULT_SUCCESS
;
379 static int xc_SetTVStandard(struct xc4000_priv
*priv
,
380 u16 VideoMode
, u16 AudioMode
)
383 dprintk(1, "%s(0x%04x,0x%04x)\n", __func__
, VideoMode
, AudioMode
);
384 dprintk(1, "%s() Standard = %s\n",
386 XC4000_Standard
[priv
->video_standard
].Name
);
388 /* Don't complain when the request fails because of i2c stretching */
389 priv
->ignore_i2c_write_errors
= 1;
391 ret
= xc_write_reg(priv
, XREG_VIDEO_MODE
, VideoMode
);
392 if (ret
== XC_RESULT_SUCCESS
)
393 ret
= xc_write_reg(priv
, XREG_AUDIO_MODE
, AudioMode
);
395 priv
->ignore_i2c_write_errors
= 0;
400 static int xc_SetSignalSource(struct xc4000_priv
*priv
, u16 rf_mode
)
402 dprintk(1, "%s(%d) Source = %s\n", __func__
, rf_mode
,
403 rf_mode
== XC_RF_MODE_AIR
? "ANTENNA" : "CABLE");
405 if ((rf_mode
!= XC_RF_MODE_AIR
) && (rf_mode
!= XC_RF_MODE_CABLE
)) {
406 rf_mode
= XC_RF_MODE_CABLE
;
408 "%s(), Invalid mode, defaulting to CABLE",
411 return xc_write_reg(priv
, XREG_SIGNALSOURCE
, rf_mode
);
414 static const struct dvb_tuner_ops xc4000_tuner_ops
;
416 static int xc_set_RF_frequency(struct xc4000_priv
*priv
, u32 freq_hz
)
420 dprintk(1, "%s(%u)\n", __func__
, freq_hz
);
422 if ((freq_hz
> xc4000_tuner_ops
.info
.frequency_max
) ||
423 (freq_hz
< xc4000_tuner_ops
.info
.frequency_min
))
424 return XC_RESULT_OUT_OF_RANGE
;
426 freq_code
= (u16
)(freq_hz
/ 15625);
428 /* WAS: Starting in firmware version 1.1.44, Xceive recommends using the
429 FINERFREQ for all normal tuning (the doc indicates reg 0x03 should
430 only be used for fast scanning for channel lock) */
431 return xc_write_reg(priv
, XREG_RF_FREQ
, freq_code
); /* WAS: XREG_FINERFREQ */
435 static int xc_get_ADC_Envelope(struct xc4000_priv
*priv
, u16
*adc_envelope
)
437 return xc4000_readreg(priv
, XREG_ADC_ENV
, adc_envelope
);
440 static int xc_get_frequency_error(struct xc4000_priv
*priv
, u32
*freq_error_hz
)
446 result
= xc4000_readreg(priv
, XREG_FREQ_ERROR
, ®Data
);
447 if (result
!= XC_RESULT_SUCCESS
)
451 (*freq_error_hz
) = (tmp
* 15625) / 1000;
455 static int xc_get_lock_status(struct xc4000_priv
*priv
, u16
*lock_status
)
457 return xc4000_readreg(priv
, XREG_LOCK
, lock_status
);
460 static int xc_get_version(struct xc4000_priv
*priv
,
461 u8
*hw_majorversion
, u8
*hw_minorversion
,
462 u8
*fw_majorversion
, u8
*fw_minorversion
)
467 result
= xc4000_readreg(priv
, XREG_VERSION
, &data
);
468 if (result
!= XC_RESULT_SUCCESS
)
471 (*hw_majorversion
) = (data
>> 12) & 0x0F;
472 (*hw_minorversion
) = (data
>> 8) & 0x0F;
473 (*fw_majorversion
) = (data
>> 4) & 0x0F;
474 (*fw_minorversion
) = data
& 0x0F;
480 static int xc_get_buildversion(struct xc4000_priv *priv, u16 *buildrev)
482 return xc4000_readreg(priv, XREG_BUILD, buildrev);
485 static int xc_get_hsync_freq(struct xc4000_priv
*priv
, u32
*hsync_freq_hz
)
490 result
= xc4000_readreg(priv
, XREG_HSYNC_FREQ
, ®Data
);
491 if (result
!= XC_RESULT_SUCCESS
)
494 (*hsync_freq_hz
) = ((regData
& 0x0fff) * 763)/100;
498 static int xc_get_frame_lines(struct xc4000_priv
*priv
, u16
*frame_lines
)
500 return xc4000_readreg(priv
, XREG_FRAME_LINES
, frame_lines
);
503 static int xc_get_quality(struct xc4000_priv
*priv
, u16
*quality
)
505 return xc4000_readreg(priv
, XREG_QUALITY
, quality
);
508 static u16
WaitForLock(struct xc4000_priv
*priv
)
511 int watchDogCount
= 40;
513 while ((lockState
== 0) && (watchDogCount
> 0)) {
514 xc_get_lock_status(priv
, &lockState
);
515 if (lockState
!= 1) {
523 #define XC_TUNE_ANALOG 0
524 #define XC_TUNE_DIGITAL 1
525 static int xc_tune_channel(struct xc4000_priv
*priv
, u32 freq_hz
, int mode
)
530 dprintk(1, "%s(%u)\n", __func__
, freq_hz
);
532 /* Don't complain when the request fails because of i2c stretching */
533 priv
->ignore_i2c_write_errors
= 1;
534 result
= xc_set_RF_frequency(priv
, freq_hz
);
535 priv
->ignore_i2c_write_errors
= 0;
537 if (result
!= XC_RESULT_SUCCESS
)
540 if (mode
== XC_TUNE_ANALOG
) {
541 if (WaitForLock(priv
) == 1)
548 static int xc4000_readreg(struct xc4000_priv
*priv
, u16 reg
, u16
*val
)
550 u8 buf
[2] = { reg
>> 8, reg
& 0xff };
551 u8 bval
[2] = { 0, 0 };
552 struct i2c_msg msg
[2] = {
553 { .addr
= priv
->i2c_props
.addr
,
554 .flags
= 0, .buf
= &buf
[0], .len
= 2 },
555 { .addr
= priv
->i2c_props
.addr
,
556 .flags
= I2C_M_RD
, .buf
= &bval
[0], .len
= 2 },
559 if (i2c_transfer(priv
->i2c_props
.adap
, msg
, 2) != 2) {
560 printk(KERN_WARNING
"xc4000: I2C read failed\n");
564 *val
= (bval
[0] << 8) | bval
[1];
565 return XC_RESULT_SUCCESS
;
568 #define dump_firm_type(t) dump_firm_type_and_int_freq(t, 0)
569 static void dump_firm_type_and_int_freq(unsigned int type
, u16 int_freq
)
615 if (type
& TOYOTA388
)
616 printk("TOYOTA388 ");
617 if (type
& TOYOTA794
)
618 printk("TOYOTA794 ");
621 if (type
& ZARLINK456
)
622 printk("ZARLINK456 ");
632 printk("HAS_IF_%d ", int_freq
);
635 static int seek_firmware(struct dvb_frontend
*fe
, unsigned int type
,
638 struct xc4000_priv
*priv
= fe
->tuner_priv
;
639 int i
, best_i
= -1, best_nr_matches
= 0;
640 unsigned int type_mask
= 0;
643 printk("Error! firmware not loaded\n");
647 if (((type
& ~SCODE
) == 0) && (*id
== 0))
651 type_mask
= BASE_TYPES
;
652 else if (type
& SCODE
) {
654 type_mask
= SCODE_TYPES
& ~HAS_IF
;
655 } else if (type
& DTV_TYPES
)
656 type_mask
= DTV_TYPES
;
657 else if (type
& STD_SPECIFIC_TYPES
)
658 type_mask
= STD_SPECIFIC_TYPES
;
665 /* Seek for exact match */
666 for (i
= 0; i
< priv
->firm_size
; i
++) {
667 if ((type
== (priv
->firm
[i
].type
& type_mask
)) &&
668 (*id
== priv
->firm
[i
].id
))
672 /* Seek for generic video standard match */
673 for (i
= 0; i
< priv
->firm_size
; i
++) {
674 v4l2_std_id match_mask
;
677 if (type
!= (priv
->firm
[i
].type
& type_mask
))
680 match_mask
= *id
& priv
->firm
[i
].id
;
684 if ((*id
& match_mask
) == *id
)
685 goto found
; /* Supports all the requested standards */
687 nr_matches
= hweight64(match_mask
);
688 if (nr_matches
> best_nr_matches
) {
689 best_nr_matches
= nr_matches
;
694 if (best_nr_matches
> 0) {
695 printk("Selecting best matching firmware (%d bits) for "
696 "type=", best_nr_matches
);
697 // dump_firm_type(type);
698 printk("(%x), id %016llx:\n", type
, (unsigned long long)*id
);
703 /*FIXME: Would make sense to seek for type "hint" match ? */
709 *id
= priv
->firm
[i
].id
;
713 printk("%s firmware for type=", (i
< 0) ? "Can't find" :
715 dump_firm_type(type
);
716 printk("(%x), id %016llx.\n", type
, (unsigned long long)*id
);
721 static int load_firmware(struct dvb_frontend
*fe
, unsigned int type
,
724 struct xc4000_priv
*priv
= fe
->tuner_priv
;
728 pos
= seek_firmware(fe
, type
, id
);
732 p
= priv
->firm
[pos
].ptr
;
734 /* Don't complain when the request fails because of i2c stretching */
735 priv
->ignore_i2c_write_errors
= 1;
737 rc
= xc_load_i2c_sequence(fe
, p
);
739 priv
->ignore_i2c_write_errors
= 0;
744 static int xc4000_fwupload(struct dvb_frontend
*fe
)
746 struct xc4000_priv
*priv
= fe
->tuner_priv
;
747 const struct firmware
*fw
= NULL
;
748 const unsigned char *p
, *endp
;
754 fname
= XC4000_DEFAULT_FIRMWARE
;
756 printk("Reading firmware %s\n", fname
);
757 rc
= request_firmware(&fw
, fname
, priv
->i2c_props
.adap
->dev
.parent
);
760 printk("Error: firmware %s not found.\n",
763 printk("Error %d while requesting firmware %s \n",
771 if (fw
->size
< sizeof(name
) - 1 + 2 + 2) {
772 printk("Error: firmware file %s has invalid size!\n",
777 memcpy(name
, p
, sizeof(name
) - 1);
778 name
[sizeof(name
) - 1] = 0;
779 p
+= sizeof(name
) - 1;
781 priv
->firm_version
= get_unaligned_le16(p
);
784 n_array
= get_unaligned_le16(p
);
787 dprintk(1, "Loading %d firmware images from %s, type: %s, ver %d.%d\n",
788 n_array
, fname
, name
,
789 priv
->firm_version
>> 8, priv
->firm_version
& 0xff);
791 priv
->firm
= kzalloc(sizeof(*priv
->firm
) * n_array
, GFP_KERNEL
);
792 if (priv
->firm
== NULL
) {
793 printk("Not enough memory to load firmware file.\n");
797 priv
->firm_size
= n_array
;
807 printk("More firmware images in file than "
812 /* Checks if there's enough bytes to read */
813 if (endp
- p
< sizeof(type
) + sizeof(id
) + sizeof(size
))
816 type
= get_unaligned_le32(p
);
819 id
= get_unaligned_le64(p
);
823 int_freq
= get_unaligned_le16(p
);
824 p
+= sizeof(int_freq
);
825 if (endp
- p
< sizeof(size
))
829 size
= get_unaligned_le32(p
);
832 if (!size
|| size
> endp
- p
) {
833 printk("Firmware type ");
834 // dump_firm_type(type);
835 printk("(%x), id %llx is corrupted "
836 "(size=%d, expected %d)\n",
837 type
, (unsigned long long)id
,
838 (unsigned)(endp
- p
), size
);
842 priv
->firm
[n
].ptr
= kzalloc(size
, GFP_KERNEL
);
843 if (priv
->firm
[n
].ptr
== NULL
) {
844 printk("Not enough memory to load firmware file.\n");
850 printk("Reading firmware type ");
851 dump_firm_type_and_int_freq(type
, int_freq
);
852 printk("(%x), id %llx, size=%d.\n",
853 type
, (unsigned long long)id
, size
);
856 memcpy(priv
->firm
[n
].ptr
, p
, size
);
857 priv
->firm
[n
].type
= type
;
858 priv
->firm
[n
].id
= id
;
859 priv
->firm
[n
].size
= size
;
860 priv
->firm
[n
].int_freq
= int_freq
;
865 if (n
+ 1 != priv
->firm_size
) {
866 printk("Firmware file is incomplete!\n");
873 printk("Firmware header is incomplete!\n");
876 printk("Error: firmware file is corrupted!\n");
879 printk("Releasing partially loaded firmware file.\n");
880 // free_firmware(priv);
883 release_firmware(fw
);
885 dprintk(1, "Firmware files loaded.\n");
890 static int load_scode(struct dvb_frontend
*fe
, unsigned int type
,
891 v4l2_std_id
*id
, __u16 int_freq
, int scode
)
893 struct xc4000_priv
*priv
= fe
->tuner_priv
;
899 dprintk(1, "%s called int_freq=%d\n", __func__
, int_freq
);
902 pos
= seek_firmware(fe
, type
, id
);
906 for (pos
= 0; pos
< priv
->firm_size
; pos
++) {
907 if ((priv
->firm
[pos
].int_freq
== int_freq
) &&
908 (priv
->firm
[pos
].type
& HAS_IF
))
911 if (pos
== priv
->firm_size
)
915 p
= priv
->firm
[pos
].ptr
;
917 if (priv
->firm
[pos
].type
& HAS_IF
) {
918 if (priv
->firm
[pos
].size
!= 12 * 16 || scode
>= 16)
922 /* 16 SCODE entries per file; each SCODE entry is 12 bytes and
923 * has a 2-byte size header in the firmware format. */
924 if (priv
->firm
[pos
].size
!= 14 * 16 || scode
>= 16 ||
925 le16_to_cpu(*(__u16
*)(p
+ 14 * scode
)) != 12)
930 tuner_info("Loading SCODE for type=");
931 dump_firm_type_and_int_freq(priv
->firm
[pos
].type
,
932 priv
->firm
[pos
].int_freq
);
933 printk("(%x), id %016llx.\n", priv
->firm
[pos
].type
,
934 (unsigned long long)*id
);
937 memcpy(&scode_buf
[1], p
, 12);
939 /* Enter direct-mode */
940 rc
= xc_write_reg(priv
, XREG_DIRECTSITTING_MODE
, 0);
942 printk("failed to put device into direct mode!\n");
946 rc
= xc_send_i2c_data(priv
, scode_buf
, 13);
947 if (rc
!= XC_RESULT_SUCCESS
) {
948 /* Even if the send failed, make sure we set back to indirect
950 printk("Failed to set scode %d\n", rc
);
953 /* Switch back to indirect-mode */
954 memset(indirect_mode
, 0, sizeof(indirect_mode
));
955 indirect_mode
[4] = 0x88;
956 xc_send_i2c_data(priv
, indirect_mode
, sizeof(indirect_mode
));
962 static int check_firmware(struct dvb_frontend
*fe
, unsigned int type
,
963 v4l2_std_id std
, __u16 int_freq
)
965 struct xc4000_priv
*priv
= fe
->tuner_priv
;
966 struct firmware_properties new_fw
;
967 int rc
= 0, is_retry
= 0;
968 u16 version
, hwmodel
;
970 u8 hw_major
, hw_minor
, fw_major
, fw_minor
;
972 dprintk(1, "%s called\n", __func__
);
975 rc
= xc4000_fwupload(fe
);
981 if (priv
->ctrl
.mts
&& !(type
& FM
))
988 new_fw
.std_req
= std
;
989 // new_fw.scode_table = SCODE | priv->ctrl.scode_table;
990 new_fw
.scode_table
= SCODE
;
992 new_fw
.int_freq
= int_freq
;
994 dprintk(1, "checking firmware, user requested type=");
996 dump_firm_type(new_fw
.type
);
997 printk("(%x), id %016llx, ", new_fw
.type
,
998 (unsigned long long)new_fw
.std_req
);
1000 printk("scode_tbl ");
1002 dump_firm_type(priv
->ctrl
.scode_table
);
1003 printk("(%x), ", priv
->ctrl
.scode_table
);
1006 printk("int_freq %d, ", new_fw
.int_freq
);
1007 printk("scode_nr %d\n", new_fw
.scode_nr
);
1010 /* No need to reload base firmware if it matches */
1011 if (((BASE
| new_fw
.type
) & BASE_TYPES
) ==
1012 (priv
->cur_fw
.type
& BASE_TYPES
)) {
1013 dprintk(1, "BASE firmware not changed.\n");
1017 /* Updating BASE - forget about all currently loaded firmware */
1018 memset(&priv
->cur_fw
, 0, sizeof(priv
->cur_fw
));
1020 /* Reset is needed before loading firmware */
1021 rc
= xc4000_TunerReset(fe
);
1025 /* BASE firmwares are all std0 */
1027 rc
= load_firmware(fe
, BASE
| new_fw
.type
, &std0
);
1029 printk("Error %d while loading base firmware\n", rc
);
1033 /* Load INIT1, if needed */
1034 dprintk(1, "Load init1 firmware, if exists\n");
1036 rc
= load_firmware(fe
, BASE
| INIT1
| new_fw
.type
, &std0
);
1038 rc
= load_firmware(fe
, (BASE
| INIT1
| new_fw
.type
) & ~F8MHZ
,
1040 if (rc
< 0 && rc
!= -ENOENT
) {
1041 tuner_err("Error %d while loading init1 firmware\n",
1048 * No need to reload standard specific firmware if base firmware
1049 * was not reloaded and requested video standards have not changed.
1051 if (priv
->cur_fw
.type
== (BASE
| new_fw
.type
) &&
1052 priv
->cur_fw
.std_req
== std
) {
1053 dprintk(1, "Std-specific firmware already loaded.\n");
1054 goto skip_std_specific
;
1057 /* Reloading std-specific firmware forces a SCODE update */
1058 priv
->cur_fw
.scode_table
= 0;
1060 /* Load the standard firmware */
1061 rc
= load_firmware(fe
, new_fw
.type
, &new_fw
.id
);
1067 if (priv
->cur_fw
.scode_table
== new_fw
.scode_table
&&
1068 priv
->cur_fw
.scode_nr
== new_fw
.scode_nr
) {
1069 dprintk(1, "SCODE firmware already loaded.\n");
1073 if (new_fw
.type
& FM
)
1076 /* Load SCODE firmware, if exists */
1077 rc
= load_scode(fe
, new_fw
.type
| new_fw
.scode_table
, &new_fw
.id
,
1078 new_fw
.int_freq
, new_fw
.scode_nr
);
1079 if (rc
!= XC_RESULT_SUCCESS
)
1080 dprintk(1, "load scode failed %d\n", rc
);
1083 rc
= xc4000_readreg(priv
, XREG_PRODUCT_ID
, &hwmodel
);
1085 if (xc_get_version(priv
, &hw_major
, &hw_minor
, &fw_major
,
1086 &fw_minor
) != XC_RESULT_SUCCESS
) {
1087 printk("Unable to read tuner registers.\n");
1091 dprintk(1, "Device is Xceive %d version %d.%d, "
1092 "firmware version %d.%d\n",
1093 hwmodel
, hw_major
, hw_minor
, fw_major
, fw_minor
);
1095 /* Check firmware version against what we downloaded. */
1097 if (priv
->firm_version
!= ((version
& 0xf0) << 4 | (version
& 0x0f))) {
1098 printk("Incorrect readback of firmware version %x.\n",
1104 /* Check that the tuner hardware model remains consistent over time. */
1105 if (priv
->hwmodel
== 0 && hwmodel
== 4000) {
1106 priv
->hwmodel
= hwmodel
;
1107 priv
->hwvers
= version
& 0xff00;
1108 } else if (priv
->hwmodel
== 0 || priv
->hwmodel
!= hwmodel
||
1109 priv
->hwvers
!= (version
& 0xff00)) {
1110 printk("Read invalid device hardware information - tuner "
1115 memcpy(&priv
->cur_fw
, &new_fw
, sizeof(priv
->cur_fw
));
1118 * By setting BASE in cur_fw.type only after successfully loading all
1119 * firmwares, we can:
1120 * 1. Identify that BASE firmware with type=0 has been loaded;
1121 * 2. Tell whether BASE firmware was just changed the next time through.
1123 priv
->cur_fw
.type
|= BASE
;
1128 memset(&priv
->cur_fw
, 0, sizeof(priv
->cur_fw
));
1132 dprintk(1, "Retrying firmware load\n");
1141 static void xc_debug_dump(struct xc4000_priv
*priv
)
1144 u32 freq_error_hz
= 0;
1146 u32 hsync_freq_hz
= 0;
1149 u8 hw_majorversion
= 0, hw_minorversion
= 0;
1150 u8 fw_majorversion
= 0, fw_minorversion
= 0;
1151 // u16 fw_buildversion = 0;
1153 /* Wait for stats to stabilize.
1154 * Frame Lines needs two frame times after initial lock
1155 * before it is valid.
1159 xc_get_ADC_Envelope(priv
, &adc_envelope
);
1160 dprintk(1, "*** ADC envelope (0-1023) = %d\n", adc_envelope
);
1162 xc_get_frequency_error(priv
, &freq_error_hz
);
1163 dprintk(1, "*** Frequency error = %d Hz\n", freq_error_hz
);
1165 xc_get_lock_status(priv
, &lock_status
);
1166 dprintk(1, "*** Lock status (0-Wait, 1-Locked, 2-No-signal) = %d\n",
1169 xc_get_version(priv
, &hw_majorversion
, &hw_minorversion
,
1170 &fw_majorversion
, &fw_minorversion
);
1172 // xc_get_buildversion(priv, &fw_buildversion);
1173 // dprintk(1, "*** HW: V%02x.%02x, FW: V%02x.%02x.%04x\n",
1174 // hw_majorversion, hw_minorversion,
1175 // fw_majorversion, fw_minorversion, fw_buildversion);
1177 dprintk(1, "*** HW: V%02x.%02x, FW: V%02x.%02x\n",
1178 hw_majorversion
, hw_minorversion
,
1179 fw_majorversion
, fw_minorversion
);
1181 xc_get_hsync_freq(priv
, &hsync_freq_hz
);
1182 dprintk(1, "*** Horizontal sync frequency = %d Hz\n", hsync_freq_hz
);
1184 xc_get_frame_lines(priv
, &frame_lines
);
1185 dprintk(1, "*** Frame lines = %d\n", frame_lines
);
1187 xc_get_quality(priv
, &quality
);
1188 dprintk(1, "*** Quality (0:<8dB, 7:>56dB) = %d\n", quality
);
1191 static int xc4000_set_params(struct dvb_frontend
*fe
,
1192 struct dvb_frontend_parameters
*params
)
1194 struct xc4000_priv
*priv
= fe
->tuner_priv
;
1198 dprintk(1, "%s() frequency=%d (Hz)\n", __func__
, params
->frequency
);
1200 if (fe
->ops
.info
.type
== FE_ATSC
) {
1201 dprintk(1, "%s() ATSC\n", __func__
);
1202 switch (params
->u
.vsb
.modulation
) {
1205 dprintk(1, "%s() VSB modulation\n", __func__
);
1206 priv
->rf_mode
= XC_RF_MODE_AIR
;
1207 priv
->freq_hz
= params
->frequency
- 1750000;
1208 priv
->bandwidth
= BANDWIDTH_6_MHZ
;
1209 priv
->video_standard
= XC4000_DTV6
;
1215 dprintk(1, "%s() QAM modulation\n", __func__
);
1216 priv
->rf_mode
= XC_RF_MODE_CABLE
;
1217 priv
->freq_hz
= params
->frequency
- 1750000;
1218 priv
->bandwidth
= BANDWIDTH_6_MHZ
;
1219 priv
->video_standard
= XC4000_DTV6
;
1225 } else if (fe
->ops
.info
.type
== FE_OFDM
) {
1226 dprintk(1, "%s() OFDM\n", __func__
);
1227 switch (params
->u
.ofdm
.bandwidth
) {
1228 case BANDWIDTH_6_MHZ
:
1229 priv
->bandwidth
= BANDWIDTH_6_MHZ
;
1230 priv
->video_standard
= XC4000_DTV6
;
1231 priv
->freq_hz
= params
->frequency
- 1750000;
1234 case BANDWIDTH_7_MHZ
:
1235 printk(KERN_ERR
"xc4000 bandwidth 7MHz not supported\n");
1238 case BANDWIDTH_8_MHZ
:
1239 priv
->bandwidth
= BANDWIDTH_8_MHZ
;
1240 priv
->video_standard
= XC4000_DTV8
;
1241 priv
->freq_hz
= params
->frequency
- 2750000;
1245 printk(KERN_ERR
"xc4000 bandwidth not set!\n");
1248 priv
->rf_mode
= XC_RF_MODE_AIR
;
1250 printk(KERN_ERR
"xc4000 modulation type not supported!\n");
1254 dprintk(1, "%s() frequency=%d (compensated)\n",
1255 __func__
, priv
->freq_hz
);
1257 /* Make sure the correct firmware type is loaded */
1258 if (check_firmware(fe
, type
, 0, priv
->if_khz
) != XC_RESULT_SUCCESS
) {
1262 ret
= xc_SetSignalSource(priv
, priv
->rf_mode
);
1263 if (ret
!= XC_RESULT_SUCCESS
) {
1265 "xc4000: xc_SetSignalSource(%d) failed\n",
1270 ret
= xc_SetTVStandard(priv
,
1271 XC4000_Standard
[priv
->video_standard
].VideoMode
,
1272 XC4000_Standard
[priv
->video_standard
].AudioMode
);
1273 if (ret
!= XC_RESULT_SUCCESS
) {
1274 printk(KERN_ERR
"xc4000: xc_SetTVStandard failed\n");
1278 ret
= xc_set_IF_frequency(priv
, priv
->if_khz
);
1279 if (ret
!= XC_RESULT_SUCCESS
) {
1280 printk(KERN_ERR
"xc4000: xc_Set_IF_frequency(%d) failed\n",
1285 xc_tune_channel(priv
, priv
->freq_hz
, XC_TUNE_DIGITAL
);
1288 xc_debug_dump(priv
);
1293 static int xc4000_is_firmware_loaded(struct dvb_frontend
*fe
)
1295 struct xc4000_priv
*priv
= fe
->tuner_priv
;
1299 ret
= xc4000_readreg(priv
, XREG_PRODUCT_ID
, &id
);
1300 if (ret
== XC_RESULT_SUCCESS
) {
1301 if (id
== XC_PRODUCT_ID_FW_NOT_LOADED
)
1302 ret
= XC_RESULT_RESET_FAILURE
;
1304 ret
= XC_RESULT_SUCCESS
;
1307 dprintk(1, "%s() returns %s id = 0x%x\n", __func__
,
1308 ret
== XC_RESULT_SUCCESS
? "True" : "False", id
);
1312 static int xc4000_set_analog_params(struct dvb_frontend
*fe
,
1313 struct analog_parameters
*params
)
1315 struct xc4000_priv
*priv
= fe
->tuner_priv
;
1318 dprintk(1, "%s() frequency=%d (in units of 62.5khz)\n",
1319 __func__
, params
->frequency
);
1321 /* Fix me: it could be air. */
1322 priv
->rf_mode
= params
->mode
;
1323 if (params
->mode
> XC_RF_MODE_CABLE
)
1324 priv
->rf_mode
= XC_RF_MODE_CABLE
;
1326 /* params->frequency is in units of 62.5khz */
1327 priv
->freq_hz
= params
->frequency
* 62500;
1329 /* FIX ME: Some video standards may have several possible audio
1330 standards. We simply default to one of them here.
1332 if (params
->std
& V4L2_STD_MN
) {
1333 /* default to BTSC audio standard */
1334 priv
->video_standard
= XC4000_MN_NTSC_PAL_BTSC
;
1338 if (params
->std
& V4L2_STD_PAL_BG
) {
1339 /* default to NICAM audio standard */
1340 priv
->video_standard
= XC4000_BG_PAL_NICAM
;
1344 if (params
->std
& V4L2_STD_PAL_I
) {
1345 /* default to NICAM audio standard */
1346 priv
->video_standard
= XC4000_I_PAL_NICAM
;
1350 if (params
->std
& V4L2_STD_PAL_DK
) {
1351 /* default to NICAM audio standard */
1352 priv
->video_standard
= XC4000_DK_PAL_NICAM
;
1356 if (params
->std
& V4L2_STD_SECAM_DK
) {
1357 /* default to A2 DK1 audio standard */
1358 priv
->video_standard
= XC4000_DK_SECAM_A2DK1
;
1362 if (params
->std
& V4L2_STD_SECAM_L
) {
1363 priv
->video_standard
= XC4000_L_SECAM_NICAM
;
1367 if (params
->std
& V4L2_STD_SECAM_LC
) {
1368 priv
->video_standard
= XC4000_LC_SECAM_NICAM
;
1374 /* FIXME - firmware type not being set properly */
1375 if (check_firmware(fe
, DTV8
, 0, priv
->if_khz
) != XC_RESULT_SUCCESS
) {
1379 ret
= xc_SetSignalSource(priv
, priv
->rf_mode
);
1380 if (ret
!= XC_RESULT_SUCCESS
) {
1382 "xc4000: xc_SetSignalSource(%d) failed\n",
1387 ret
= xc_SetTVStandard(priv
,
1388 XC4000_Standard
[priv
->video_standard
].VideoMode
,
1389 XC4000_Standard
[priv
->video_standard
].AudioMode
);
1390 if (ret
!= XC_RESULT_SUCCESS
) {
1391 printk(KERN_ERR
"xc4000: xc_SetTVStandard failed\n");
1395 xc_tune_channel(priv
, priv
->freq_hz
, XC_TUNE_ANALOG
);
1398 xc_debug_dump(priv
);
1403 static int xc4000_get_frequency(struct dvb_frontend
*fe
, u32
*freq
)
1405 struct xc4000_priv
*priv
= fe
->tuner_priv
;
1406 dprintk(1, "%s()\n", __func__
);
1407 *freq
= priv
->freq_hz
;
1411 static int xc4000_get_bandwidth(struct dvb_frontend
*fe
, u32
*bw
)
1413 struct xc4000_priv
*priv
= fe
->tuner_priv
;
1414 dprintk(1, "%s()\n", __func__
);
1416 *bw
= priv
->bandwidth
;
1420 static int xc4000_get_status(struct dvb_frontend
*fe
, u32
*status
)
1422 struct xc4000_priv
*priv
= fe
->tuner_priv
;
1423 u16 lock_status
= 0;
1425 xc_get_lock_status(priv
, &lock_status
);
1427 dprintk(1, "%s() lock_status = 0x%08x\n", __func__
, lock_status
);
1429 *status
= lock_status
;
1434 static int xc4000_sleep(struct dvb_frontend
*fe
)
1436 /* FIXME: djh disable this for now... */
1437 return XC_RESULT_SUCCESS
;
1440 static int xc4000_init(struct dvb_frontend
*fe
)
1442 struct xc4000_priv
*priv
= fe
->tuner_priv
;
1443 dprintk(1, "%s()\n", __func__
);
1445 if (check_firmware(fe
, DTV8
, 0, priv
->if_khz
) != XC_RESULT_SUCCESS
) {
1446 printk(KERN_ERR
"xc4000: Unable to initialise tuner\n");
1451 xc_debug_dump(priv
);
1456 static int xc4000_release(struct dvb_frontend
*fe
)
1458 struct xc4000_priv
*priv
= fe
->tuner_priv
;
1460 dprintk(1, "%s()\n", __func__
);
1462 mutex_lock(&xc4000_list_mutex
);
1465 hybrid_tuner_release_state(priv
);
1467 mutex_unlock(&xc4000_list_mutex
);
1469 fe
->tuner_priv
= NULL
;
1474 static const struct dvb_tuner_ops xc4000_tuner_ops
= {
1476 .name
= "Xceive XC4000",
1477 .frequency_min
= 1000000,
1478 .frequency_max
= 1023000000,
1479 .frequency_step
= 50000,
1482 .release
= xc4000_release
,
1483 .init
= xc4000_init
,
1484 .sleep
= xc4000_sleep
,
1486 .set_params
= xc4000_set_params
,
1487 .set_analog_params
= xc4000_set_analog_params
,
1488 .get_frequency
= xc4000_get_frequency
,
1489 .get_bandwidth
= xc4000_get_bandwidth
,
1490 .get_status
= xc4000_get_status
1493 struct dvb_frontend
*xc4000_attach(struct dvb_frontend
*fe
,
1494 struct i2c_adapter
*i2c
,
1495 struct xc4000_config
*cfg
)
1497 struct xc4000_priv
*priv
= NULL
;
1501 dprintk(1, "%s(%d-%04x)\n", __func__
,
1502 i2c
? i2c_adapter_id(i2c
) : -1,
1503 cfg
? cfg
->i2c_address
: -1);
1505 mutex_lock(&xc4000_list_mutex
);
1507 instance
= hybrid_tuner_request_state(struct xc4000_priv
, priv
,
1508 hybrid_tuner_instance_list
,
1509 i2c
, cfg
->i2c_address
, "xc4000");
1515 /* new tuner instance */
1516 priv
->bandwidth
= BANDWIDTH_6_MHZ
;
1517 fe
->tuner_priv
= priv
;
1520 /* existing tuner instance */
1521 fe
->tuner_priv
= priv
;
1525 if (priv
->if_khz
== 0) {
1526 /* If the IF hasn't been set yet, use the value provided by
1527 the caller (occurs in hybrid devices where the analog
1528 call to xc4000_attach occurs before the digital side) */
1529 priv
->if_khz
= cfg
->if_khz
;
1532 /* Check if firmware has been loaded. It is possible that another
1533 instance of the driver has loaded the firmware.
1536 if (xc4000_readreg(priv
, XREG_PRODUCT_ID
, &id
) != XC_RESULT_SUCCESS
)
1540 case XC_PRODUCT_ID_FW_LOADED
:
1542 "xc4000: Successfully identified at address 0x%02x\n",
1545 "xc4000: Firmware has been loaded previously\n");
1547 case XC_PRODUCT_ID_FW_NOT_LOADED
:
1549 "xc4000: Successfully identified at address 0x%02x\n",
1552 "xc4000: Firmware has not been loaded previously\n");
1556 "xc4000: Device not found at addr 0x%02x (0x%x)\n",
1557 cfg
->i2c_address
, id
);
1561 mutex_unlock(&xc4000_list_mutex
);
1563 memcpy(&fe
->ops
.tuner_ops
, &xc4000_tuner_ops
,
1564 sizeof(struct dvb_tuner_ops
));
1566 /* FIXME: For now, load the firmware at startup. We will remove this
1567 before the code goes to production... */
1568 check_firmware(fe
, DTV8
, 0, priv
->if_khz
);
1572 mutex_unlock(&xc4000_list_mutex
);
1577 EXPORT_SYMBOL(xc4000_attach
);
1579 MODULE_AUTHOR("Steven Toth, Davide Ferri");
1580 MODULE_DESCRIPTION("Xceive xc4000 silicon tuner driver");
1581 MODULE_LICENSE("GPL");