aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@brturbo.com.br>2005-06-24 01:05:03 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-24 03:06:39 -0400
commitb45009b0288a96a3458f4f8e93cb776678d41875 (patch)
treec912e8d3dcc625fe92cdd1bac97bab7539fce4d7 /drivers/media/video
parent2d03e289ea4b13d78ce55f1ea0b0d45b8f1b34c3 (diff)
[PATCH] v4l: CX88 cards update
This patch adds support for various CX88 cards and allows specifying card addresses. Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br> Signed-off-by: Michael Krufky <mkrufky@m1k.net> Signed-off-by: cybercide@f2s.com <cybercide@f2s.com> Signed-off-by: Catalin Climov <catalin@climov.com> Signed-off-by: Nickolay V Shmyrev <nshmyrev@yandex.ru> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/cx88/cx88-blackbird.c488
-rw-r--r--drivers/media/video/cx88/cx88-cards.c235
-rw-r--r--drivers/media/video/cx88/cx88-core.c19
-rw-r--r--drivers/media/video/cx88/cx88-dvb.c2
-rw-r--r--drivers/media/video/cx88/cx88-i2c.c18
-rw-r--r--drivers/media/video/cx88/cx88-input.c4
-rw-r--r--drivers/media/video/cx88/cx88-mpeg.c52
-rw-r--r--drivers/media/video/cx88/cx88-reg.h3
-rw-r--r--drivers/media/video/cx88/cx88-tvaudio.c103
-rw-r--r--drivers/media/video/cx88/cx88-vbi.c6
-rw-r--r--drivers/media/video/cx88/cx88-video.c59
-rw-r--r--drivers/media/video/cx88/cx88.h23
-rw-r--r--drivers/media/video/ir-kbd-gpio.c2
13 files changed, 778 insertions, 236 deletions
diff --git a/drivers/media/video/cx88/cx88-blackbird.c b/drivers/media/video/cx88/cx88-blackbird.c
index 46d6778b863b..91f8afeded88 100644
--- a/drivers/media/video/cx88/cx88-blackbird.c
+++ b/drivers/media/video/cx88/cx88-blackbird.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * $Id: cx88-blackbird.c,v 1.26 2005/03/07 15:58:05 kraxel Exp $ 2 * $Id: cx88-blackbird.c,v 1.27 2005/06/03 13:31:50 mchehab Exp $
3 * 3 *
4 * Support for a cx23416 mpeg encoder via cx2388x host port. 4 * Support for a cx23416 mpeg encoder via cx2388x host port.
5 * "blackbird" reference design. 5 * "blackbird" reference design.
@@ -61,37 +61,304 @@ static LIST_HEAD(cx8802_devlist);
61 61
62#define IVTV_CMD_HW_BLOCKS_RST 0xFFFFFFFF 62#define IVTV_CMD_HW_BLOCKS_RST 0xFFFFFFFF
63 63
64/*Firmware API commands*/ 64/* Firmware API commands */
65#define IVTV_API_ENC_PING_FW 0x00000080 65/* #define IVTV_API_STD_TIMEOUT 0x00010000 // 65536, units?? */
66#define IVTV_API_ENC_GETVER 0x000000C4 66#define IVTV_API_STD_TIMEOUT 500
67#define IVTV_API_ENC_HALT_FW 0x000000C3 67
68#define IVTV_API_STD_TIMEOUT 0x00010000 /*units??*/ 68#define BLACKBIRD_API_PING 0x80
69//#define IVTV_API_ASSIGN_PGM_INDEX_INFO 0x000000c7 69#define BLACKBIRD_API_BEGIN_CAPTURE 0x81
70#define IVTV_API_ASSIGN_STREAM_TYPE 0x000000b9 70enum blackbird_capture_type {
71#define IVTV_API_ASSIGN_OUTPUT_PORT 0x000000bb 71 BLACKBIRD_MPEG_CAPTURE,
72#define IVTV_API_ASSIGN_FRAMERATE 0x0000008f 72 BLACKBIRD_RAW_CAPTURE,
73#define IVTV_API_ASSIGN_FRAME_SIZE 0x00000091 73 BLACKBIRD_RAW_PASSTHRU_CAPTURE
74#define IVTV_API_ASSIGN_ASPECT_RATIO 0x00000099 74};
75#define IVTV_API_ASSIGN_BITRATES 0x00000095 75enum blackbird_capture_bits {
76#define IVTV_API_ASSIGN_GOP_PROPERTIES 0x00000097 76 BLACKBIRD_RAW_BITS_NONE = 0x00,
77#define IVTV_API_ASSIGN_3_2_PULLDOWN 0x000000b1 77 BLACKBIRD_RAW_BITS_YUV_CAPTURE = 0x01,
78#define IVTV_API_ASSIGN_GOP_CLOSURE 0x000000c5 78 BLACKBIRD_RAW_BITS_PCM_CAPTURE = 0x02,
79#define IVTV_API_ASSIGN_AUDIO_PROPERTIES 0x000000bd 79 BLACKBIRD_RAW_BITS_VBI_CAPTURE = 0x04,
80#define IVTV_API_ASSIGN_DNR_FILTER_MODE 0x0000009b 80 BLACKBIRD_RAW_BITS_PASSTHRU_CAPTURE = 0x08,
81#define IVTV_API_ASSIGN_DNR_FILTER_PROPS 0x0000009d 81 BLACKBIRD_RAW_BITS_TO_HOST_CAPTURE = 0x10
82#define IVTV_API_ASSIGN_CORING_LEVELS 0x0000009f 82};
83#define IVTV_API_ASSIGN_SPATIAL_FILTER_TYPE 0x000000a1 83#define BLACKBIRD_API_END_CAPTURE 0x82
84#define IVTV_API_ASSIGN_FRAME_DROP_RATE 0x000000d0 84enum blackbird_capture_end {
85#define IVTV_API_ASSIGN_PLACEHOLDER 0x000000d8 85 BLACKBIRD_END_AT_GOP, /* stop at the end of gop, generate irq */
86#define IVTV_API_MUTE_VIDEO 0x000000d9 86 BLACKBIRD_END_NOW, /* stop immediately, no irq */
87#define IVTV_API_MUTE_AUDIO 0x000000da 87};
88#define IVTV_API_INITIALIZE_INPUT 0x000000cd 88#define BLACKBIRD_API_SET_AUDIO_ID 0x89
89#define IVTV_API_REFRESH_INPUT 0x000000d3 89#define BLACKBIRD_API_SET_VIDEO_ID 0x8B
90#define IVTV_API_ASSIGN_NUM_VSYNC_LINES 0x000000d6 90#define BLACKBIRD_API_SET_PCR_ID 0x8D
91#define IVTV_API_BEGIN_CAPTURE 0x00000081 91#define BLACKBIRD_API_SET_FRAMERATE 0x8F
92//#define IVTV_API_PAUSE_ENCODER 0x000000d2 92enum blackbird_framerate {
93//#define IVTV_API_EVENT_NOTIFICATION 0x000000d5 93 BLACKBIRD_FRAMERATE_NTSC_30, /* NTSC: 30fps */
94#define IVTV_API_END_CAPTURE 0x00000082 94 BLACKBIRD_FRAMERATE_PAL_25 /* PAL: 25fps */
95};
96#define BLACKBIRD_API_SET_RESOLUTION 0x91
97#define BLACKBIRD_API_SET_VIDEO_BITRATE 0x95
98enum blackbird_video_bitrate_type {
99 BLACKBIRD_VIDEO_VBR,
100 BLACKBIRD_VIDEO_CBR
101};
102#define BLACKBIRD_PEAK_RATE_DIVISOR 400
103enum blackbird_mux_rate {
104 BLACKBIRD_MUX_RATE_DEFAULT,
105 /* dvd mux rate: multiply by 400 to get the actual rate */
106 BLACKBIRD_MUX_RATE_DVD = 25200
107};
108#define BLACKBIRD_API_SET_GOP_STRUCTURE 0x97
109#define BLACKBIRD_API_SET_ASPECT_RATIO 0x99
110enum blackbird_aspect_ratio {
111 BLACKBIRD_ASPECT_RATIO_FORBIDDEN,
112 BLACKBIRD_ASPECT_RATIO_1_1_SQUARE,
113 BLACKBIRD_ASPECT_RATIO_4_3,
114 BLACKBIRD_ASPECT_RATIO_16_9,
115 BLACKBIRD_ASPECT_RATIO_221_100,
116 BLACKBIRD_ASPECT_RATIO_RESERVED
117};
118#define BLACKBIRD_API_SET_DNR_MODE 0x9B
119enum blackbird_dnr_bits {
120 BLACKBIRD_DNR_BITS_MANUAL,
121 BLACKBIRD_DNR_BITS_AUTO_SPATIAL,
122 BLACKBIRD_DNR_BITS_AUTO_TEMPORAL,
123 BLACKBIRD_DNR_BITS_AUTO
124};
125enum blackbird_median_filter {
126 BLACKBIRD_MEDIAN_FILTER_DISABLED,
127 BLACKBIRD_MEDIAN_FILTER_HORIZONTAL,
128 BLACKBIRD_MEDIAN_FILTER_VERTICAL,
129 BLACKBIRD_MEDIAN_FILTER_HV,
130 BLACKBIRD_MEDIAN_FILTER_DIAGONAL
131};
132#define BLACKBIRD_API_SET_MANUAL_DNR 0x9D
133#define BLACKBIRD_API_SET_DNR_MEDIAN 0x9F
134#define BLACKBIRD_API_SET_SPATIAL_FILTER 0xA1
135enum blackbird_spatial_filter_luma {
136 BLACKBIRD_SPATIAL_FILTER_LUMA_DISABLED,
137 BLACKBIRD_SPATIAL_FILTER_LUMA_1D_HORIZ,
138 BLACKBIRD_SPATIAL_FILTER_LUMA_1D_VERT,
139 BLACKBIRD_SPATIAL_FILTER_LUMA_2D_HV, /* separable, default */
140 BLACKBIRD_SPATIAL_FILTER_LUMA_2D_SYMM /* symmetric non-separable */
141};
142enum blackbird_spatial_filter_chroma {
143 BLACKBIRD_SPATIAL_FILTER_CHROMA_DISABLED,
144 BLACKBIRD_SPATIAL_FILTER_CHROMA_1D_HORIZ /* default */
145};
146#define BLACKBIRD_API_SET_3_2_PULLDOWN 0xB1
147enum blackbird_pulldown {
148 BLACKBIRD_3_2_PULLDOWN_DISABLED,
149 BLACKBIRD_3_2_PULLDOWN_ENABLED
150};
151#define BLACKBIRD_API_SET_VBI_LINE_NO 0xB7
152enum blackbird_vbi_line_bits {
153 BLACKBIRD_VBI_LINE_BITS_TOP_FIELD,
154 BLACKBIRD_VBI_LINE_BITS_BOT_FIELD = (1 << 31),
155 BLACKBIRD_VBI_LINE_BITS_ALL_LINES = 0xFFFFFFFF
156};
157enum blackbird_vbi_line {
158 BLACKBIRD_VBI_LINE_DISABLED,
159 BLACKBIRD_VBI_LINE_ENABLED
160};
161enum blackbird_vbi_slicing {
162 BLACKBIRD_VBI_SLICING_NONE,
163 BLACKBIRD_VBI_SLICING_CLOSED_CAPTION
164};
165#define BLACKBIRD_API_SET_STREAM_TYPE 0xB9
166enum blackbird_stream_type {
167 BLACKBIRD_STREAM_PROGRAM,
168 BLACKBIRD_STREAM_TRANSPORT,
169 BLACKBIRD_STREAM_MPEG1,
170 BLACKBIRD_STREAM_PES_AV,
171 BLACKBIRD_STREAM_UNKNOWN4,
172 BLACKBIRD_STREAM_PES_VIDEO,
173 BLACKBIRD_STREAM_UNKNOWN6,
174 BLACKBIRD_STREAM_PES_AUDIO,
175 BLACKBIRD_STREAM_UNKNOWN8,
176 BLACKBIRD_STREAM_UNKNOWN9, /* audio/pcm ? */
177 BLACKBIRD_STREAM_DVD,
178 BLACKBIRD_STREAM_VCD,
179 BLACKBIRD_STREAM_UNKNOWN12 /* svcd/xvcd ? */
180};
181#define BLACKBIRD_API_SET_OUTPUT_PORT 0xBB
182enum blackbird_stream_port {
183 BLACKBIRD_OUTPUT_PORT_MEMORY,
184 BLACKBIRD_OUTPUT_PORT_STREAMING,
185 BLACKBIRD_OUTPUT_PORT_SERIAL
186};
187#define BLACKBIRD_API_SET_AUDIO_PARAMS 0xBD
188enum blackbird_audio_bits_sample_rate {
189 BLACKBIRD_AUDIO_BITS_44100HZ,
190 BLACKBIRD_AUDIO_BITS_48000HZ,
191 BLACKBIRD_AUDIO_BITS_32000HZ,
192 BLACKBIRD_AUDIO_BITS_RESERVED_HZ,
193};
194enum blackbird_audio_bits_encoding {
195 BLACKBIRD_AUDIO_BITS_LAYER_1 = 0x1 << 2,
196 BLACKBIRD_AUDIO_BITS_LAYER_2 = 0x2 << 2,
197};
198enum blackbird_audio_bits_bitrate_layer_1 {
199 BLACKBIRD_AUDIO_BITS_LAYER_1_FREE_FORMAT,
200 BLACKBIRD_AUDIO_BITS_LAYER_1_32 = 0x01 << 4,
201 BLACKBIRD_AUDIO_BITS_LAYER_1_64 = 0x02 << 4,
202 BLACKBIRD_AUDIO_BITS_LAYER_1_96 = 0x03 << 4,
203 BLACKBIRD_AUDIO_BITS_LAYER_1_128 = 0x04 << 4,
204 BLACKBIRD_AUDIO_BITS_LAYER_1_160 = 0x05 << 4,
205 BLACKBIRD_AUDIO_BITS_LAYER_1_192 = 0x06 << 4,
206 BLACKBIRD_AUDIO_BITS_LAYER_1_224 = 0x07 << 4,
207 BLACKBIRD_AUDIO_BITS_LAYER_1_256 = 0x08 << 4,
208 BLACKBIRD_AUDIO_BITS_LAYER_1_288 = 0x09 << 4,
209 BLACKBIRD_AUDIO_BITS_LAYER_1_320 = 0x0A << 4,
210 BLACKBIRD_AUDIO_BITS_LAYER_1_352 = 0x0B << 4,
211 BLACKBIRD_AUDIO_BITS_LAYER_1_384 = 0x0C << 4,
212 BLACKBIRD_AUDIO_BITS_LAYER_1_416 = 0x0D << 4,
213 BLACKBIRD_AUDIO_BITS_LAYER_1_448 = 0x0E << 4,
214};
215enum blackbird_audio_bits_bitrate_layer_2 {
216 BLACKBIRD_AUDIO_BITS_LAYER_2_FREE_FORMAT,
217 BLACKBIRD_AUDIO_BITS_LAYER_2_32 = 0x01 << 4,
218 BLACKBIRD_AUDIO_BITS_LAYER_2_48 = 0x02 << 4,
219 BLACKBIRD_AUDIO_BITS_LAYER_2_56 = 0x03 << 4,
220 BLACKBIRD_AUDIO_BITS_LAYER_2_64 = 0x04 << 4,
221 BLACKBIRD_AUDIO_BITS_LAYER_2_80 = 0x05 << 4,
222 BLACKBIRD_AUDIO_BITS_LAYER_2_96 = 0x06 << 4,
223 BLACKBIRD_AUDIO_BITS_LAYER_2_112 = 0x07 << 4,
224 BLACKBIRD_AUDIO_BITS_LAYER_2_128 = 0x08 << 4,
225 BLACKBIRD_AUDIO_BITS_LAYER_2_160 = 0x09 << 4,
226 BLACKBIRD_AUDIO_BITS_LAYER_2_192 = 0x0A << 4,
227 BLACKBIRD_AUDIO_BITS_LAYER_2_224 = 0x0B << 4,
228 BLACKBIRD_AUDIO_BITS_LAYER_2_256 = 0x0C << 4,
229 BLACKBIRD_AUDIO_BITS_LAYER_2_320 = 0x0D << 4,
230 BLACKBIRD_AUDIO_BITS_LAYER_2_384 = 0x0E << 4,
231};
232enum blackbird_audio_bits_mode {
233 BLACKBIRD_AUDIO_BITS_STEREO,
234 BLACKBIRD_AUDIO_BITS_JOINT_STEREO = 0x1 << 8,
235 BLACKBIRD_AUDIO_BITS_DUAL = 0x2 << 8,
236 BLACKBIRD_AUDIO_BITS_MONO = 0x3 << 8,
237};
238enum blackbird_audio_bits_mode_extension {
239 BLACKBIRD_AUDIO_BITS_BOUND_4,
240 BLACKBIRD_AUDIO_BITS_BOUND_8 = 0x1 << 10,
241 BLACKBIRD_AUDIO_BITS_BOUND_12 = 0x2 << 10,
242 BLACKBIRD_AUDIO_BITS_BOUND_16 = 0x3 << 10,
243};
244enum blackbird_audio_bits_emphasis {
245 BLACKBIRD_AUDIO_BITS_EMPHASIS_NONE,
246 BLACKBIRD_AUDIO_BITS_EMPHASIS_50_15 = 0x1 << 12,
247 BLACKBIRD_AUDIO_BITS_EMPHASIS_RESERVED = 0x2 << 12,
248 BLACKBIRD_AUDIO_BITS_EMPHASIS_CCITT_J17 = 0x3 << 12,
249};
250enum blackbird_audio_bits_crc {
251 BLACKBIRD_AUDIO_BITS_CRC_OFF,
252 BLACKBIRD_AUDIO_BITS_CRC_ON = 0x1 << 14,
253};
254enum blackbird_audio_bits_copyright {
255 BLACKBIRD_AUDIO_BITS_COPYRIGHT_OFF,
256 BLACKBIRD_AUDIO_BITS_COPYRIGHT_ON = 0x1 << 15,
257};
258enum blackbird_audio_bits_original {
259 BLACKBIRD_AUDIO_BITS_COPY,
260 BLACKBIRD_AUDIO_BITS_ORIGINAL = 0x1 << 16,
261};
262#define BLACKBIRD_API_HALT 0xC3
263#define BLACKBIRD_API_GET_VERSION 0xC4
264#define BLACKBIRD_API_SET_GOP_CLOSURE 0xC5
265enum blackbird_gop_closure {
266 BLACKBIRD_GOP_CLOSURE_OFF,
267 BLACKBIRD_GOP_CLOSURE_ON,
268};
269#define BLACKBIRD_API_DATA_XFER_STATUS 0xC6
270enum blackbird_data_xfer_status {
271 BLACKBIRD_MORE_BUFFERS_FOLLOW,
272 BLACKBIRD_LAST_BUFFER,
273};
274#define BLACKBIRD_API_PROGRAM_INDEX_INFO 0xC7
275enum blackbird_picture_mask {
276 BLACKBIRD_PICTURE_MASK_NONE,
277 BLACKBIRD_PICTURE_MASK_I_FRAMES,
278 BLACKBIRD_PICTURE_MASK_I_P_FRAMES = 0x3,
279 BLACKBIRD_PICTURE_MASK_ALL_FRAMES = 0x7,
280};
281#define BLACKBIRD_API_SET_VBI_PARAMS 0xC8
282enum blackbird_vbi_mode_bits {
283 BLACKBIRD_VBI_BITS_SLICED,
284 BLACKBIRD_VBI_BITS_RAW,
285};
286enum blackbird_vbi_insertion_bits {
287 BLACKBIRD_VBI_BITS_INSERT_IN_XTENSION_USR_DATA,
288 BLACKBIRD_VBI_BITS_INSERT_IN_PRIVATE_PACKETS = 0x1 << 1,
289 BLACKBIRD_VBI_BITS_SEPARATE_STREAM = 0x2 << 1,
290 BLACKBIRD_VBI_BITS_SEPARATE_STREAM_USR_DATA = 0x4 << 1,
291 BLACKBIRD_VBI_BITS_SEPARATE_STREAM_PRV_DATA = 0x5 << 1,
292};
293#define BLACKBIRD_API_SET_DMA_BLOCK_SIZE 0xC9
294enum blackbird_dma_unit {
295 BLACKBIRD_DMA_BYTES,
296 BLACKBIRD_DMA_FRAMES,
297};
298#define BLACKBIRD_API_DMA_TRANSFER_INFO 0xCA
299#define BLACKBIRD_API_DMA_TRANSFER_STAT 0xCB
300enum blackbird_dma_transfer_status_bits {
301 BLACKBIRD_DMA_TRANSFER_BITS_DONE = 0x01,
302 BLACKBIRD_DMA_TRANSFER_BITS_ERROR = 0x04,
303 BLACKBIRD_DMA_TRANSFER_BITS_LL_ERROR = 0x10,
304};
305#define BLACKBIRD_API_SET_DMA2HOST_ADDR 0xCC
306#define BLACKBIRD_API_INIT_VIDEO_INPUT 0xCD
307#define BLACKBIRD_API_SET_FRAMESKIP 0xD0
308#define BLACKBIRD_API_PAUSE 0xD2
309enum blackbird_pause {
310 BLACKBIRD_PAUSE_ENCODING,
311 BLACKBIRD_RESUME_ENCODING,
312};
313#define BLACKBIRD_API_REFRESH_INPUT 0xD3
314#define BLACKBIRD_API_SET_COPYRIGHT 0xD4
315enum blackbird_copyright {
316 BLACKBIRD_COPYRIGHT_OFF,
317 BLACKBIRD_COPYRIGHT_ON,
318};
319#define BLACKBIRD_API_SET_NOTIFICATION 0xD5
320enum blackbird_notification_type {
321 BLACKBIRD_NOTIFICATION_REFRESH,
322};
323enum blackbird_notification_status {
324 BLACKBIRD_NOTIFICATION_OFF,
325 BLACKBIRD_NOTIFICATION_ON,
326};
327enum blackbird_notification_mailbox {
328 BLACKBIRD_NOTIFICATION_NO_MAILBOX = -1,
329};
330#define BLACKBIRD_API_SET_CAPTURE_LINES 0xD6
331enum blackbird_field1_lines {
332 BLACKBIRD_FIELD1_SAA7114 = 0x00EF, /* 239 */
333 BLACKBIRD_FIELD1_SAA7115 = 0x00F0, /* 240 */
334 BLACKBIRD_FIELD1_MICRONAS = 0x0105, /* 261 */
335};
336enum blackbird_field2_lines {
337 BLACKBIRD_FIELD2_SAA7114 = 0x00EF, /* 239 */
338 BLACKBIRD_FIELD2_SAA7115 = 0x00F0, /* 240 */
339 BLACKBIRD_FIELD2_MICRONAS = 0x0106, /* 262 */
340};
341#define BLACKBIRD_API_SET_CUSTOM_DATA 0xD7
342enum blackbird_custom_data_type {
343 BLACKBIRD_CUSTOM_EXTENSION_USR_DATA,
344 BLACKBIRD_CUSTOM_PRIVATE_PACKET,
345};
346#define BLACKBIRD_API_MUTE_VIDEO 0xD9
347enum blackbird_mute {
348 BLACKBIRD_UNMUTE,
349 BLACKBIRD_MUTE,
350};
351enum blackbird_mute_video_mask {
352 BLACKBIRD_MUTE_VIDEO_V_MASK = 0x0000FF00,
353 BLACKBIRD_MUTE_VIDEO_U_MASK = 0x00FF0000,
354 BLACKBIRD_MUTE_VIDEO_Y_MASK = 0xFF000000,
355};
356enum blackbird_mute_video_shift {
357 BLACKBIRD_MUTE_VIDEO_V_SHIFT = 8,
358 BLACKBIRD_MUTE_VIDEO_U_SHIFT = 16,
359 BLACKBIRD_MUTE_VIDEO_Y_SHIFT = 24,
360};
361#define BLACKBIRD_API_MUTE_AUDIO 0xDA
95 362
96/* Registers */ 363/* Registers */
97#define IVTV_REG_ENC_SDRAM_REFRESH (0x07F8 /*| IVTV_REG_OFFSET*/) 364#define IVTV_REG_ENC_SDRAM_REFRESH (0x07F8 /*| IVTV_REG_OFFSET*/)
@@ -405,68 +672,100 @@ static int blackbird_load_firmware(struct cx8802_dev *dev)
405 return 0; 672 return 0;
406} 673}
407 674
675/**
676 Settings used by the windows tv app for PVR2000:
677=================================================================================================================
678Profile | Codec | Resolution | CBR/VBR | Video Qlty | V. Bitrate | Frmrate | Audio Codec | A. Bitrate | A. Mode
679-----------------------------------------------------------------------------------------------------------------
680MPEG-1 | MPEG1 | 352x288PAL | (CBR) | 1000:Optimal | 2000 Kbps | 25fps | MPG1 Layer2 | 224kbps | Stereo
681MPEG-2 | MPEG2 | 720x576PAL | VBR | 600 :Good | 4000 Kbps | 25fps | MPG1 Layer2 | 224kbps | Stereo
682VCD | MPEG1 | 352x288PAL | (CBR) | 1000:Optimal | 1150 Kbps | 25fps | MPG1 Layer2 | 224kbps | Stereo
683DVD | MPEG2 | 720x576PAL | VBR | 600 :Good | 6000 Kbps | 25fps | MPG1 Layer2 | 224kbps | Stereo
684DB* DVD | MPEG2 | 720x576PAL | CBR | 600 :Good | 6000 Kbps | 25fps | MPG1 Layer2 | 224kbps | Stereo
685=================================================================================================================
686*DB: "DirectBurn"
687*/
408static void blackbird_codec_settings(struct cx8802_dev *dev) 688static void blackbird_codec_settings(struct cx8802_dev *dev)
409{ 689{
410 int bitrate_mode = 1; 690 int bitrate_mode = 1;
411 int bitrate = 7500000; 691 int bitrate = 7500000;
412 int bitrate_peak = 7500000; 692 int bitrate_peak = 7500000;
693#if 1
694 bitrate_mode = BLACKBIRD_VIDEO_CBR;
695 bitrate = 4000*1024;
696 bitrate_peak = 4000*1024;
697#endif
413 698
414 /* assign stream type */ 699 /* assign stream type */
415 blackbird_api_cmd(dev, IVTV_API_ASSIGN_STREAM_TYPE, 1, 0, 0); /* program stream */ 700 blackbird_api_cmd(dev, BLACKBIRD_API_SET_STREAM_TYPE, 1, 0, BLACKBIRD_STREAM_PROGRAM);
416 //blackbird_api_cmd(dev, IVTV_API_ASSIGN_STREAM_TYPE, 1, 0, 2); /* MPEG1 stream */ 701 /* blackbird_api_cmd(dev, BLACKBIRD_API_SET_STREAM_TYPE, 1, 0, BLACKBIRD_STREAM_TRANSPORT); */
417 //blackbird_api_cmd(dev, IVTV_API_ASSIGN_STREAM_TYPE, 1, 0, 3); /* PES A/V */
418 //blackbird_api_cmd(dev, IVTV_API_ASSIGN_STREAM_TYPE, 1, 0, 10); /* DVD stream */
419 702
420 /* assign output port */ 703 /* assign output port */
421 blackbird_api_cmd(dev, IVTV_API_ASSIGN_OUTPUT_PORT, 1, 0, 1); /* 1 = Host */ 704 blackbird_api_cmd(dev, BLACKBIRD_API_SET_OUTPUT_PORT, 1, 0, BLACKBIRD_OUTPUT_PORT_STREAMING); /* Host */
422 705
423 /* assign framerate */ 706 /* assign framerate */
424 blackbird_api_cmd(dev, IVTV_API_ASSIGN_FRAMERATE, 1, 0, 0); 707 blackbird_api_cmd(dev, BLACKBIRD_API_SET_FRAMERATE, 1, 0, BLACKBIRD_FRAMERATE_PAL_25);
425 708
426 /* assign frame size */ 709 /* assign frame size */
427 blackbird_api_cmd(dev, IVTV_API_ASSIGN_FRAME_SIZE, 2, 0, 710 blackbird_api_cmd(dev, BLACKBIRD_API_SET_RESOLUTION, 2, 0,
428 dev->height, dev->width); 711 dev->height, dev->width);
429 712
430 /* assign aspect ratio */ 713 /* assign aspect ratio */
431 blackbird_api_cmd(dev, IVTV_API_ASSIGN_ASPECT_RATIO, 1, 0, 2); 714 blackbird_api_cmd(dev, BLACKBIRD_API_SET_ASPECT_RATIO, 1, 0, BLACKBIRD_ASPECT_RATIO_4_3);
432 715
433 /* assign bitrates */ 716 /* assign bitrates */
434 blackbird_api_cmd(dev, IVTV_API_ASSIGN_BITRATES, 5, 0, 717 blackbird_api_cmd(dev, BLACKBIRD_API_SET_VIDEO_BITRATE, 5, 0,
435 bitrate_mode, /* mode */ 718 bitrate_mode, /* mode */
436 bitrate, /* bps */ 719 bitrate, /* bps */
437 bitrate_peak / 400, /* peak/400 */ 720 bitrate_peak / BLACKBIRD_PEAK_RATE_DIVISOR, /* peak/400 */
438 0, 0x70); /* encoding buffer, ckennedy */ 721 BLACKBIRD_MUX_RATE_DEFAULT /*, 0x70*/); /* encoding buffer, ckennedy */
439 722
440 /* assign gop properties */ 723 /* assign gop properties */
441 blackbird_api_cmd(dev, IVTV_API_ASSIGN_GOP_PROPERTIES, 2, 0, 15, 3); 724 blackbird_api_cmd(dev, BLACKBIRD_API_SET_GOP_STRUCTURE, 2, 0, 15, 3);
442 //blackbird_api_cmd(dev, IVTV_API_ASSIGN_GOP_PROPERTIES, 2, 0, 2, 1); 725
443 726 /* assign 3 2 pulldown */
444 /* assign 3 2 pulldown */ 727 blackbird_api_cmd(dev, BLACKBIRD_API_SET_3_2_PULLDOWN, 1, 0, BLACKBIRD_3_2_PULLDOWN_DISABLED);
445 blackbird_api_cmd(dev, IVTV_API_ASSIGN_3_2_PULLDOWN, 1, 0, 0); 728
446 729 /* assign audio properties */
447 /* note: it's not necessary to set the samplerate, the mpeg encoder seems to autodetect/adjust */ 730 /* note: it's not necessary to set the samplerate, the mpeg encoder seems to autodetect/adjust */
448 blackbird_api_cmd(dev, IVTV_API_ASSIGN_AUDIO_PROPERTIES, 1, 0, (2<<2) | (8<<4)); 731 /* blackbird_api_cmd(dev, IVTV_API_ASSIGN_AUDIO_PROPERTIES, 1, 0, (2<<2) | (8<<4));
732 blackbird_api_cmd(dev, IVTV_API_ASSIGN_AUDIO_PROPERTIES, 1, 0, 0 | (2 << 2) | (14 << 4)); */
733 blackbird_api_cmd(dev, BLACKBIRD_API_SET_AUDIO_PARAMS, 1, 0,
734 BLACKBIRD_AUDIO_BITS_44100HZ |
735 BLACKBIRD_AUDIO_BITS_LAYER_2 |
736 BLACKBIRD_AUDIO_BITS_LAYER_2_224 |
737 BLACKBIRD_AUDIO_BITS_STEREO |
738 /* BLACKBIRD_AUDIO_BITS_BOUND_4 | */
739 BLACKBIRD_AUDIO_BITS_EMPHASIS_NONE |
740 BLACKBIRD_AUDIO_BITS_CRC_OFF |
741 BLACKBIRD_AUDIO_BITS_COPYRIGHT_OFF |
742 BLACKBIRD_AUDIO_BITS_COPY
743 );
449 744
450 /* assign gop closure */ 745 /* assign gop closure */
451 blackbird_api_cmd(dev, IVTV_API_ASSIGN_GOP_CLOSURE, 1, 0, 0); 746 blackbird_api_cmd(dev, BLACKBIRD_API_SET_GOP_CLOSURE, 1, 0, BLACKBIRD_GOP_CLOSURE_OFF);
452 747
453 /* assign audio properties */
454 blackbird_api_cmd(dev, IVTV_API_ASSIGN_AUDIO_PROPERTIES, 1, 0, 0 | (2 << 2) | (14 << 4));
455 748
456 /* assign dnr filter mode */ 749 /* assign dnr filter mode */
457 blackbird_api_cmd(dev, IVTV_API_ASSIGN_DNR_FILTER_MODE, 2, 0, 0, 0); 750 blackbird_api_cmd(dev, BLACKBIRD_API_SET_DNR_MODE, 2, 0,
751 BLACKBIRD_DNR_BITS_MANUAL,
752 BLACKBIRD_MEDIAN_FILTER_DISABLED
753 );
458 754
459 /* assign dnr filter props*/ 755 /* assign dnr filter props*/
460 blackbird_api_cmd(dev, IVTV_API_ASSIGN_DNR_FILTER_PROPS, 2, 0, 0, 0); 756 blackbird_api_cmd(dev, BLACKBIRD_API_SET_MANUAL_DNR, 2, 0, 0, 0);
461 757
462 /* assign coring levels (luma_h, luma_l, chroma_h, chroma_l) */ 758 /* assign coring levels (luma_h, luma_l, chroma_h, chroma_l) */
463 blackbird_api_cmd(dev, IVTV_API_ASSIGN_CORING_LEVELS, 4, 0, 0, 255, 0, 255); 759 blackbird_api_cmd(dev, BLACKBIRD_API_SET_DNR_MEDIAN, 4, 0, 0, 255, 0, 255);
464 760
465 /* assign spatial filter type: luma_t: 1 = horiz_only, chroma_t: 1 = horiz_only */ 761 /* assign spatial filter type: luma_t: horiz_only, chroma_t: horiz_only */
466 blackbird_api_cmd(dev, IVTV_API_ASSIGN_SPATIAL_FILTER_TYPE, 2, 0, 1, 1); 762 blackbird_api_cmd(dev, BLACKBIRD_API_SET_SPATIAL_FILTER, 2, 0,
763 BLACKBIRD_SPATIAL_FILTER_LUMA_1D_HORIZ,
764 BLACKBIRD_SPATIAL_FILTER_CHROMA_1D_HORIZ
765 );
467 766
468 /* assign frame drop rate */ 767 /* assign frame drop rate */
469 blackbird_api_cmd(dev, IVTV_API_ASSIGN_FRAME_DROP_RATE, 1, 0, 0); 768 /* blackbird_api_cmd(dev, IVTV_API_ASSIGN_FRAME_DROP_RATE, 1, 0, 0); */
470} 769}
471 770
472static int blackbird_initialize_codec(struct cx8802_dev *dev) 771static int blackbird_initialize_codec(struct cx8802_dev *dev)
@@ -476,7 +775,7 @@ static int blackbird_initialize_codec(struct cx8802_dev *dev)
476 int retval; 775 int retval;
477 776
478 dprintk(1,"Initialize codec\n"); 777 dprintk(1,"Initialize codec\n");
479 retval = blackbird_api_cmd(dev, IVTV_API_ENC_PING_FW, 0, 0); /* ping */ 778 retval = blackbird_api_cmd(dev, BLACKBIRD_API_PING, 0, 0); /* ping */
480 if (retval < 0) { 779 if (retval < 0) {
481 /* ping was not successful, reset and upload firmware */ 780 /* ping was not successful, reset and upload firmware */
482 cx_write(MO_SRST_IO, 0); /* SYS_RSTO=0 */ 781 cx_write(MO_SRST_IO, 0); /* SYS_RSTO=0 */
@@ -491,13 +790,13 @@ static int blackbird_initialize_codec(struct cx8802_dev *dev)
491 if (dev->mailbox < 0) 790 if (dev->mailbox < 0)
492 return -1; 791 return -1;
493 792
494 retval = blackbird_api_cmd(dev, IVTV_API_ENC_PING_FW, 0, 0); /* ping */ 793 retval = blackbird_api_cmd(dev, BLACKBIRD_API_PING, 0, 0); /* ping */
495 if (retval < 0) { 794 if (retval < 0) {
496 dprintk(0, "ERROR: Firmware ping failed!\n"); 795 dprintk(0, "ERROR: Firmware ping failed!\n");
497 return -1; 796 return -1;
498 } 797 }
499 798
500 retval = blackbird_api_cmd(dev, IVTV_API_ENC_GETVER, 0, 1, &version); 799 retval = blackbird_api_cmd(dev, BLACKBIRD_API_GET_VERSION, 0, 1, &version);
501 if (retval < 0) { 800 if (retval < 0) {
502 dprintk(0, "ERROR: Firmware get encoder version failed!\n"); 801 dprintk(0, "ERROR: Firmware get encoder version failed!\n");
503 return -1; 802 return -1;
@@ -517,25 +816,36 @@ static int blackbird_initialize_codec(struct cx8802_dev *dev)
517 blackbird_codec_settings(dev); 816 blackbird_codec_settings(dev);
518 msleep(1); 817 msleep(1);
519 818
520 //blackbird_api_cmd(dev, IVTV_API_ASSIGN_NUM_VSYNC_LINES, 4, 0, 0xef, 0xef); 819 /* blackbird_api_cmd(dev, IVTV_API_ASSIGN_NUM_VSYNC_LINES, 4, 0, 0xef, 0xef);
521 blackbird_api_cmd(dev, IVTV_API_ASSIGN_NUM_VSYNC_LINES, 4, 0, 0xf0, 0xf0); 820 blackbird_api_cmd(dev, IVTV_API_ASSIGN_NUM_VSYNC_LINES, 4, 0, 0xf0, 0xf0);
522 //blackbird_api_cmd(dev, IVTV_API_ASSIGN_NUM_VSYNC_LINES, 4, 0, 0x180, 0x180); 821 blackbird_api_cmd(dev, IVTV_API_ASSIGN_NUM_VSYNC_LINES, 4, 0, 0x180, 0x180); */
523 blackbird_api_cmd(dev, IVTV_API_ASSIGN_PLACEHOLDER, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); 822 blackbird_api_cmd(dev, BLACKBIRD_API_SET_CAPTURE_LINES, 2, 0,
823 BLACKBIRD_FIELD1_SAA7115,
824 BLACKBIRD_FIELD1_SAA7115
825 );
826
827 /* blackbird_api_cmd(dev, IVTV_API_ASSIGN_PLACEHOLDER, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); */
828 blackbird_api_cmd(dev, BLACKBIRD_API_SET_CUSTOM_DATA, 12, 0,
829 BLACKBIRD_CUSTOM_EXTENSION_USR_DATA,
830 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
524 831
525 blackbird_api_cmd(dev, IVTV_API_INITIALIZE_INPUT, 0, 0); /* initialize the video input */ 832 blackbird_api_cmd(dev, BLACKBIRD_API_INIT_VIDEO_INPUT, 0, 0); /* initialize the video input */
526 833
527 msleep(1); 834 msleep(1);
528 835
529 blackbird_api_cmd(dev, IVTV_API_MUTE_VIDEO, 1, 0, 0); 836 blackbird_api_cmd(dev, BLACKBIRD_API_MUTE_VIDEO, 1, 0, BLACKBIRD_UNMUTE);
530 msleep(1); 837 msleep(1);
531 blackbird_api_cmd(dev, IVTV_API_MUTE_AUDIO, 1, 0, 0); 838 blackbird_api_cmd(dev, BLACKBIRD_API_MUTE_AUDIO, 1, 0, BLACKBIRD_UNMUTE);
532 msleep(1); 839 msleep(1);
533 840
534 blackbird_api_cmd(dev, IVTV_API_BEGIN_CAPTURE, 2, 0, 0, 0x13); /* start capturing to the host interface */ 841 /* blackbird_api_cmd(dev, BLACKBIRD_API_BEGIN_CAPTURE, 2, 0, 0, 0x13); // start capturing to the host interface */
535 //blackbird_api_cmd(dev, IVTV_API_BEGIN_CAPTURE, 2, 0, 0, 0); /* start capturing to the host interface */ 842 blackbird_api_cmd(dev, BLACKBIRD_API_BEGIN_CAPTURE, 2, 0,
536 msleep(1); 843 BLACKBIRD_MPEG_CAPTURE,
844 BLACKBIRD_RAW_BITS_NONE
845 ); /* start capturing to the host interface */
846 msleep(10);
537 847
538 blackbird_api_cmd(dev, IVTV_API_REFRESH_INPUT, 0,0); 848 blackbird_api_cmd(dev, BLACKBIRD_API_REFRESH_INPUT, 0,0);
539 return 0; 849 return 0;
540} 850}
541 851
@@ -709,7 +1019,12 @@ static int mpeg_release(struct inode *inode, struct file *file)
709{ 1019{
710 struct cx8802_fh *fh = file->private_data; 1020 struct cx8802_fh *fh = file->private_data;
711 1021
712 blackbird_api_cmd(fh->dev, IVTV_API_END_CAPTURE, 3, 0, 1, 0, 0x13); 1022 /* blackbird_api_cmd(fh->dev, BLACKBIRD_API_END_CAPTURE, 3, 0, BLACKBIRD_END_NOW, 0, 0x13); */
1023 blackbird_api_cmd(fh->dev, BLACKBIRD_API_END_CAPTURE, 3, 0,
1024 BLACKBIRD_END_NOW,
1025 BLACKBIRD_MPEG_CAPTURE,
1026 BLACKBIRD_RAW_BITS_NONE
1027 );
713 1028
714 /* stop mpeg capture */ 1029 /* stop mpeg capture */
715 if (fh->mpegq.streaming) 1030 if (fh->mpegq.streaming)
@@ -908,4 +1223,5 @@ module_exit(blackbird_fini);
908 * Local variables: 1223 * Local variables:
909 * c-basic-offset: 8 1224 * c-basic-offset: 8
910 * End: 1225 * End:
1226 * kate: eol "unix"; indent-width 3; remove-trailing-space on; replace-trailing-space-save on; tab-width 8; replace-tabs off; space-indent off; mixed-indent off
911 */ 1227 */
diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c
index a6763f1a44c1..b3fb04356b71 100644
--- a/drivers/media/video/cx88/cx88-cards.c
+++ b/drivers/media/video/cx88/cx88-cards.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * $Id: cx88-cards.c,v 1.66 2005/03/04 09:12:23 kraxel Exp $ 2 * $Id: cx88-cards.c,v 1.76 2005/06/08 01:28:09 mchehab Exp $
3 * 3 *
4 * device driver for Conexant 2388x based TV cards 4 * device driver for Conexant 2388x based TV cards
5 * card-specific stuff. 5 * card-specific stuff.
@@ -35,6 +35,9 @@ struct cx88_board cx88_boards[] = {
35 [CX88_BOARD_UNKNOWN] = { 35 [CX88_BOARD_UNKNOWN] = {
36 .name = "UNKNOWN/GENERIC", 36 .name = "UNKNOWN/GENERIC",
37 .tuner_type = UNSET, 37 .tuner_type = UNSET,
38 .radio_type = UNSET,
39 .tuner_addr = ADDR_UNSET,
40 .radio_addr = ADDR_UNSET,
38 .input = {{ 41 .input = {{
39 .type = CX88_VMUX_COMPOSITE1, 42 .type = CX88_VMUX_COMPOSITE1,
40 .vmux = 0, 43 .vmux = 0,
@@ -52,6 +55,9 @@ struct cx88_board cx88_boards[] = {
52 [CX88_BOARD_HAUPPAUGE] = { 55 [CX88_BOARD_HAUPPAUGE] = {
53 .name = "Hauppauge WinTV 34xxx models", 56 .name = "Hauppauge WinTV 34xxx models",
54 .tuner_type = UNSET, 57 .tuner_type = UNSET,
58 .radio_type = UNSET,
59 .tuner_addr = ADDR_UNSET,
60 .radio_addr = ADDR_UNSET,
55 .tda9887_conf = TDA9887_PRESENT, 61 .tda9887_conf = TDA9887_PRESENT,
56 .input = {{ 62 .input = {{
57 .type = CX88_VMUX_TELEVISION, 63 .type = CX88_VMUX_TELEVISION,
@@ -78,6 +84,9 @@ struct cx88_board cx88_boards[] = {
78 [CX88_BOARD_GDI] = { 84 [CX88_BOARD_GDI] = {
79 .name = "GDI Black Gold", 85 .name = "GDI Black Gold",
80 .tuner_type = UNSET, 86 .tuner_type = UNSET,
87 .radio_type = UNSET,
88 .tuner_addr = ADDR_UNSET,
89 .radio_addr = ADDR_UNSET,
81 .input = {{ 90 .input = {{
82 .type = CX88_VMUX_TELEVISION, 91 .type = CX88_VMUX_TELEVISION,
83 .vmux = 0, 92 .vmux = 0,
@@ -85,7 +94,10 @@ struct cx88_board cx88_boards[] = {
85 }, 94 },
86 [CX88_BOARD_PIXELVIEW] = { 95 [CX88_BOARD_PIXELVIEW] = {
87 .name = "PixelView", 96 .name = "PixelView",
88 .tuner_type = 5, 97 .tuner_type = TUNER_PHILIPS_PAL,
98 .radio_type = UNSET,
99 .tuner_addr = ADDR_UNSET,
100 .radio_addr = ADDR_UNSET,
89 .input = {{ 101 .input = {{
90 .type = CX88_VMUX_TELEVISION, 102 .type = CX88_VMUX_TELEVISION,
91 .vmux = 0, 103 .vmux = 0,
@@ -104,7 +116,10 @@ struct cx88_board cx88_boards[] = {
104 }, 116 },
105 [CX88_BOARD_ATI_WONDER_PRO] = { 117 [CX88_BOARD_ATI_WONDER_PRO] = {
106 .name = "ATI TV Wonder Pro", 118 .name = "ATI TV Wonder Pro",
107 .tuner_type = 44, 119 .tuner_type = TUNER_PHILIPS_4IN1,
120 .radio_type = UNSET,
121 .tuner_addr = ADDR_UNSET,
122 .radio_addr = ADDR_UNSET,
108 .tda9887_conf = TDA9887_PRESENT | TDA9887_INTERCARRIER, 123 .tda9887_conf = TDA9887_PRESENT | TDA9887_INTERCARRIER,
109 .input = {{ 124 .input = {{
110 .type = CX88_VMUX_TELEVISION, 125 .type = CX88_VMUX_TELEVISION,
@@ -122,7 +137,10 @@ struct cx88_board cx88_boards[] = {
122 }, 137 },
123 [CX88_BOARD_WINFAST2000XP_EXPERT] = { 138 [CX88_BOARD_WINFAST2000XP_EXPERT] = {
124 .name = "Leadtek Winfast 2000XP Expert", 139 .name = "Leadtek Winfast 2000XP Expert",
125 .tuner_type = 44, 140 .tuner_type = TUNER_PHILIPS_4IN1,
141 .radio_type = UNSET,
142 .tuner_addr = ADDR_UNSET,
143 .radio_addr = ADDR_UNSET,
126 .tda9887_conf = TDA9887_PRESENT, 144 .tda9887_conf = TDA9887_PRESENT,
127 .input = {{ 145 .input = {{
128 .type = CX88_VMUX_TELEVISION, 146 .type = CX88_VMUX_TELEVISION,
@@ -156,7 +174,10 @@ struct cx88_board cx88_boards[] = {
156 }, 174 },
157 [CX88_BOARD_AVERTV_303] = { 175 [CX88_BOARD_AVERTV_303] = {
158 .name = "AverTV Studio 303 (M126)", 176 .name = "AverTV Studio 303 (M126)",
159 .tuner_type = 38, 177 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
178 .radio_type = UNSET,
179 .tuner_addr = ADDR_UNSET,
180 .radio_addr = ADDR_UNSET,
160 .tda9887_conf = TDA9887_PRESENT, 181 .tda9887_conf = TDA9887_PRESENT,
161 .input = {{ 182 .input = {{
162 .type = CX88_VMUX_TELEVISION, 183 .type = CX88_VMUX_TELEVISION,
@@ -179,7 +200,10 @@ struct cx88_board cx88_boards[] = {
179 // added gpio values thanks to Michal 200 // added gpio values thanks to Michal
180 // values for PAL from DScaler 201 // values for PAL from DScaler
181 .name = "MSI TV-@nywhere Master", 202 .name = "MSI TV-@nywhere Master",
182 .tuner_type = 33, 203 .tuner_type = TUNER_MT2032,
204 .radio_type = UNSET,
205 .tuner_addr = ADDR_UNSET,
206 .radio_addr = ADDR_UNSET,
183 .tda9887_conf = TDA9887_PRESENT, 207 .tda9887_conf = TDA9887_PRESENT,
184 .input = {{ 208 .input = {{
185 .type = CX88_VMUX_TELEVISION, 209 .type = CX88_VMUX_TELEVISION,
@@ -206,7 +230,10 @@ struct cx88_board cx88_boards[] = {
206 }, 230 },
207 [CX88_BOARD_WINFAST_DV2000] = { 231 [CX88_BOARD_WINFAST_DV2000] = {
208 .name = "Leadtek Winfast DV2000", 232 .name = "Leadtek Winfast DV2000",
209 .tuner_type = 38, 233 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
234 .radio_type = UNSET,
235 .tuner_addr = ADDR_UNSET,
236 .radio_addr = ADDR_UNSET,
210 .tda9887_conf = TDA9887_PRESENT, 237 .tda9887_conf = TDA9887_PRESENT,
211 .input = {{ 238 .input = {{
212 .type = CX88_VMUX_TELEVISION, 239 .type = CX88_VMUX_TELEVISION,
@@ -239,34 +266,40 @@ struct cx88_board cx88_boards[] = {
239 .gpio3 = 0x02000000, 266 .gpio3 = 0x02000000,
240 }, 267 },
241 }, 268 },
242 [CX88_BOARD_LEADTEK_PVR2000] = { 269 [CX88_BOARD_LEADTEK_PVR2000] = {
243 // gpio values for PAL version from regspy by DScaler 270 // gpio values for PAL version from regspy by DScaler
244 .name = "Leadtek PVR 2000", 271 .name = "Leadtek PVR 2000",
245 .tuner_type = 38, 272 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
273 .radio_type = UNSET,
274 .tuner_addr = ADDR_UNSET,
275 .radio_addr = ADDR_UNSET,
246 .tda9887_conf = TDA9887_PRESENT, 276 .tda9887_conf = TDA9887_PRESENT,
247 .input = {{ 277 .input = {{
248 .type = CX88_VMUX_TELEVISION, 278 .type = CX88_VMUX_TELEVISION,
249 .vmux = 0, 279 .vmux = 0,
250 .gpio0 = 0x0000bde6, 280 .gpio0 = 0x0000bde2,
251 },{ 281 },{
252 .type = CX88_VMUX_COMPOSITE1, 282 .type = CX88_VMUX_COMPOSITE1,
253 .vmux = 1, 283 .vmux = 1,
254 .gpio0 = 0x0000bde6, 284 .gpio0 = 0x0000bde6,
255 },{ 285 },{
256 .type = CX88_VMUX_SVIDEO, 286 .type = CX88_VMUX_SVIDEO,
257 .vmux = 2, 287 .vmux = 2,
258 .gpio0 = 0x0000bde6, 288 .gpio0 = 0x0000bde6,
259 }}, 289 }},
260 .radio = { 290 .radio = {
261 .type = CX88_RADIO, 291 .type = CX88_RADIO,
262 .gpio0 = 0x0000bd62, 292 .gpio0 = 0x0000bd62,
263 }, 293 },
264 .blackbird = 1, 294 .blackbird = 1,
265 }, 295 },
266 [CX88_BOARD_IODATA_GVVCP3PCI] = { 296 [CX88_BOARD_IODATA_GVVCP3PCI] = {
267 .name = "IODATA GV-VCP3/PCI", 297 .name = "IODATA GV-VCP3/PCI",
268 .tuner_type = TUNER_ABSENT, 298 .tuner_type = TUNER_ABSENT,
269 .input = {{ 299 .radio_type = UNSET,
300 .tuner_addr = ADDR_UNSET,
301 .radio_addr = ADDR_UNSET,
302 .input = {{
270 .type = CX88_VMUX_COMPOSITE1, 303 .type = CX88_VMUX_COMPOSITE1,
271 .vmux = 0, 304 .vmux = 0,
272 },{ 305 },{
@@ -279,7 +312,10 @@ struct cx88_board cx88_boards[] = {
279 }, 312 },
280 [CX88_BOARD_PROLINK_PLAYTVPVR] = { 313 [CX88_BOARD_PROLINK_PLAYTVPVR] = {
281 .name = "Prolink PlayTV PVR", 314 .name = "Prolink PlayTV PVR",
282 .tuner_type = 43, 315 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
316 .radio_type = UNSET,
317 .tuner_addr = ADDR_UNSET,
318 .radio_addr = ADDR_UNSET,
283 .tda9887_conf = TDA9887_PRESENT, 319 .tda9887_conf = TDA9887_PRESENT,
284 .input = {{ 320 .input = {{
285 .type = CX88_VMUX_TELEVISION, 321 .type = CX88_VMUX_TELEVISION,
@@ -301,8 +337,11 @@ struct cx88_board cx88_boards[] = {
301 }, 337 },
302 [CX88_BOARD_ASUS_PVR_416] = { 338 [CX88_BOARD_ASUS_PVR_416] = {
303 .name = "ASUS PVR-416", 339 .name = "ASUS PVR-416",
304 .tuner_type = 43, 340 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
305 .tda9887_conf = TDA9887_PRESENT, 341 .radio_type = UNSET,
342 .tuner_addr = ADDR_UNSET,
343 .radio_addr = ADDR_UNSET,
344 .tda9887_conf = TDA9887_PRESENT,
306 .input = {{ 345 .input = {{
307 .type = CX88_VMUX_TELEVISION, 346 .type = CX88_VMUX_TELEVISION,
308 .vmux = 0, 347 .vmux = 0,
@@ -320,7 +359,10 @@ struct cx88_board cx88_boards[] = {
320 }, 359 },
321 [CX88_BOARD_MSI_TVANYWHERE] = { 360 [CX88_BOARD_MSI_TVANYWHERE] = {
322 .name = "MSI TV-@nywhere", 361 .name = "MSI TV-@nywhere",
323 .tuner_type = 33, 362 .tuner_type = TUNER_MT2032,
363 .radio_type = UNSET,
364 .tuner_addr = ADDR_UNSET,
365 .radio_addr = ADDR_UNSET,
324 .tda9887_conf = TDA9887_PRESENT, 366 .tda9887_conf = TDA9887_PRESENT,
325 .input = {{ 367 .input = {{
326 .type = CX88_VMUX_TELEVISION, 368 .type = CX88_VMUX_TELEVISION,
@@ -342,6 +384,9 @@ struct cx88_board cx88_boards[] = {
342 [CX88_BOARD_KWORLD_DVB_T] = { 384 [CX88_BOARD_KWORLD_DVB_T] = {
343 .name = "KWorld/VStream XPert DVB-T", 385 .name = "KWorld/VStream XPert DVB-T",
344 .tuner_type = TUNER_ABSENT, 386 .tuner_type = TUNER_ABSENT,
387 .radio_type = UNSET,
388 .tuner_addr = ADDR_UNSET,
389 .radio_addr = ADDR_UNSET,
345 .input = {{ 390 .input = {{
346 .type = CX88_VMUX_COMPOSITE1, 391 .type = CX88_VMUX_COMPOSITE1,
347 .vmux = 1, 392 .vmux = 1,
@@ -358,6 +403,9 @@ struct cx88_board cx88_boards[] = {
358 [CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1] = { 403 [CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1] = {
359 .name = "DVICO FusionHDTV DVB-T1", 404 .name = "DVICO FusionHDTV DVB-T1",
360 .tuner_type = TUNER_ABSENT, /* No analog tuner */ 405 .tuner_type = TUNER_ABSENT, /* No analog tuner */
406 .radio_type = UNSET,
407 .tuner_addr = ADDR_UNSET,
408 .radio_addr = ADDR_UNSET,
361 .input = {{ 409 .input = {{
362 .type = CX88_VMUX_COMPOSITE1, 410 .type = CX88_VMUX_COMPOSITE1,
363 .vmux = 1, 411 .vmux = 1,
@@ -371,7 +419,10 @@ struct cx88_board cx88_boards[] = {
371 }, 419 },
372 [CX88_BOARD_KWORLD_LTV883] = { 420 [CX88_BOARD_KWORLD_LTV883] = {
373 .name = "KWorld LTV883RF", 421 .name = "KWorld LTV883RF",
374 .tuner_type = 48, 422 .tuner_type = TUNER_TNF_8831BGFF,
423 .radio_type = UNSET,
424 .tuner_addr = ADDR_UNSET,
425 .radio_addr = ADDR_UNSET,
375 .input = {{ 426 .input = {{
376 .type = CX88_VMUX_TELEVISION, 427 .type = CX88_VMUX_TELEVISION,
377 .vmux = 0, 428 .vmux = 0,
@@ -397,6 +448,9 @@ struct cx88_board cx88_boards[] = {
397 [CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD] = { 448 [CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD] = {
398 .name = "DViCO - FusionHDTV 3 Gold", 449 .name = "DViCO - FusionHDTV 3 Gold",
399 .tuner_type = TUNER_MICROTUNE_4042FI5, 450 .tuner_type = TUNER_MICROTUNE_4042FI5,
451 .radio_type = UNSET,
452 .tuner_addr = ADDR_UNSET,
453 .radio_addr = ADDR_UNSET,
400 /* 454 /*
401 GPIO[0] resets DT3302 DTV receiver 455 GPIO[0] resets DT3302 DTV receiver
402 0 - reset asserted 456 0 - reset asserted
@@ -429,32 +483,13 @@ struct cx88_board cx88_boards[] = {
429 .gpio0 = 0x0f00, 483 .gpio0 = 0x0f00,
430 }}, 484 }},
431 }, 485 },
432 [CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T] = {
433 .name = "DViCO - FusionHDTV 3 Gold-T",
434 .tuner_type = 60, /* Thomson DDT 7611 ATSC/NTSC */
435 /* See DViCO FusionHDTV 3 Gold for GPIO documentation. */
436 .input = {{
437 .type = CX88_VMUX_TELEVISION,
438 .vmux = 0,
439 .gpio0 = 0x0f0d,
440 },{
441 .type = CX88_VMUX_CABLE,
442 .vmux = 0,
443 .gpio0 = 0x0f05,
444 },{
445 .type = CX88_VMUX_COMPOSITE1,
446 .vmux = 1,
447 .gpio0 = 0x0f00,
448 },{
449 .type = CX88_VMUX_SVIDEO,
450 .vmux = 2,
451 .gpio0 = 0x0f00,
452 }},
453 },
454 [CX88_BOARD_HAUPPAUGE_DVB_T1] = { 486 [CX88_BOARD_HAUPPAUGE_DVB_T1] = {
455 .name = "Hauppauge Nova-T DVB-T", 487 .name = "Hauppauge Nova-T DVB-T",
456 .tuner_type = TUNER_ABSENT, 488 .tuner_type = TUNER_ABSENT,
457 .input = {{ 489 .radio_type = UNSET,
490 .tuner_addr = ADDR_UNSET,
491 .radio_addr = ADDR_UNSET,
492 .input = {{
458 .type = CX88_VMUX_DVB, 493 .type = CX88_VMUX_DVB,
459 .vmux = 0, 494 .vmux = 0,
460 }}, 495 }},
@@ -463,6 +498,9 @@ struct cx88_board cx88_boards[] = {
463 [CX88_BOARD_CONEXANT_DVB_T1] = { 498 [CX88_BOARD_CONEXANT_DVB_T1] = {
464 .name = "Conexant DVB-T reference design", 499 .name = "Conexant DVB-T reference design",
465 .tuner_type = TUNER_ABSENT, 500 .tuner_type = TUNER_ABSENT,
501 .radio_type = UNSET,
502 .tuner_addr = ADDR_UNSET,
503 .radio_addr = ADDR_UNSET,
466 .input = {{ 504 .input = {{
467 .type = CX88_VMUX_DVB, 505 .type = CX88_VMUX_DVB,
468 .vmux = 0, 506 .vmux = 0,
@@ -472,6 +510,9 @@ struct cx88_board cx88_boards[] = {
472 [CX88_BOARD_PROVIDEO_PV259] = { 510 [CX88_BOARD_PROVIDEO_PV259] = {
473 .name = "Provideo PV259", 511 .name = "Provideo PV259",
474 .tuner_type = TUNER_PHILIPS_FQ1216ME, 512 .tuner_type = TUNER_PHILIPS_FQ1216ME,
513 .radio_type = UNSET,
514 .tuner_addr = ADDR_UNSET,
515 .radio_addr = ADDR_UNSET,
475 .input = {{ 516 .input = {{
476 .type = CX88_VMUX_TELEVISION, 517 .type = CX88_VMUX_TELEVISION,
477 .vmux = 0, 518 .vmux = 0,
@@ -481,6 +522,9 @@ struct cx88_board cx88_boards[] = {
481 [CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS] = { 522 [CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS] = {
482 .name = "DVICO FusionHDTV DVB-T Plus", 523 .name = "DVICO FusionHDTV DVB-T Plus",
483 .tuner_type = TUNER_ABSENT, /* No analog tuner */ 524 .tuner_type = TUNER_ABSENT, /* No analog tuner */
525 .radio_type = UNSET,
526 .tuner_addr = ADDR_UNSET,
527 .radio_addr = ADDR_UNSET,
484 .input = {{ 528 .input = {{
485 .type = CX88_VMUX_COMPOSITE1, 529 .type = CX88_VMUX_COMPOSITE1,
486 .vmux = 1, 530 .vmux = 1,
@@ -495,6 +539,9 @@ struct cx88_board cx88_boards[] = {
495 [CX88_BOARD_DNTV_LIVE_DVB_T] = { 539 [CX88_BOARD_DNTV_LIVE_DVB_T] = {
496 .name = "digitalnow DNTV Live! DVB-T", 540 .name = "digitalnow DNTV Live! DVB-T",
497 .tuner_type = TUNER_ABSENT, 541 .tuner_type = TUNER_ABSENT,
542 .radio_type = UNSET,
543 .tuner_addr = ADDR_UNSET,
544 .radio_addr = ADDR_UNSET,
498 .input = {{ 545 .input = {{
499 .type = CX88_VMUX_COMPOSITE1, 546 .type = CX88_VMUX_COMPOSITE1,
500 .vmux = 1, 547 .vmux = 1,
@@ -511,6 +558,9 @@ struct cx88_board cx88_boards[] = {
511 [CX88_BOARD_PCHDTV_HD3000] = { 558 [CX88_BOARD_PCHDTV_HD3000] = {
512 .name = "pcHDTV HD3000 HDTV", 559 .name = "pcHDTV HD3000 HDTV",
513 .tuner_type = TUNER_THOMSON_DTT7610, 560 .tuner_type = TUNER_THOMSON_DTT7610,
561 .radio_type = UNSET,
562 .tuner_addr = ADDR_UNSET,
563 .radio_addr = ADDR_UNSET,
514 .input = {{ 564 .input = {{
515 .type = CX88_VMUX_TELEVISION, 565 .type = CX88_VMUX_TELEVISION,
516 .vmux = 0, 566 .vmux = 0,
@@ -546,8 +596,11 @@ struct cx88_board cx88_boards[] = {
546 [CX88_BOARD_HAUPPAUGE_ROSLYN] = { 596 [CX88_BOARD_HAUPPAUGE_ROSLYN] = {
547 // entry added by Kaustubh D. Bhalerao <bhalerao.1@osu.edu> 597 // entry added by Kaustubh D. Bhalerao <bhalerao.1@osu.edu>
548 // GPIO values obtained from regspy, courtesy Sean Covel 598 // GPIO values obtained from regspy, courtesy Sean Covel
549 .name = "Hauppauge WinTV 28xxx (Roslyn) models", 599 .name = "Hauppauge WinTV 28xxx (Roslyn) models",
550 .tuner_type = UNSET, 600 .tuner_type = UNSET,
601 .radio_type = UNSET,
602 .tuner_addr = ADDR_UNSET,
603 .radio_addr = ADDR_UNSET,
551 .input = {{ 604 .input = {{
552 .type = CX88_VMUX_TELEVISION, 605 .type = CX88_VMUX_TELEVISION,
553 .vmux = 0, 606 .vmux = 0,
@@ -575,33 +628,37 @@ struct cx88_board cx88_boards[] = {
575 .blackbird = 1, 628 .blackbird = 1,
576 }, 629 },
577 [CX88_BOARD_DIGITALLOGIC_MEC] = { 630 [CX88_BOARD_DIGITALLOGIC_MEC] = {
578 /* params copied over from Leadtek PVR 2000 */
579 .name = "Digital-Logic MICROSPACE Entertainment Center (MEC)", 631 .name = "Digital-Logic MICROSPACE Entertainment Center (MEC)",
580 /* not sure yet about the tuner type */ 632 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
581 .tuner_type = 38, 633 .radio_type = UNSET,
634 .tuner_addr = ADDR_UNSET,
635 .radio_addr = ADDR_UNSET,
582 .tda9887_conf = TDA9887_PRESENT, 636 .tda9887_conf = TDA9887_PRESENT,
583 .input = {{ 637 .input = {{
584 .type = CX88_VMUX_TELEVISION, 638 .type = CX88_VMUX_TELEVISION,
585 .vmux = 0, 639 .vmux = 0,
586 .gpio0 = 0x0000bde6, 640 .gpio0 = 0x00009d80,
587 },{ 641 },{
588 .type = CX88_VMUX_COMPOSITE1, 642 .type = CX88_VMUX_COMPOSITE1,
589 .vmux = 1, 643 .vmux = 1,
590 .gpio0 = 0x0000bde6, 644 .gpio0 = 0x00009d76,
591 },{ 645 },{
592 .type = CX88_VMUX_SVIDEO, 646 .type = CX88_VMUX_SVIDEO,
593 .vmux = 2, 647 .vmux = 2,
594 .gpio0 = 0x0000bde6, 648 .gpio0 = 0x00009d76,
595 }}, 649 }},
596 .radio = { 650 .radio = {
597 .type = CX88_RADIO, 651 .type = CX88_RADIO,
598 .gpio0 = 0x0000bd62, 652 .gpio0 = 0x00009d00,
599 }, 653 },
600 .blackbird = 1, 654 .blackbird = 1,
601 }, 655 },
602 [CX88_BOARD_IODATA_GVBCTV7E] = { 656 [CX88_BOARD_IODATA_GVBCTV7E] = {
603 .name = "IODATA GV/BCTV7E", 657 .name = "IODATA GV/BCTV7E",
604 .tuner_type = TUNER_PHILIPS_FQ1286, 658 .tuner_type = TUNER_PHILIPS_FQ1286,
659 .radio_type = UNSET,
660 .tuner_addr = ADDR_UNSET,
661 .radio_addr = ADDR_UNSET,
605 .tda9887_conf = TDA9887_PRESENT, 662 .tda9887_conf = TDA9887_PRESENT,
606 .input = {{ 663 .input = {{
607 .type = CX88_VMUX_TELEVISION, 664 .type = CX88_VMUX_TELEVISION,
@@ -619,25 +676,54 @@ struct cx88_board cx88_boards[] = {
619 }, 676 },
620 [CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO] = { 677 [CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO] = {
621 .name = "PixelView PlayTV Ultra Pro (Stereo)", 678 .name = "PixelView PlayTV Ultra Pro (Stereo)",
622 .tuner_type = 38, 679 /* May be also TUNER_YMEC_TVF_5533MF for NTSC/M or PAL/M */
680 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
681 .radio_type = TUNER_TEA5767,
682 .tuner_addr = 0xc2>>1,
683 .radio_addr = 0xc0>>1,
623 .input = {{ 684 .input = {{
624 .type = CX88_VMUX_TELEVISION, 685 .type = CX88_VMUX_TELEVISION,
625 .vmux = 0, 686 .vmux = 0,
626 .gpio0 = 0xbf61, // internal decoder 687 .gpio0 = 0xbf61, /* internal decoder */
627 },{ 688 },{
628 .type = CX88_VMUX_COMPOSITE1, 689 .type = CX88_VMUX_COMPOSITE1,
629 .vmux = 1, 690 .vmux = 1,
630 .gpio0 = 0xbf63, 691 .gpio0 = 0xbf63,
631 },{ 692 },{
632 .type = CX88_VMUX_SVIDEO, 693 .type = CX88_VMUX_SVIDEO,
633 .vmux = 2, 694 .vmux = 2,
634 .gpio0 = 0xbf63, 695 .gpio0 = 0xbf63,
635 }}, 696 }},
636 .radio = { 697 .radio = {
637 .type = CX88_RADIO, 698 .type = CX88_RADIO,
638 .gpio0 = 0xbf60, 699 .gpio0 = 0xbf60,
639 }, 700 },
640 }, 701 },
702 [CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T] = {
703 .name = "DViCO - FusionHDTV 3 Gold-T",
704 .tuner_type = TUNER_THOMSON_DTT7611,
705 .radio_type = UNSET,
706 .tuner_addr = ADDR_UNSET,
707 .radio_addr = ADDR_UNSET,
708 /* See DViCO FusionHDTV 3 Gold for GPIO documentation. */
709 .input = {{
710 .type = CX88_VMUX_TELEVISION,
711 .vmux = 0,
712 .gpio0 = 0x0f0d,
713 },{
714 .type = CX88_VMUX_CABLE,
715 .vmux = 0,
716 .gpio0 = 0x0f05,
717 },{
718 .type = CX88_VMUX_COMPOSITE1,
719 .vmux = 1,
720 .gpio0 = 0x0f00,
721 },{
722 .type = CX88_VMUX_SVIDEO,
723 .vmux = 2,
724 .gpio0 = 0x0f00,
725 }},
726 },
641}; 727};
642const unsigned int cx88_bcount = ARRAY_SIZE(cx88_boards); 728const unsigned int cx88_bcount = ARRAY_SIZE(cx88_boards);
643 729
@@ -976,4 +1062,5 @@ EXPORT_SYMBOL(cx88_card_setup);
976 * Local variables: 1062 * Local variables:
977 * c-basic-offset: 8 1063 * c-basic-offset: 8
978 * End: 1064 * End:
1065 * kate: eol "unix"; indent-width 3; remove-trailing-space on; replace-trailing-space-save on; tab-width 8; replace-tabs off; space-indent off; mixed-indent off
979 */ 1066 */
diff --git a/drivers/media/video/cx88/cx88-core.c b/drivers/media/video/cx88/cx88-core.c
index 8c7f5589e92b..c046a23537d3 100644
--- a/drivers/media/video/cx88/cx88-core.c
+++ b/drivers/media/video/cx88/cx88-core.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * $Id: cx88-core.c,v 1.24 2005/01/19 12:01:55 kraxel Exp $ 2 * $Id: cx88-core.c,v 1.28 2005/06/12 04:19:19 mchehab Exp $
3 * 3 *
4 * device driver for Conexant 2388x based TV cards 4 * device driver for Conexant 2388x based TV cards
5 * driver core 5 * driver core
@@ -51,12 +51,15 @@ module_param(latency,int,0444);
51MODULE_PARM_DESC(latency,"pci latency timer"); 51MODULE_PARM_DESC(latency,"pci latency timer");
52 52
53static unsigned int tuner[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET }; 53static unsigned int tuner[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET };
54static unsigned int radio[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET };
54static unsigned int card[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET }; 55static unsigned int card[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET };
55 56
56module_param_array(tuner, int, NULL, 0444); 57module_param_array(tuner, int, NULL, 0444);
58module_param_array(radio, int, NULL, 0444);
57module_param_array(card, int, NULL, 0444); 59module_param_array(card, int, NULL, 0444);
58 60
59MODULE_PARM_DESC(tuner,"tuner type"); 61MODULE_PARM_DESC(tuner,"tuner type");
62MODULE_PARM_DESC(radio,"radio tuner type");
60MODULE_PARM_DESC(card,"card type"); 63MODULE_PARM_DESC(card,"card type");
61 64
62static unsigned int nicam = 0; 65static unsigned int nicam = 0;
@@ -429,7 +432,7 @@ int cx88_sram_channel_setup(struct cx88_core *core,
429/* ------------------------------------------------------------------ */ 432/* ------------------------------------------------------------------ */
430/* debug helper code */ 433/* debug helper code */
431 434
432static int cx88_risc_decode(u32 risc) 435int cx88_risc_decode(u32 risc)
433{ 436{
434 static char *instr[16] = { 437 static char *instr[16] = {
435 [ RISC_SYNC >> 28 ] = "sync", 438 [ RISC_SYNC >> 28 ] = "sync",
@@ -1173,8 +1176,20 @@ struct cx88_core* cx88_core_get(struct pci_dev *pci)
1173 "insmod option" : "autodetected"); 1176 "insmod option" : "autodetected");
1174 1177
1175 core->tuner_type = tuner[core->nr]; 1178 core->tuner_type = tuner[core->nr];
1179 core->radio_type = radio[core->nr];
1176 if (UNSET == core->tuner_type) 1180 if (UNSET == core->tuner_type)
1177 core->tuner_type = cx88_boards[core->board].tuner_type; 1181 core->tuner_type = cx88_boards[core->board].tuner_type;
1182 if (UNSET == core->radio_type)
1183 core->radio_type = cx88_boards[core->board].radio_type;
1184 if (!core->tuner_addr)
1185 core->tuner_addr = cx88_boards[core->board].tuner_addr;
1186 if (!core->radio_addr)
1187 core->radio_addr = cx88_boards[core->board].radio_addr;
1188
1189 printk(KERN_INFO "TV tuner %d at 0x%02x, Radio tuner %d at 0x%02x\n",
1190 core->tuner_type, core->tuner_addr<<1,
1191 core->radio_type, core->radio_addr<<1);
1192
1178 core->tda9887_conf = cx88_boards[core->board].tda9887_conf; 1193 core->tda9887_conf = cx88_boards[core->board].tda9887_conf;
1179 1194
1180 /* init hardware */ 1195 /* init hardware */
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c
index 9d15d3d5a2b7..1a259c3966cd 100644
--- a/drivers/media/video/cx88/cx88-dvb.c
+++ b/drivers/media/video/cx88/cx88-dvb.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * $Id: cx88-dvb.c,v 1.31 2005/03/07 15:58:05 kraxel Exp $ 2 * $Id: cx88-dvb.c,v 1.33 2005/06/12 04:19:19 mchehab Exp $
3 * 3 *
4 * device driver for Conexant 2388x based TV cards 4 * device driver for Conexant 2388x based TV cards
5 * MPEG Transport Stream (DVB) routines 5 * MPEG Transport Stream (DVB) routines
diff --git a/drivers/media/video/cx88/cx88-i2c.c b/drivers/media/video/cx88/cx88-i2c.c
index 0725b1288f4f..e20adefcfc6c 100644
--- a/drivers/media/video/cx88/cx88-i2c.c
+++ b/drivers/media/video/cx88/cx88-i2c.c
@@ -1,5 +1,5 @@
1/* 1/*
2 $Id: cx88-i2c.c,v 1.20 2005/02/15 15:59:35 kraxel Exp $ 2 $Id: cx88-i2c.c,v 1.23 2005/06/12 04:19:19 mchehab Exp $
3 3
4 cx88-i2c.c -- all the i2c code is here 4 cx88-i2c.c -- all the i2c code is here
5 5
@@ -91,6 +91,7 @@ static int cx8800_bit_getsda(void *data)
91 91
92static int attach_inform(struct i2c_client *client) 92static int attach_inform(struct i2c_client *client)
93{ 93{
94 struct tuner_addr tun_addr;
94 struct cx88_core *core = i2c_get_adapdata(client->adapter); 95 struct cx88_core *core = i2c_get_adapdata(client->adapter);
95 96
96 dprintk(1, "i2c attach [addr=0x%x,client=%s]\n", 97 dprintk(1, "i2c attach [addr=0x%x,client=%s]\n",
@@ -98,8 +99,19 @@ static int attach_inform(struct i2c_client *client)
98 if (!client->driver->command) 99 if (!client->driver->command)
99 return 0; 100 return 0;
100 101
101 if (core->tuner_type != UNSET) 102 if (core->radio_type != UNSET) {
102 client->driver->command(client, TUNER_SET_TYPE, &core->tuner_type); 103 tun_addr.v4l2_tuner = V4L2_TUNER_RADIO;
104 tun_addr.type = core->radio_type;
105 tun_addr.addr = core->radio_addr;
106 client->driver->command(client,TUNER_SET_TYPE_ADDR, &tun_addr);
107 }
108 if (core->tuner_type != UNSET) {
109 tun_addr.v4l2_tuner = V4L2_TUNER_ANALOG_TV;
110 tun_addr.type = core->tuner_type;
111 tun_addr.addr = core->tuner_addr;
112 client->driver->command(client,TUNER_SET_TYPE_ADDR, &tun_addr);
113 }
114
103 if (core->tda9887_conf) 115 if (core->tda9887_conf)
104 client->driver->command(client, TDA9887_SET_CONFIG, &core->tda9887_conf); 116 client->driver->command(client, TDA9887_SET_CONFIG, &core->tda9887_conf);
105 return 0; 117 return 0;
diff --git a/drivers/media/video/cx88/cx88-input.c b/drivers/media/video/cx88/cx88-input.c
index fbf21dbe2511..dc0dcf249aac 100644
--- a/drivers/media/video/cx88/cx88-input.c
+++ b/drivers/media/video/cx88/cx88-input.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * $Id: cx88-input.c,v 1.9 2005/03/04 09:12:23 kraxel Exp $ 2 * $Id: cx88-input.c,v 1.11 2005/05/22 20:57:56 nsh Exp $
3 * 3 *
4 * Device driver for GPIO attached remote control interfaces 4 * Device driver for GPIO attached remote control interfaces
5 * on Conexant 2388x based TV/DVB cards. 5 * on Conexant 2388x based TV/DVB cards.
@@ -235,6 +235,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
235 /* detect & configure */ 235 /* detect & configure */
236 switch (core->board) { 236 switch (core->board) {
237 case CX88_BOARD_DNTV_LIVE_DVB_T: 237 case CX88_BOARD_DNTV_LIVE_DVB_T:
238 case CX88_BOARD_KWORLD_DVB_T:
238 ir_codes = ir_codes_dntv_live_dvb_t; 239 ir_codes = ir_codes_dntv_live_dvb_t;
239 ir->gpio_addr = MO_GP1_IO; 240 ir->gpio_addr = MO_GP1_IO;
240 ir->mask_keycode = 0x1f; 241 ir->mask_keycode = 0x1f;
@@ -269,6 +270,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
269 ir->polling = 1; // ms 270 ir->polling = 1; // ms
270 break; 271 break;
271 } 272 }
273
272 if (NULL == ir_codes) { 274 if (NULL == ir_codes) {
273 kfree(ir); 275 kfree(ir);
274 return -ENODEV; 276 return -ENODEV;
diff --git a/drivers/media/video/cx88/cx88-mpeg.c b/drivers/media/video/cx88/cx88-mpeg.c
index 07aae1899e17..9ade2ae91e9b 100644
--- a/drivers/media/video/cx88/cx88-mpeg.c
+++ b/drivers/media/video/cx88/cx88-mpeg.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * $Id: cx88-mpeg.c,v 1.25 2005/03/07 14:18:00 kraxel Exp $ 2 * $Id: cx88-mpeg.c,v 1.26 2005/06/03 13:31:51 mchehab Exp $
3 * 3 *
4 * Support for the mpeg transport stream transfers 4 * Support for the mpeg transport stream transfers
5 * PCI function #2 of the cx2388x. 5 * PCI function #2 of the cx2388x.
@@ -55,7 +55,7 @@ static int cx8802_start_dma(struct cx8802_dev *dev,
55{ 55{
56 struct cx88_core *core = dev->core; 56 struct cx88_core *core = dev->core;
57 57
58 dprintk(1, "cx8802_start_mpegport_dma %d\n", buf->vb.width); 58 dprintk(0, "cx8802_start_dma %d\n", buf->vb.width);
59 59
60 /* setup fifo + format */ 60 /* setup fifo + format */
61 cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH28], 61 cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH28],
@@ -100,18 +100,21 @@ static int cx8802_start_dma(struct cx8802_dev *dev,
100 q->count = 1; 100 q->count = 1;
101 101
102 /* enable irqs */ 102 /* enable irqs */
103 dprintk( 0, "setting the interrupt mask\n" );
103 cx_set(MO_PCI_INTMSK, core->pci_irqmask | 0x04); 104 cx_set(MO_PCI_INTMSK, core->pci_irqmask | 0x04);
104 cx_write(MO_TS_INTMSK, 0x1f0011); 105 cx_set(MO_TS_INTMSK, 0x1f0011);
106 //cx_write(MO_TS_INTMSK, 0x0f0011);
105 107
106 /* start dma */ 108 /* start dma */
107 cx_write(MO_DEV_CNTRL2, (1<<5)); /* FIXME: s/write/set/ ??? */ 109 cx_set(MO_DEV_CNTRL2, (1<<5));
108 cx_write(MO_TS_DMACNTRL, 0x11); 110 cx_set(MO_TS_DMACNTRL, 0x11);
109 return 0; 111 return 0;
110} 112}
111 113
112static int cx8802_stop_dma(struct cx8802_dev *dev) 114static int cx8802_stop_dma(struct cx8802_dev *dev)
113{ 115{
114 struct cx88_core *core = dev->core; 116 struct cx88_core *core = dev->core;
117 dprintk( 0, "cx8802_stop_dma\n" );
115 118
116 /* stop dma */ 119 /* stop dma */
117 cx_clear(MO_TS_DMACNTRL, 0x11); 120 cx_clear(MO_TS_DMACNTRL, 0x11);
@@ -131,8 +134,12 @@ static int cx8802_restart_queue(struct cx8802_dev *dev,
131 struct cx88_buffer *buf; 134 struct cx88_buffer *buf;
132 struct list_head *item; 135 struct list_head *item;
133 136
137 dprintk( 0, "cx8802_restart_queue\n" );
134 if (list_empty(&q->active)) 138 if (list_empty(&q->active))
139 {
140 dprintk( 0, "cx8802_restart_queue: queue is empty\n" );
135 return 0; 141 return 0;
142 }
136 143
137 buf = list_entry(q->active.next, struct cx88_buffer, vb.queue); 144 buf = list_entry(q->active.next, struct cx88_buffer, vb.queue);
138 dprintk(2,"restart_queue [%p/%d]: restart dma\n", 145 dprintk(2,"restart_queue [%p/%d]: restart dma\n",
@@ -182,27 +189,32 @@ void cx8802_buf_queue(struct cx8802_dev *dev, struct cx88_buffer *buf)
182 struct cx88_buffer *prev; 189 struct cx88_buffer *prev;
183 struct cx88_dmaqueue *q = &dev->mpegq; 190 struct cx88_dmaqueue *q = &dev->mpegq;
184 191
192 dprintk( 1, "cx8802_buf_queue\n" );
185 /* add jump to stopper */ 193 /* add jump to stopper */
186 buf->risc.jmp[0] = cpu_to_le32(RISC_JUMP | RISC_IRQ1 | RISC_CNT_INC); 194 buf->risc.jmp[0] = cpu_to_le32(RISC_JUMP | RISC_IRQ1 | RISC_CNT_INC);
187 buf->risc.jmp[1] = cpu_to_le32(q->stopper.dma); 195 buf->risc.jmp[1] = cpu_to_le32(q->stopper.dma);
188 196
189 if (list_empty(&q->active)) { 197 if (list_empty(&q->active)) {
198 dprintk( 0, "queue is empty - first active\n" );
190 list_add_tail(&buf->vb.queue,&q->active); 199 list_add_tail(&buf->vb.queue,&q->active);
191 cx8802_start_dma(dev, q, buf); 200 cx8802_start_dma(dev, q, buf);
192 buf->vb.state = STATE_ACTIVE; 201 buf->vb.state = STATE_ACTIVE;
193 buf->count = q->count++; 202 buf->count = q->count++;
194 mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT); 203 mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT);
195 dprintk(2,"[%p/%d] %s - first active\n", 204 dprintk(0,"[%p/%d] %s - first active\n",
196 buf, buf->vb.i, __FUNCTION__); 205 buf, buf->vb.i, __FUNCTION__);
206 //udelay(100);
197 207
198 } else { 208 } else {
209 dprintk( 1, "queue is not empty - append to active\n" );
199 prev = list_entry(q->active.prev, struct cx88_buffer, vb.queue); 210 prev = list_entry(q->active.prev, struct cx88_buffer, vb.queue);
200 list_add_tail(&buf->vb.queue,&q->active); 211 list_add_tail(&buf->vb.queue,&q->active);
201 buf->vb.state = STATE_ACTIVE; 212 buf->vb.state = STATE_ACTIVE;
202 buf->count = q->count++; 213 buf->count = q->count++;
203 prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma); 214 prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma);
204 dprintk(2,"[%p/%d] %s - append to active\n", 215 dprintk( 1, "[%p/%d] %s - append to active\n",
205 buf, buf->vb.i, __FUNCTION__); 216 buf, buf->vb.i, __FUNCTION__);
217 //udelay(100);
206 } 218 }
207} 219}
208 220
@@ -224,7 +236,10 @@ static void do_cancel_buffers(struct cx8802_dev *dev, char *reason, int restart)
224 buf, buf->vb.i, reason, (unsigned long)buf->risc.dma); 236 buf, buf->vb.i, reason, (unsigned long)buf->risc.dma);
225 } 237 }
226 if (restart) 238 if (restart)
239 {
240 dprintk(0, "restarting queue\n" );
227 cx8802_restart_queue(dev,q); 241 cx8802_restart_queue(dev,q);
242 }
228 spin_unlock_irqrestore(&dev->slock,flags); 243 spin_unlock_irqrestore(&dev->slock,flags);
229} 244}
230 245
@@ -232,6 +247,7 @@ void cx8802_cancel_buffers(struct cx8802_dev *dev)
232{ 247{
233 struct cx88_dmaqueue *q = &dev->mpegq; 248 struct cx88_dmaqueue *q = &dev->mpegq;
234 249
250 dprintk( 1, "cx8802_cancel_buffers" );
235 del_timer_sync(&q->timeout); 251 del_timer_sync(&q->timeout);
236 cx8802_stop_dma(dev); 252 cx8802_stop_dma(dev);
237 do_cancel_buffers(dev,"cancel",0); 253 do_cancel_buffers(dev,"cancel",0);
@@ -241,7 +257,7 @@ static void cx8802_timeout(unsigned long data)
241{ 257{
242 struct cx8802_dev *dev = (struct cx8802_dev*)data; 258 struct cx8802_dev *dev = (struct cx8802_dev*)data;
243 259
244 dprintk(1, "%s\n",__FUNCTION__); 260 dprintk(0, "%s\n",__FUNCTION__);
245 261
246 if (debug) 262 if (debug)
247 cx88_sram_channel_dump(dev->core, &cx88_sram_channels[SRAM_CH28]); 263 cx88_sram_channel_dump(dev->core, &cx88_sram_channels[SRAM_CH28]);
@@ -254,12 +270,17 @@ static void cx8802_mpeg_irq(struct cx8802_dev *dev)
254 struct cx88_core *core = dev->core; 270 struct cx88_core *core = dev->core;
255 u32 status, mask, count; 271 u32 status, mask, count;
256 272
273 dprintk( 1, "cx8802_mpeg_irq\n" );
257 status = cx_read(MO_TS_INTSTAT); 274 status = cx_read(MO_TS_INTSTAT);
258 mask = cx_read(MO_TS_INTMSK); 275 mask = cx_read(MO_TS_INTMSK);
259 if (0 == (status & mask)) 276 if (0 == (status & mask))
260 return; 277 return;
261 278
262 cx_write(MO_TS_INTSTAT, status); 279 cx_write(MO_TS_INTSTAT, status);
280#if 0
281 cx88_print_irqbits(core->name, "irq mpeg ",
282 cx88_mpeg_irqs, status, mask);
283#endif
263 if (debug || (status & mask & ~0xff)) 284 if (debug || (status & mask & ~0xff))
264 cx88_print_irqbits(core->name, "irq mpeg ", 285 cx88_print_irqbits(core->name, "irq mpeg ",
265 cx88_mpeg_irqs, status, mask); 286 cx88_mpeg_irqs, status, mask);
@@ -273,6 +294,7 @@ static void cx8802_mpeg_irq(struct cx8802_dev *dev)
273 294
274 /* risc1 y */ 295 /* risc1 y */
275 if (status & 0x01) { 296 if (status & 0x01) {
297 dprintk( 1, "wake up\n" );
276 spin_lock(&dev->slock); 298 spin_lock(&dev->slock);
277 count = cx_read(MO_TS_GPCNT); 299 count = cx_read(MO_TS_GPCNT);
278 cx88_wakeup(dev->core, &dev->mpegq, count); 300 cx88_wakeup(dev->core, &dev->mpegq, count);
@@ -288,6 +310,7 @@ static void cx8802_mpeg_irq(struct cx8802_dev *dev)
288 310
289 /* other general errors */ 311 /* other general errors */
290 if (status & 0x1f0100) { 312 if (status & 0x1f0100) {
313 dprintk( 0, "general errors: 0x%08x\n", status & 0x1f0100 );
291 spin_lock(&dev->slock); 314 spin_lock(&dev->slock);
292 cx8802_stop_dma(dev); 315 cx8802_stop_dma(dev);
293 cx8802_restart_queue(dev,&dev->mpegq); 316 cx8802_restart_queue(dev,&dev->mpegq);
@@ -295,6 +318,8 @@ static void cx8802_mpeg_irq(struct cx8802_dev *dev)
295 } 318 }
296} 319}
297 320
321#define MAX_IRQ_LOOP 10
322
298static irqreturn_t cx8802_irq(int irq, void *dev_id, struct pt_regs *regs) 323static irqreturn_t cx8802_irq(int irq, void *dev_id, struct pt_regs *regs)
299{ 324{
300 struct cx8802_dev *dev = dev_id; 325 struct cx8802_dev *dev = dev_id;
@@ -302,10 +327,13 @@ static irqreturn_t cx8802_irq(int irq, void *dev_id, struct pt_regs *regs)
302 u32 status; 327 u32 status;
303 int loop, handled = 0; 328 int loop, handled = 0;
304 329
305 for (loop = 0; loop < 10; loop++) { 330 for (loop = 0; loop < MAX_IRQ_LOOP; loop++) {
306 status = cx_read(MO_PCI_INTSTAT) & (core->pci_irqmask | 0x04); 331 status = cx_read(MO_PCI_INTSTAT) & (core->pci_irqmask | 0x04);
307 if (0 == status) 332 if (0 == status)
308 goto out; 333 goto out;
334 dprintk( 1, "cx8802_irq\n" );
335 dprintk( 1, " loop: %d/%d\n", loop, MAX_IRQ_LOOP );
336 dprintk( 1, " status: %d\n", status );
309 handled = 1; 337 handled = 1;
310 cx_write(MO_PCI_INTSTAT, status); 338 cx_write(MO_PCI_INTSTAT, status);
311 339
@@ -314,7 +342,8 @@ static irqreturn_t cx8802_irq(int irq, void *dev_id, struct pt_regs *regs)
314 if (status & 0x04) 342 if (status & 0x04)
315 cx8802_mpeg_irq(dev); 343 cx8802_mpeg_irq(dev);
316 }; 344 };
317 if (10 == loop) { 345 if (MAX_IRQ_LOOP == loop) {
346 dprintk( 0, "clearing mask\n" );
318 printk(KERN_WARNING "%s/0: irq loop -- clearing mask\n", 347 printk(KERN_WARNING "%s/0: irq loop -- clearing mask\n",
319 core->name); 348 core->name);
320 cx_write(MO_PCI_INTMSK,0); 349 cx_write(MO_PCI_INTMSK,0);
@@ -378,6 +407,7 @@ int cx8802_init_common(struct cx8802_dev *dev)
378 407
379void cx8802_fini_common(struct cx8802_dev *dev) 408void cx8802_fini_common(struct cx8802_dev *dev)
380{ 409{
410 dprintk( 2, "cx8802_fini_common\n" );
381 cx8802_stop_dma(dev); 411 cx8802_stop_dma(dev);
382 pci_disable_device(dev->pci); 412 pci_disable_device(dev->pci);
383 413
@@ -399,6 +429,7 @@ int cx8802_suspend_common(struct pci_dev *pci_dev, pm_message_t state)
399 /* stop mpeg dma */ 429 /* stop mpeg dma */
400 spin_lock(&dev->slock); 430 spin_lock(&dev->slock);
401 if (!list_empty(&dev->mpegq.active)) { 431 if (!list_empty(&dev->mpegq.active)) {
432 dprintk( 2, "suspend\n" );
402 printk("%s: suspend mpeg\n", core->name); 433 printk("%s: suspend mpeg\n", core->name);
403 cx8802_stop_dma(dev); 434 cx8802_stop_dma(dev);
404 del_timer(&dev->mpegq.timeout); 435 del_timer(&dev->mpegq.timeout);
@@ -463,4 +494,5 @@ EXPORT_SYMBOL(cx8802_resume_common);
463 * Local variables: 494 * Local variables:
464 * c-basic-offset: 8 495 * c-basic-offset: 8
465 * End: 496 * End:
497 * kate: eol "unix"; indent-width 3; remove-trailing-space on; replace-trailing-space-save on; tab-width 8; replace-tabs off; space-indent off; mixed-indent off
466 */ 498 */
diff --git a/drivers/media/video/cx88/cx88-reg.h b/drivers/media/video/cx88/cx88-reg.h
index 8638ce57d84c..63ad33f5818b 100644
--- a/drivers/media/video/cx88/cx88-reg.h
+++ b/drivers/media/video/cx88/cx88-reg.h
@@ -1,5 +1,5 @@
1/* 1/*
2 $Id: cx88-reg.h,v 1.6 2004/10/13 10:39:00 kraxel Exp $ 2 $Id: cx88-reg.h,v 1.7 2005/06/03 13:31:51 mchehab Exp $
3 3
4 cx88x-hw.h - CX2388x register offsets 4 cx88x-hw.h - CX2388x register offsets
5 5
@@ -397,6 +397,7 @@
397#define AUD_RATE_ADJ4 0x3205e4 397#define AUD_RATE_ADJ4 0x3205e4
398#define AUD_RATE_ADJ5 0x3205e8 398#define AUD_RATE_ADJ5 0x3205e8
399#define AUD_APB_IN_RATE_ADJ 0x3205ec 399#define AUD_APB_IN_RATE_ADJ 0x3205ec
400#define AUD_I2SCNTL 0x3205ec
400#define AUD_PHASE_FIX_CTL 0x3205f0 401#define AUD_PHASE_FIX_CTL 0x3205f0
401#define AUD_PLL_PRESCALE 0x320600 402#define AUD_PLL_PRESCALE 0x320600
402#define AUD_PLL_DDS 0x320604 403#define AUD_PLL_DDS 0x320604
diff --git a/drivers/media/video/cx88/cx88-tvaudio.c b/drivers/media/video/cx88/cx88-tvaudio.c
index f2a9475a2fee..46d78b1dc9b2 100644
--- a/drivers/media/video/cx88/cx88-tvaudio.c
+++ b/drivers/media/video/cx88/cx88-tvaudio.c
@@ -1,5 +1,5 @@
1/* 1/*
2 $Id: cx88-tvaudio.c,v 1.34 2005/03/07 16:10:51 kraxel Exp $ 2 $Id: cx88-tvaudio.c,v 1.36 2005/06/05 05:53:45 mchehab Exp $
3 3
4 cx88x-audio.c - Conexant CX23880/23881 audio downstream driver driver 4 cx88x-audio.c - Conexant CX23880/23881 audio downstream driver driver
5 5
@@ -127,7 +127,8 @@ static void set_audio_start(struct cx88_core *core,
127 cx_write(AUD_VOL_CTL, (1 << 6)); 127 cx_write(AUD_VOL_CTL, (1 << 6));
128 128
129 // increase level of input by 12dB 129 // increase level of input by 12dB
130 cx_write(AUD_AFE_12DB_EN, 0x0001); 130// cx_write(AUD_AFE_12DB_EN, 0x0001);
131 cx_write(AUD_AFE_12DB_EN, 0x0000);
131 132
132 // start programming 133 // start programming
133 cx_write(AUD_CTL, 0x0000); 134 cx_write(AUD_CTL, 0x0000);
@@ -143,9 +144,15 @@ static void set_audio_finish(struct cx88_core *core)
143 u32 volume; 144 u32 volume;
144 145
145 if (cx88_boards[core->board].blackbird) { 146 if (cx88_boards[core->board].blackbird) {
147 // sets sound input from external adc
148 cx_set(AUD_CTL, EN_I2SIN_ENABLE);
149 //cx_write(AUD_I2SINPUTCNTL, 0);
150 cx_write(AUD_I2SINPUTCNTL, 4);
151 cx_write(AUD_BAUDRATE, 1);
146 // 'pass-thru mode': this enables the i2s output to the mpeg encoder 152 // 'pass-thru mode': this enables the i2s output to the mpeg encoder
147 cx_set(AUD_CTL, 0x2000); 153 cx_set(AUD_CTL, EN_I2SOUT_ENABLE);
148 cx_write(AUD_I2SOUTPUTCNTL, 1); 154 cx_write(AUD_I2SOUTPUTCNTL, 1);
155 cx_write(AUD_I2SCNTL, 0);
149 //cx_write(AUD_APB_IN_RATE_ADJ, 0); 156 //cx_write(AUD_APB_IN_RATE_ADJ, 0);
150 } 157 }
151 158
@@ -707,50 +714,65 @@ static void set_audio_standard_EIAJ(struct cx88_core *core)
707 set_audio_finish(core); 714 set_audio_finish(core);
708} 715}
709 716
710static void set_audio_standard_FM(struct cx88_core *core) 717static void set_audio_standard_FM(struct cx88_core *core, enum cx88_deemph_type deemph)
711{ 718{
712#if 0 /* FIXME */ 719 static const struct rlist fm_deemph_50[] = {
713 switch (dev->audio_properties.FM_deemphasis) 720 { AUD_DEEMPH0_G0, 0x0C45 },
714 { 721 { AUD_DEEMPH0_A0, 0x6262 },
715 case WW_FM_DEEMPH_50: 722 { AUD_DEEMPH0_B0, 0x1C29 },
716 //Set De-emphasis filter coefficients for 50 usec 723 { AUD_DEEMPH0_A1, 0x3FC66},
717 cx_write(AUD_DEEMPH0_G0, 0x0C45); 724 { AUD_DEEMPH0_B1, 0x399A },
718 cx_write(AUD_DEEMPH0_A0, 0x6262); 725
719 cx_write(AUD_DEEMPH0_B0, 0x1C29); 726 { AUD_DEEMPH1_G0, 0x0D80 },
720 cx_write(AUD_DEEMPH0_A1, 0x3FC66); 727 { AUD_DEEMPH1_A0, 0x6262 },
721 cx_write(AUD_DEEMPH0_B1, 0x399A); 728 { AUD_DEEMPH1_B0, 0x1C29 },
722 729 { AUD_DEEMPH1_A1, 0x3FC66},
723 cx_write(AUD_DEEMPH1_G0, 0x0D80); 730 { AUD_DEEMPH1_B1, 0x399A},
724 cx_write(AUD_DEEMPH1_A0, 0x6262); 731
725 cx_write(AUD_DEEMPH1_B0, 0x1C29); 732 { AUD_POLYPH80SCALEFAC, 0x0003},
726 cx_write(AUD_DEEMPH1_A1, 0x3FC66); 733 { /* end of list */ },
727 cx_write(AUD_DEEMPH1_B1, 0x399A); 734 };
735 static const struct rlist fm_deemph_75[] = {
736 { AUD_DEEMPH0_G0, 0x091B },
737 { AUD_DEEMPH0_A0, 0x6B68 },
738 { AUD_DEEMPH0_B0, 0x11EC },
739 { AUD_DEEMPH0_A1, 0x3FC66},
740 { AUD_DEEMPH0_B1, 0x399A },
741
742 { AUD_DEEMPH1_G0, 0x0AA0 },
743 { AUD_DEEMPH1_A0, 0x6B68 },
744 { AUD_DEEMPH1_B0, 0x11EC },
745 { AUD_DEEMPH1_A1, 0x3FC66},
746 { AUD_DEEMPH1_B1, 0x399A},
747
748 { AUD_POLYPH80SCALEFAC, 0x0003},
749 { /* end of list */ },
750 };
728 751
729 break; 752 /* It is enough to leave default values? */
753 static const struct rlist fm_no_deemph[] = {
730 754
731 case WW_FM_DEEMPH_75: 755 { AUD_POLYPH80SCALEFAC, 0x0003},
732 //Set De-emphasis filter coefficients for 75 usec 756 { /* end of list */ },
733 cx_write(AUD_DEEMPH0_G0, 0x91B ); 757 };
734 cx_write(AUD_DEEMPH0_A0, 0x6B68);
735 cx_write(AUD_DEEMPH0_B0, 0x11EC);
736 cx_write(AUD_DEEMPH0_A1, 0x3FC66);
737 cx_write(AUD_DEEMPH0_B1, 0x399A);
738 758
739 cx_write(AUD_DEEMPH1_G0, 0xAA0 ); 759 dprintk("%s (status: unknown)\n",__FUNCTION__);
740 cx_write(AUD_DEEMPH1_A0, 0x6B68); 760 set_audio_start(core, 0x0020, EN_FMRADIO_AUTO_STEREO);
741 cx_write(AUD_DEEMPH1_B0, 0x11EC);
742 cx_write(AUD_DEEMPH1_A1, 0x3FC66);
743 cx_write(AUD_DEEMPH1_B1, 0x399A);
744 761
762 switch (deemph)
763 {
764 case FM_NO_DEEMPH:
765 set_audio_registers(core, fm_no_deemph);
745 break; 766 break;
746 }
747#endif
748 767
749 dprintk("%s (status: unknown)\n",__FUNCTION__); 768 case FM_DEEMPH_50:
750 set_audio_start(core, 0x0020, EN_FMRADIO_AUTO_STEREO); 769 set_audio_registers(core, fm_deemph_50);
770 break;
751 771
752 // AB: 10/2/01: this register is not being reset appropriately on occasion. 772 case FM_DEEMPH_75:
753 cx_write(AUD_POLYPH80SCALEFAC,3); 773 set_audio_registers(core, fm_deemph_75);
774 break;
775 }
754 776
755 set_audio_finish(core); 777 set_audio_finish(core);
756} 778}
@@ -778,7 +800,7 @@ void cx88_set_tvaudio(struct cx88_core *core)
778 set_audio_standard_EIAJ(core); 800 set_audio_standard_EIAJ(core);
779 break; 801 break;
780 case WW_FM: 802 case WW_FM:
781 set_audio_standard_FM(core); 803 set_audio_standard_FM(core,FM_NO_DEEMPH);
782 break; 804 break;
783 case WW_SYSTEM_L_AM: 805 case WW_SYSTEM_L_AM:
784 set_audio_standard_NICAM_L(core, 1); 806 set_audio_standard_NICAM_L(core, 1);
@@ -1029,4 +1051,5 @@ EXPORT_SYMBOL(cx88_audio_thread);
1029 * Local variables: 1051 * Local variables:
1030 * c-basic-offset: 8 1052 * c-basic-offset: 8
1031 * End: 1053 * End:
1054 * kate: eol "unix"; indent-width 3; remove-trailing-space on; replace-trailing-space-save on; tab-width 8; replace-tabs off; space-indent off; mixed-indent off
1032 */ 1055 */
diff --git a/drivers/media/video/cx88/cx88-vbi.c b/drivers/media/video/cx88/cx88-vbi.c
index 0584ff476387..320d57888bbd 100644
--- a/drivers/media/video/cx88/cx88-vbi.c
+++ b/drivers/media/video/cx88/cx88-vbi.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * $Id: cx88-vbi.c,v 1.16 2004/12/10 12:33:39 kraxel Exp $ 2 * $Id: cx88-vbi.c,v 1.17 2005/06/12 04:19:19 mchehab Exp $
3 */ 3 */
4#include <linux/kernel.h> 4#include <linux/kernel.h>
5#include <linux/module.h> 5#include <linux/module.h>
@@ -47,8 +47,8 @@ void cx8800_vbi_fmt(struct cx8800_dev *dev, struct v4l2_format *f)
47} 47}
48 48
49static int cx8800_start_vbi_dma(struct cx8800_dev *dev, 49static int cx8800_start_vbi_dma(struct cx8800_dev *dev,
50 struct cx88_dmaqueue *q, 50 struct cx88_dmaqueue *q,
51 struct cx88_buffer *buf) 51 struct cx88_buffer *buf)
52{ 52{
53 struct cx88_core *core = dev->core; 53 struct cx88_core *core = dev->core;
54 54
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
index d1f5c92f0ce5..e4ca7350df15 100644
--- a/drivers/media/video/cx88/cx88-video.c
+++ b/drivers/media/video/cx88/cx88-video.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * $Id: cx88-video.c,v 1.58 2005/03/07 15:58:05 kraxel Exp $ 2 * $Id: cx88-video.c,v 1.63 2005/06/12 04:19:19 mchehab Exp $
3 * 3 *
4 * device driver for Conexant 2388x based TV cards 4 * device driver for Conexant 2388x based TV cards
5 * video4linux video interface 5 * video4linux video interface
@@ -1187,9 +1187,24 @@ static void init_controls(struct cx8800_dev *dev)
1187 .id = V4L2_CID_AUDIO_VOLUME, 1187 .id = V4L2_CID_AUDIO_VOLUME,
1188 .value = 0x3f, 1188 .value = 0x3f,
1189 }; 1189 };
1190 static struct v4l2_control hue = {
1191 .id = V4L2_CID_HUE,
1192 .value = 0x80,
1193 };
1194 static struct v4l2_control contrast = {
1195 .id = V4L2_CID_CONTRAST,
1196 .value = 0x80,
1197 };
1198 static struct v4l2_control brightness = {
1199 .id = V4L2_CID_BRIGHTNESS,
1200 .value = 0x80,
1201 };
1190 1202
1191 set_control(dev,&mute); 1203 set_control(dev,&mute);
1192 set_control(dev,&volume); 1204 set_control(dev,&volume);
1205 set_control(dev,&hue);
1206 set_control(dev,&contrast);
1207 set_control(dev,&brightness);
1193} 1208}
1194 1209
1195/* ------------------------------------------------------------------ */ 1210/* ------------------------------------------------------------------ */
@@ -1336,6 +1351,9 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
1336 V4L2_CAP_STREAMING | 1351 V4L2_CAP_STREAMING |
1337 V4L2_CAP_VBI_CAPTURE | 1352 V4L2_CAP_VBI_CAPTURE |
1338#if 0 1353#if 0
1354 V4L2_TUNER_CAP_LOW |
1355#endif
1356#if 0
1339 V4L2_CAP_VIDEO_OVERLAY | 1357 V4L2_CAP_VIDEO_OVERLAY |
1340#endif 1358#endif
1341 0; 1359 0;
@@ -1696,7 +1714,11 @@ static int radio_do_ioctl(struct inode *inode, struct file *file,
1696 sizeof(cap->card)); 1714 sizeof(cap->card));
1697 sprintf(cap->bus_info,"PCI:%s", pci_name(dev->pci)); 1715 sprintf(cap->bus_info,"PCI:%s", pci_name(dev->pci));
1698 cap->version = CX88_VERSION_CODE; 1716 cap->version = CX88_VERSION_CODE;
1699 cap->capabilities = V4L2_CAP_TUNER; 1717 cap->capabilities = V4L2_CAP_TUNER
1718#if 0
1719 | V4L2_TUNER_CAP_LOW
1720#endif
1721 ;
1700 return 0; 1722 return 0;
1701 } 1723 }
1702 case VIDIOC_G_TUNER: 1724 case VIDIOC_G_TUNER:
@@ -1992,6 +2014,7 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
1992{ 2014{
1993 struct cx8800_dev *dev; 2015 struct cx8800_dev *dev;
1994 struct cx88_core *core; 2016 struct cx88_core *core;
2017 struct tuner_addr tun_addr;
1995 int err; 2018 int err;
1996 2019
1997 dev = kmalloc(sizeof(*dev),GFP_KERNEL); 2020 dev = kmalloc(sizeof(*dev),GFP_KERNEL);
@@ -2065,8 +2088,19 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
2065 request_module("tuner"); 2088 request_module("tuner");
2066 if (core->tda9887_conf) 2089 if (core->tda9887_conf)
2067 request_module("tda9887"); 2090 request_module("tda9887");
2068 if (core->tuner_type != UNSET) 2091 if (core->radio_type != UNSET) {
2069 cx88_call_i2c_clients(dev->core,TUNER_SET_TYPE,&core->tuner_type); 2092 tun_addr.v4l2_tuner = V4L2_TUNER_RADIO;
2093 tun_addr.type = core->radio_type;
2094 tun_addr.addr = core->radio_addr;
2095 cx88_call_i2c_clients(dev->core,TUNER_SET_TYPE_ADDR, &tun_addr);
2096 }
2097 if (core->tuner_type != UNSET) {
2098 tun_addr.v4l2_tuner = V4L2_TUNER_ANALOG_TV;
2099 tun_addr.type = core->tuner_type;
2100 tun_addr.addr = core->tuner_addr;
2101 cx88_call_i2c_clients(dev->core,TUNER_SET_TYPE_ADDR, &tun_addr);
2102 }
2103
2070 if (core->tda9887_conf) 2104 if (core->tda9887_conf)
2071 cx88_call_i2c_clients(dev->core,TDA9887_SET_CONFIG,&core->tda9887_conf); 2105 cx88_call_i2c_clients(dev->core,TDA9887_SET_CONFIG,&core->tda9887_conf);
2072 2106
@@ -2162,7 +2196,7 @@ static void __devexit cx8800_finidev(struct pci_dev *pci_dev)
2162 2196
2163static int cx8800_suspend(struct pci_dev *pci_dev, pm_message_t state) 2197static int cx8800_suspend(struct pci_dev *pci_dev, pm_message_t state)
2164{ 2198{
2165 struct cx8800_dev *dev = pci_get_drvdata(pci_dev); 2199 struct cx8800_dev *dev = pci_get_drvdata(pci_dev);
2166 struct cx88_core *core = dev->core; 2200 struct cx88_core *core = dev->core;
2167 2201
2168 /* stop video+vbi capture */ 2202 /* stop video+vbi capture */
@@ -2194,7 +2228,7 @@ static int cx8800_suspend(struct pci_dev *pci_dev, pm_message_t state)
2194 2228
2195static int cx8800_resume(struct pci_dev *pci_dev) 2229static int cx8800_resume(struct pci_dev *pci_dev)
2196{ 2230{
2197 struct cx8800_dev *dev = pci_get_drvdata(pci_dev); 2231 struct cx8800_dev *dev = pci_get_drvdata(pci_dev);
2198 struct cx88_core *core = dev->core; 2232 struct cx88_core *core = dev->core;
2199 2233
2200 if (dev->state.disabled) { 2234 if (dev->state.disabled) {
@@ -2230,8 +2264,8 @@ static struct pci_device_id cx8800_pci_tbl[] = {
2230 { 2264 {
2231 .vendor = 0x14f1, 2265 .vendor = 0x14f1,
2232 .device = 0x8800, 2266 .device = 0x8800,
2233 .subvendor = PCI_ANY_ID, 2267 .subvendor = PCI_ANY_ID,
2234 .subdevice = PCI_ANY_ID, 2268 .subdevice = PCI_ANY_ID,
2235 },{ 2269 },{
2236 /* --- end of list --- */ 2270 /* --- end of list --- */
2237 } 2271 }
@@ -2239,10 +2273,10 @@ static struct pci_device_id cx8800_pci_tbl[] = {
2239MODULE_DEVICE_TABLE(pci, cx8800_pci_tbl); 2273MODULE_DEVICE_TABLE(pci, cx8800_pci_tbl);
2240 2274
2241static struct pci_driver cx8800_pci_driver = { 2275static struct pci_driver cx8800_pci_driver = {
2242 .name = "cx8800", 2276 .name = "cx8800",
2243 .id_table = cx8800_pci_tbl, 2277 .id_table = cx8800_pci_tbl,
2244 .probe = cx8800_initdev, 2278 .probe = cx8800_initdev,
2245 .remove = __devexit_p(cx8800_finidev), 2279 .remove = __devexit_p(cx8800_finidev),
2246 2280
2247 .suspend = cx8800_suspend, 2281 .suspend = cx8800_suspend,
2248 .resume = cx8800_resume, 2282 .resume = cx8800_resume,
@@ -2274,4 +2308,5 @@ module_exit(cx8800_fini);
2274 * Local variables: 2308 * Local variables:
2275 * c-basic-offset: 8 2309 * c-basic-offset: 8
2276 * End: 2310 * End:
2311 * kate: eol "unix"; indent-width 3; remove-trailing-space on; replace-trailing-space-save on; tab-width 8; replace-tabs off; space-indent off; mixed-indent off
2277 */ 2312 */
diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h
index 80ddf9911e2f..ac0dc27bb38f 100644
--- a/drivers/media/video/cx88/cx88.h
+++ b/drivers/media/video/cx88/cx88.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * $Id: cx88.h,v 1.56 2005/03/04 09:12:23 kraxel Exp $ 2 * $Id: cx88.h,v 1.62 2005/06/12 04:19:19 mchehab Exp $
3 * 3 *
4 * v4l2 device driver for cx2388x based TV cards 4 * v4l2 device driver for cx2388x based TV cards
5 * 5 *
@@ -64,6 +64,13 @@
64#define SHADOW_AUD_BAL_CTL 2 64#define SHADOW_AUD_BAL_CTL 2
65#define SHADOW_MAX 2 65#define SHADOW_MAX 2
66 66
67/* FM Radio deemphasis type */
68enum cx88_deemph_type {
69 FM_NO_DEEMPH = 0,
70 FM_DEEMPH_50,
71 FM_DEEMPH_75
72};
73
67/* ----------------------------------------------------------- */ 74/* ----------------------------------------------------------- */
68/* tv norms */ 75/* tv norms */
69 76
@@ -163,7 +170,7 @@ extern struct sram_channel cx88_sram_channels[];
163#define CX88_BOARD_DIGITALLOGIC_MEC 25 170#define CX88_BOARD_DIGITALLOGIC_MEC 25
164#define CX88_BOARD_IODATA_GVBCTV7E 26 171#define CX88_BOARD_IODATA_GVBCTV7E 26
165#define CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO 27 172#define CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO 27
166#define CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T 28 173#define CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T 28
167 174
168enum cx88_itype { 175enum cx88_itype {
169 CX88_VMUX_COMPOSITE1 = 1, 176 CX88_VMUX_COMPOSITE1 = 1,
@@ -187,6 +194,9 @@ struct cx88_input {
187struct cx88_board { 194struct cx88_board {
188 char *name; 195 char *name;
189 unsigned int tuner_type; 196 unsigned int tuner_type;
197 unsigned int radio_type;
198 unsigned char tuner_addr;
199 unsigned char radio_addr;
190 int tda9887_conf; 200 int tda9887_conf;
191 struct cx88_input input[8]; 201 struct cx88_input input[8];
192 struct cx88_input radio; 202 struct cx88_input radio;
@@ -257,6 +267,9 @@ struct cx88_core {
257 /* config info -- analog */ 267 /* config info -- analog */
258 unsigned int board; 268 unsigned int board;
259 unsigned int tuner_type; 269 unsigned int tuner_type;
270 unsigned int radio_type;
271 unsigned char tuner_addr;
272 unsigned char radio_addr;
260 unsigned int tda9887_conf; 273 unsigned int tda9887_conf;
261 unsigned int has_radio; 274 unsigned int has_radio;
262 275
@@ -422,6 +435,7 @@ struct cx8802_dev {
422/* ----------------------------------------------------------- */ 435/* ----------------------------------------------------------- */
423/* cx88-core.c */ 436/* cx88-core.c */
424 437
438extern char *cx88_pci_irqs[32];
425extern char *cx88_vid_irqs[32]; 439extern char *cx88_vid_irqs[32];
426extern char *cx88_mpeg_irqs[32]; 440extern char *cx88_mpeg_irqs[32];
427extern void cx88_print_irqbits(char *name, char *tag, char **strings, 441extern void cx88_print_irqbits(char *name, char *tag, char **strings,
@@ -473,6 +487,11 @@ extern void cx88_core_put(struct cx88_core *core,
473/* cx88-vbi.c */ 487/* cx88-vbi.c */
474 488
475void cx8800_vbi_fmt(struct cx8800_dev *dev, struct v4l2_format *f); 489void cx8800_vbi_fmt(struct cx8800_dev *dev, struct v4l2_format *f);
490/*
491int cx8800_start_vbi_dma(struct cx8800_dev *dev,
492 struct cx88_dmaqueue *q,
493 struct cx88_buffer *buf);
494*/
476int cx8800_stop_vbi_dma(struct cx8800_dev *dev); 495int cx8800_stop_vbi_dma(struct cx8800_dev *dev);
477int cx8800_restart_vbi_queue(struct cx8800_dev *dev, 496int cx8800_restart_vbi_queue(struct cx8800_dev *dev,
478 struct cx88_dmaqueue *q); 497 struct cx88_dmaqueue *q);
diff --git a/drivers/media/video/ir-kbd-gpio.c b/drivers/media/video/ir-kbd-gpio.c
index a9d4b2ad14e0..a565823330aa 100644
--- a/drivers/media/video/ir-kbd-gpio.c
+++ b/drivers/media/video/ir-kbd-gpio.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * $Id: ir-kbd-gpio.c,v 1.12 2005/02/22 12:28:40 kraxel Exp $ 2 * $Id: ir-kbd-gpio.c,v 1.13 2005/05/15 19:01:26 mchehab Exp $
3 * 3 *
4 * Copyright (c) 2003 Gerd Knorr 4 * Copyright (c) 2003 Gerd Knorr
5 * Copyright (c) 2003 Pavel Machek 5 * Copyright (c) 2003 Pavel Machek