[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>

authored by Mauro Carvalho Chehab and committed by Linus Torvalds b45009b0 2d03e289

+774 -232
+400 -84
drivers/media/video/cx88/cx88-blackbird.c
··· 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 4 * Support for a cx23416 mpeg encoder via cx2388x host port. 5 5 * "blackbird" reference design. ··· 61 61 62 62 #define IVTV_CMD_HW_BLOCKS_RST 0xFFFFFFFF 63 63 64 - /*Firmware API commands*/ 65 - #define IVTV_API_ENC_PING_FW 0x00000080 66 - #define IVTV_API_ENC_GETVER 0x000000C4 67 - #define IVTV_API_ENC_HALT_FW 0x000000C3 68 - #define IVTV_API_STD_TIMEOUT 0x00010000 /*units??*/ 69 - //#define IVTV_API_ASSIGN_PGM_INDEX_INFO 0x000000c7 70 - #define IVTV_API_ASSIGN_STREAM_TYPE 0x000000b9 71 - #define IVTV_API_ASSIGN_OUTPUT_PORT 0x000000bb 72 - #define IVTV_API_ASSIGN_FRAMERATE 0x0000008f 73 - #define IVTV_API_ASSIGN_FRAME_SIZE 0x00000091 74 - #define IVTV_API_ASSIGN_ASPECT_RATIO 0x00000099 75 - #define IVTV_API_ASSIGN_BITRATES 0x00000095 76 - #define IVTV_API_ASSIGN_GOP_PROPERTIES 0x00000097 77 - #define IVTV_API_ASSIGN_3_2_PULLDOWN 0x000000b1 78 - #define IVTV_API_ASSIGN_GOP_CLOSURE 0x000000c5 79 - #define IVTV_API_ASSIGN_AUDIO_PROPERTIES 0x000000bd 80 - #define IVTV_API_ASSIGN_DNR_FILTER_MODE 0x0000009b 81 - #define IVTV_API_ASSIGN_DNR_FILTER_PROPS 0x0000009d 82 - #define IVTV_API_ASSIGN_CORING_LEVELS 0x0000009f 83 - #define IVTV_API_ASSIGN_SPATIAL_FILTER_TYPE 0x000000a1 84 - #define IVTV_API_ASSIGN_FRAME_DROP_RATE 0x000000d0 85 - #define IVTV_API_ASSIGN_PLACEHOLDER 0x000000d8 86 - #define IVTV_API_MUTE_VIDEO 0x000000d9 87 - #define IVTV_API_MUTE_AUDIO 0x000000da 88 - #define IVTV_API_INITIALIZE_INPUT 0x000000cd 89 - #define IVTV_API_REFRESH_INPUT 0x000000d3 90 - #define IVTV_API_ASSIGN_NUM_VSYNC_LINES 0x000000d6 91 - #define IVTV_API_BEGIN_CAPTURE 0x00000081 92 - //#define IVTV_API_PAUSE_ENCODER 0x000000d2 93 - //#define IVTV_API_EVENT_NOTIFICATION 0x000000d5 94 - #define IVTV_API_END_CAPTURE 0x00000082 64 + /* Firmware API commands */ 65 + /* #define IVTV_API_STD_TIMEOUT 0x00010000 // 65536, units?? */ 66 + #define IVTV_API_STD_TIMEOUT 500 67 + 68 + #define BLACKBIRD_API_PING 0x80 69 + #define BLACKBIRD_API_BEGIN_CAPTURE 0x81 70 + enum blackbird_capture_type { 71 + BLACKBIRD_MPEG_CAPTURE, 72 + BLACKBIRD_RAW_CAPTURE, 73 + BLACKBIRD_RAW_PASSTHRU_CAPTURE 74 + }; 75 + enum blackbird_capture_bits { 76 + BLACKBIRD_RAW_BITS_NONE = 0x00, 77 + BLACKBIRD_RAW_BITS_YUV_CAPTURE = 0x01, 78 + BLACKBIRD_RAW_BITS_PCM_CAPTURE = 0x02, 79 + BLACKBIRD_RAW_BITS_VBI_CAPTURE = 0x04, 80 + BLACKBIRD_RAW_BITS_PASSTHRU_CAPTURE = 0x08, 81 + BLACKBIRD_RAW_BITS_TO_HOST_CAPTURE = 0x10 82 + }; 83 + #define BLACKBIRD_API_END_CAPTURE 0x82 84 + enum blackbird_capture_end { 85 + BLACKBIRD_END_AT_GOP, /* stop at the end of gop, generate irq */ 86 + BLACKBIRD_END_NOW, /* stop immediately, no irq */ 87 + }; 88 + #define BLACKBIRD_API_SET_AUDIO_ID 0x89 89 + #define BLACKBIRD_API_SET_VIDEO_ID 0x8B 90 + #define BLACKBIRD_API_SET_PCR_ID 0x8D 91 + #define BLACKBIRD_API_SET_FRAMERATE 0x8F 92 + enum blackbird_framerate { 93 + BLACKBIRD_FRAMERATE_NTSC_30, /* NTSC: 30fps */ 94 + BLACKBIRD_FRAMERATE_PAL_25 /* PAL: 25fps */ 95 + }; 96 + #define BLACKBIRD_API_SET_RESOLUTION 0x91 97 + #define BLACKBIRD_API_SET_VIDEO_BITRATE 0x95 98 + enum blackbird_video_bitrate_type { 99 + BLACKBIRD_VIDEO_VBR, 100 + BLACKBIRD_VIDEO_CBR 101 + }; 102 + #define BLACKBIRD_PEAK_RATE_DIVISOR 400 103 + enum 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 110 + enum 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 119 + enum 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 + }; 125 + enum 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 135 + enum 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 + }; 142 + enum 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 147 + enum blackbird_pulldown { 148 + BLACKBIRD_3_2_PULLDOWN_DISABLED, 149 + BLACKBIRD_3_2_PULLDOWN_ENABLED 150 + }; 151 + #define BLACKBIRD_API_SET_VBI_LINE_NO 0xB7 152 + enum 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 + }; 157 + enum blackbird_vbi_line { 158 + BLACKBIRD_VBI_LINE_DISABLED, 159 + BLACKBIRD_VBI_LINE_ENABLED 160 + }; 161 + enum blackbird_vbi_slicing { 162 + BLACKBIRD_VBI_SLICING_NONE, 163 + BLACKBIRD_VBI_SLICING_CLOSED_CAPTION 164 + }; 165 + #define BLACKBIRD_API_SET_STREAM_TYPE 0xB9 166 + enum 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 182 + enum 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 188 + enum 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 + }; 194 + enum blackbird_audio_bits_encoding { 195 + BLACKBIRD_AUDIO_BITS_LAYER_1 = 0x1 << 2, 196 + BLACKBIRD_AUDIO_BITS_LAYER_2 = 0x2 << 2, 197 + }; 198 + enum 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 + }; 215 + enum 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 + }; 232 + enum 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 + }; 238 + enum 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 + }; 244 + enum 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 + }; 250 + enum blackbird_audio_bits_crc { 251 + BLACKBIRD_AUDIO_BITS_CRC_OFF, 252 + BLACKBIRD_AUDIO_BITS_CRC_ON = 0x1 << 14, 253 + }; 254 + enum blackbird_audio_bits_copyright { 255 + BLACKBIRD_AUDIO_BITS_COPYRIGHT_OFF, 256 + BLACKBIRD_AUDIO_BITS_COPYRIGHT_ON = 0x1 << 15, 257 + }; 258 + enum 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 265 + enum blackbird_gop_closure { 266 + BLACKBIRD_GOP_CLOSURE_OFF, 267 + BLACKBIRD_GOP_CLOSURE_ON, 268 + }; 269 + #define BLACKBIRD_API_DATA_XFER_STATUS 0xC6 270 + enum blackbird_data_xfer_status { 271 + BLACKBIRD_MORE_BUFFERS_FOLLOW, 272 + BLACKBIRD_LAST_BUFFER, 273 + }; 274 + #define BLACKBIRD_API_PROGRAM_INDEX_INFO 0xC7 275 + enum 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 282 + enum blackbird_vbi_mode_bits { 283 + BLACKBIRD_VBI_BITS_SLICED, 284 + BLACKBIRD_VBI_BITS_RAW, 285 + }; 286 + enum 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 294 + enum 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 300 + enum 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 309 + enum 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 315 + enum blackbird_copyright { 316 + BLACKBIRD_COPYRIGHT_OFF, 317 + BLACKBIRD_COPYRIGHT_ON, 318 + }; 319 + #define BLACKBIRD_API_SET_NOTIFICATION 0xD5 320 + enum blackbird_notification_type { 321 + BLACKBIRD_NOTIFICATION_REFRESH, 322 + }; 323 + enum blackbird_notification_status { 324 + BLACKBIRD_NOTIFICATION_OFF, 325 + BLACKBIRD_NOTIFICATION_ON, 326 + }; 327 + enum blackbird_notification_mailbox { 328 + BLACKBIRD_NOTIFICATION_NO_MAILBOX = -1, 329 + }; 330 + #define BLACKBIRD_API_SET_CAPTURE_LINES 0xD6 331 + enum blackbird_field1_lines { 332 + BLACKBIRD_FIELD1_SAA7114 = 0x00EF, /* 239 */ 333 + BLACKBIRD_FIELD1_SAA7115 = 0x00F0, /* 240 */ 334 + BLACKBIRD_FIELD1_MICRONAS = 0x0105, /* 261 */ 335 + }; 336 + enum 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 342 + enum blackbird_custom_data_type { 343 + BLACKBIRD_CUSTOM_EXTENSION_USR_DATA, 344 + BLACKBIRD_CUSTOM_PRIVATE_PACKET, 345 + }; 346 + #define BLACKBIRD_API_MUTE_VIDEO 0xD9 347 + enum blackbird_mute { 348 + BLACKBIRD_UNMUTE, 349 + BLACKBIRD_MUTE, 350 + }; 351 + enum 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 + }; 356 + enum 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 363 /* Registers */ 97 364 #define IVTV_REG_ENC_SDRAM_REFRESH (0x07F8 /*| IVTV_REG_OFFSET*/) ··· 672 405 return 0; 673 406 } 674 407 408 + /** 409 + Settings used by the windows tv app for PVR2000: 410 + ================================================================================================================= 411 + Profile | Codec | Resolution | CBR/VBR | Video Qlty | V. Bitrate | Frmrate | Audio Codec | A. Bitrate | A. Mode 412 + ----------------------------------------------------------------------------------------------------------------- 413 + MPEG-1 | MPEG1 | 352x288PAL | (CBR) | 1000:Optimal | 2000 Kbps | 25fps | MPG1 Layer2 | 224kbps | Stereo 414 + MPEG-2 | MPEG2 | 720x576PAL | VBR | 600 :Good | 4000 Kbps | 25fps | MPG1 Layer2 | 224kbps | Stereo 415 + VCD | MPEG1 | 352x288PAL | (CBR) | 1000:Optimal | 1150 Kbps | 25fps | MPG1 Layer2 | 224kbps | Stereo 416 + DVD | MPEG2 | 720x576PAL | VBR | 600 :Good | 6000 Kbps | 25fps | MPG1 Layer2 | 224kbps | Stereo 417 + DB* DVD | MPEG2 | 720x576PAL | CBR | 600 :Good | 6000 Kbps | 25fps | MPG1 Layer2 | 224kbps | Stereo 418 + ================================================================================================================= 419 + *DB: "DirectBurn" 420 + */ 675 421 static void blackbird_codec_settings(struct cx8802_dev *dev) 676 422 { 677 423 int bitrate_mode = 1; 678 424 int bitrate = 7500000; 679 425 int bitrate_peak = 7500000; 426 + #if 1 427 + bitrate_mode = BLACKBIRD_VIDEO_CBR; 428 + bitrate = 4000*1024; 429 + bitrate_peak = 4000*1024; 430 + #endif 680 431 681 432 /* assign stream type */ 682 - blackbird_api_cmd(dev, IVTV_API_ASSIGN_STREAM_TYPE, 1, 0, 0); /* program stream */ 683 - //blackbird_api_cmd(dev, IVTV_API_ASSIGN_STREAM_TYPE, 1, 0, 2); /* MPEG1 stream */ 684 - //blackbird_api_cmd(dev, IVTV_API_ASSIGN_STREAM_TYPE, 1, 0, 3); /* PES A/V */ 685 - //blackbird_api_cmd(dev, IVTV_API_ASSIGN_STREAM_TYPE, 1, 0, 10); /* DVD stream */ 433 + blackbird_api_cmd(dev, BLACKBIRD_API_SET_STREAM_TYPE, 1, 0, BLACKBIRD_STREAM_PROGRAM); 434 + /* blackbird_api_cmd(dev, BLACKBIRD_API_SET_STREAM_TYPE, 1, 0, BLACKBIRD_STREAM_TRANSPORT); */ 686 435 687 - /* assign output port */ 688 - blackbird_api_cmd(dev, IVTV_API_ASSIGN_OUTPUT_PORT, 1, 0, 1); /* 1 = Host */ 436 + /* assign output port */ 437 + blackbird_api_cmd(dev, BLACKBIRD_API_SET_OUTPUT_PORT, 1, 0, BLACKBIRD_OUTPUT_PORT_STREAMING); /* Host */ 689 438 690 - /* assign framerate */ 691 - blackbird_api_cmd(dev, IVTV_API_ASSIGN_FRAMERATE, 1, 0, 0); 439 + /* assign framerate */ 440 + blackbird_api_cmd(dev, BLACKBIRD_API_SET_FRAMERATE, 1, 0, BLACKBIRD_FRAMERATE_PAL_25); 692 441 693 - /* assign frame size */ 694 - blackbird_api_cmd(dev, IVTV_API_ASSIGN_FRAME_SIZE, 2, 0, 442 + /* assign frame size */ 443 + blackbird_api_cmd(dev, BLACKBIRD_API_SET_RESOLUTION, 2, 0, 695 444 dev->height, dev->width); 696 445 697 - /* assign aspect ratio */ 698 - blackbird_api_cmd(dev, IVTV_API_ASSIGN_ASPECT_RATIO, 1, 0, 2); 446 + /* assign aspect ratio */ 447 + blackbird_api_cmd(dev, BLACKBIRD_API_SET_ASPECT_RATIO, 1, 0, BLACKBIRD_ASPECT_RATIO_4_3); 699 448 700 - /* assign bitrates */ 701 - blackbird_api_cmd(dev, IVTV_API_ASSIGN_BITRATES, 5, 0, 449 + /* assign bitrates */ 450 + blackbird_api_cmd(dev, BLACKBIRD_API_SET_VIDEO_BITRATE, 5, 0, 702 451 bitrate_mode, /* mode */ 703 452 bitrate, /* bps */ 704 - bitrate_peak / 400, /* peak/400 */ 705 - 0, 0x70); /* encoding buffer, ckennedy */ 453 + bitrate_peak / BLACKBIRD_PEAK_RATE_DIVISOR, /* peak/400 */ 454 + BLACKBIRD_MUX_RATE_DEFAULT /*, 0x70*/); /* encoding buffer, ckennedy */ 706 455 707 - /* assign gop properties */ 708 - blackbird_api_cmd(dev, IVTV_API_ASSIGN_GOP_PROPERTIES, 2, 0, 15, 3); 709 - //blackbird_api_cmd(dev, IVTV_API_ASSIGN_GOP_PROPERTIES, 2, 0, 2, 1); 456 + /* assign gop properties */ 457 + blackbird_api_cmd(dev, BLACKBIRD_API_SET_GOP_STRUCTURE, 2, 0, 15, 3); 710 458 711 - /* assign 3 2 pulldown */ 712 - blackbird_api_cmd(dev, IVTV_API_ASSIGN_3_2_PULLDOWN, 1, 0, 0); 459 + /* assign 3 2 pulldown */ 460 + blackbird_api_cmd(dev, BLACKBIRD_API_SET_3_2_PULLDOWN, 1, 0, BLACKBIRD_3_2_PULLDOWN_DISABLED); 713 461 714 - /* note: it's not necessary to set the samplerate, the mpeg encoder seems to autodetect/adjust */ 715 - blackbird_api_cmd(dev, IVTV_API_ASSIGN_AUDIO_PROPERTIES, 1, 0, (2<<2) | (8<<4)); 462 + /* assign audio properties */ 463 + /* note: it's not necessary to set the samplerate, the mpeg encoder seems to autodetect/adjust */ 464 + /* blackbird_api_cmd(dev, IVTV_API_ASSIGN_AUDIO_PROPERTIES, 1, 0, (2<<2) | (8<<4)); 465 + blackbird_api_cmd(dev, IVTV_API_ASSIGN_AUDIO_PROPERTIES, 1, 0, 0 | (2 << 2) | (14 << 4)); */ 466 + blackbird_api_cmd(dev, BLACKBIRD_API_SET_AUDIO_PARAMS, 1, 0, 467 + BLACKBIRD_AUDIO_BITS_44100HZ | 468 + BLACKBIRD_AUDIO_BITS_LAYER_2 | 469 + BLACKBIRD_AUDIO_BITS_LAYER_2_224 | 470 + BLACKBIRD_AUDIO_BITS_STEREO | 471 + /* BLACKBIRD_AUDIO_BITS_BOUND_4 | */ 472 + BLACKBIRD_AUDIO_BITS_EMPHASIS_NONE | 473 + BLACKBIRD_AUDIO_BITS_CRC_OFF | 474 + BLACKBIRD_AUDIO_BITS_COPYRIGHT_OFF | 475 + BLACKBIRD_AUDIO_BITS_COPY 476 + ); 716 477 717 478 /* assign gop closure */ 718 - blackbird_api_cmd(dev, IVTV_API_ASSIGN_GOP_CLOSURE, 1, 0, 0); 479 + blackbird_api_cmd(dev, BLACKBIRD_API_SET_GOP_CLOSURE, 1, 0, BLACKBIRD_GOP_CLOSURE_OFF); 719 480 720 - /* assign audio properties */ 721 - blackbird_api_cmd(dev, IVTV_API_ASSIGN_AUDIO_PROPERTIES, 1, 0, 0 | (2 << 2) | (14 << 4)); 722 481 723 - /* assign dnr filter mode */ 724 - blackbird_api_cmd(dev, IVTV_API_ASSIGN_DNR_FILTER_MODE, 2, 0, 0, 0); 482 + /* assign dnr filter mode */ 483 + blackbird_api_cmd(dev, BLACKBIRD_API_SET_DNR_MODE, 2, 0, 484 + BLACKBIRD_DNR_BITS_MANUAL, 485 + BLACKBIRD_MEDIAN_FILTER_DISABLED 486 + ); 725 487 726 - /* assign dnr filter props*/ 727 - blackbird_api_cmd(dev, IVTV_API_ASSIGN_DNR_FILTER_PROPS, 2, 0, 0, 0); 488 + /* assign dnr filter props*/ 489 + blackbird_api_cmd(dev, BLACKBIRD_API_SET_MANUAL_DNR, 2, 0, 0, 0); 728 490 729 - /* assign coring levels (luma_h, luma_l, chroma_h, chroma_l) */ 730 - blackbird_api_cmd(dev, IVTV_API_ASSIGN_CORING_LEVELS, 4, 0, 0, 255, 0, 255); 491 + /* assign coring levels (luma_h, luma_l, chroma_h, chroma_l) */ 492 + blackbird_api_cmd(dev, BLACKBIRD_API_SET_DNR_MEDIAN, 4, 0, 0, 255, 0, 255); 731 493 732 - /* assign spatial filter type: luma_t: 1 = horiz_only, chroma_t: 1 = horiz_only */ 733 - blackbird_api_cmd(dev, IVTV_API_ASSIGN_SPATIAL_FILTER_TYPE, 2, 0, 1, 1); 494 + /* assign spatial filter type: luma_t: horiz_only, chroma_t: horiz_only */ 495 + blackbird_api_cmd(dev, BLACKBIRD_API_SET_SPATIAL_FILTER, 2, 0, 496 + BLACKBIRD_SPATIAL_FILTER_LUMA_1D_HORIZ, 497 + BLACKBIRD_SPATIAL_FILTER_CHROMA_1D_HORIZ 498 + ); 734 499 735 - /* assign frame drop rate */ 736 - blackbird_api_cmd(dev, IVTV_API_ASSIGN_FRAME_DROP_RATE, 1, 0, 0); 500 + /* assign frame drop rate */ 501 + /* blackbird_api_cmd(dev, IVTV_API_ASSIGN_FRAME_DROP_RATE, 1, 0, 0); */ 737 502 } 738 503 739 504 static int blackbird_initialize_codec(struct cx8802_dev *dev) ··· 775 476 int retval; 776 477 777 478 dprintk(1,"Initialize codec\n"); 778 - retval = blackbird_api_cmd(dev, IVTV_API_ENC_PING_FW, 0, 0); /* ping */ 479 + retval = blackbird_api_cmd(dev, BLACKBIRD_API_PING, 0, 0); /* ping */ 779 480 if (retval < 0) { 780 481 /* ping was not successful, reset and upload firmware */ 781 482 cx_write(MO_SRST_IO, 0); /* SYS_RSTO=0 */ ··· 790 491 if (dev->mailbox < 0) 791 492 return -1; 792 493 793 - retval = blackbird_api_cmd(dev, IVTV_API_ENC_PING_FW, 0, 0); /* ping */ 494 + retval = blackbird_api_cmd(dev, BLACKBIRD_API_PING, 0, 0); /* ping */ 794 495 if (retval < 0) { 795 496 dprintk(0, "ERROR: Firmware ping failed!\n"); 796 497 return -1; 797 498 } 798 499 799 - retval = blackbird_api_cmd(dev, IVTV_API_ENC_GETVER, 0, 1, &version); 500 + retval = blackbird_api_cmd(dev, BLACKBIRD_API_GET_VERSION, 0, 1, &version); 800 501 if (retval < 0) { 801 502 dprintk(0, "ERROR: Firmware get encoder version failed!\n"); 802 503 return -1; ··· 816 517 blackbird_codec_settings(dev); 817 518 msleep(1); 818 519 819 - //blackbird_api_cmd(dev, IVTV_API_ASSIGN_NUM_VSYNC_LINES, 4, 0, 0xef, 0xef); 820 - blackbird_api_cmd(dev, IVTV_API_ASSIGN_NUM_VSYNC_LINES, 4, 0, 0xf0, 0xf0); 821 - //blackbird_api_cmd(dev, IVTV_API_ASSIGN_NUM_VSYNC_LINES, 4, 0, 0x180, 0x180); 822 - blackbird_api_cmd(dev, IVTV_API_ASSIGN_PLACEHOLDER, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); 520 + /* 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); 522 + blackbird_api_cmd(dev, IVTV_API_ASSIGN_NUM_VSYNC_LINES, 4, 0, 0x180, 0x180); */ 523 + blackbird_api_cmd(dev, BLACKBIRD_API_SET_CAPTURE_LINES, 2, 0, 524 + BLACKBIRD_FIELD1_SAA7115, 525 + BLACKBIRD_FIELD1_SAA7115 526 + ); 823 527 824 - blackbird_api_cmd(dev, IVTV_API_INITIALIZE_INPUT, 0, 0); /* initialize the video input */ 528 + /* blackbird_api_cmd(dev, IVTV_API_ASSIGN_PLACEHOLDER, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); */ 529 + blackbird_api_cmd(dev, BLACKBIRD_API_SET_CUSTOM_DATA, 12, 0, 530 + BLACKBIRD_CUSTOM_EXTENSION_USR_DATA, 531 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); 532 + 533 + blackbird_api_cmd(dev, BLACKBIRD_API_INIT_VIDEO_INPUT, 0, 0); /* initialize the video input */ 825 534 826 535 msleep(1); 827 536 828 - blackbird_api_cmd(dev, IVTV_API_MUTE_VIDEO, 1, 0, 0); 537 + blackbird_api_cmd(dev, BLACKBIRD_API_MUTE_VIDEO, 1, 0, BLACKBIRD_UNMUTE); 829 538 msleep(1); 830 - blackbird_api_cmd(dev, IVTV_API_MUTE_AUDIO, 1, 0, 0); 831 - msleep(1); 832 - 833 - blackbird_api_cmd(dev, IVTV_API_BEGIN_CAPTURE, 2, 0, 0, 0x13); /* start capturing to the host interface */ 834 - //blackbird_api_cmd(dev, IVTV_API_BEGIN_CAPTURE, 2, 0, 0, 0); /* start capturing to the host interface */ 539 + blackbird_api_cmd(dev, BLACKBIRD_API_MUTE_AUDIO, 1, 0, BLACKBIRD_UNMUTE); 835 540 msleep(1); 836 541 837 - blackbird_api_cmd(dev, IVTV_API_REFRESH_INPUT, 0,0); 542 + /* blackbird_api_cmd(dev, BLACKBIRD_API_BEGIN_CAPTURE, 2, 0, 0, 0x13); // start capturing to the host interface */ 543 + blackbird_api_cmd(dev, BLACKBIRD_API_BEGIN_CAPTURE, 2, 0, 544 + BLACKBIRD_MPEG_CAPTURE, 545 + BLACKBIRD_RAW_BITS_NONE 546 + ); /* start capturing to the host interface */ 547 + msleep(10); 548 + 549 + blackbird_api_cmd(dev, BLACKBIRD_API_REFRESH_INPUT, 0,0); 838 550 return 0; 839 551 } 840 552 ··· 1019 709 { 1020 710 struct cx8802_fh *fh = file->private_data; 1021 711 1022 - blackbird_api_cmd(fh->dev, IVTV_API_END_CAPTURE, 3, 0, 1, 0, 0x13); 712 + /* blackbird_api_cmd(fh->dev, BLACKBIRD_API_END_CAPTURE, 3, 0, BLACKBIRD_END_NOW, 0, 0x13); */ 713 + blackbird_api_cmd(fh->dev, BLACKBIRD_API_END_CAPTURE, 3, 0, 714 + BLACKBIRD_END_NOW, 715 + BLACKBIRD_MPEG_CAPTURE, 716 + BLACKBIRD_RAW_BITS_NONE 717 + ); 1023 718 1024 719 /* stop mpeg capture */ 1025 720 if (fh->mpegq.streaming) ··· 1223 908 * Local variables: 1224 909 * c-basic-offset: 8 1225 910 * End: 911 + * 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 1226 912 */
+161 -74
drivers/media/video/cx88/cx88-cards.c
··· 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 4 * device driver for Conexant 2388x based TV cards 5 5 * card-specific stuff. ··· 35 35 [CX88_BOARD_UNKNOWN] = { 36 36 .name = "UNKNOWN/GENERIC", 37 37 .tuner_type = UNSET, 38 + .radio_type = UNSET, 39 + .tuner_addr = ADDR_UNSET, 40 + .radio_addr = ADDR_UNSET, 38 41 .input = {{ 39 42 .type = CX88_VMUX_COMPOSITE1, 40 43 .vmux = 0, ··· 55 52 [CX88_BOARD_HAUPPAUGE] = { 56 53 .name = "Hauppauge WinTV 34xxx models", 57 54 .tuner_type = UNSET, 55 + .radio_type = UNSET, 56 + .tuner_addr = ADDR_UNSET, 57 + .radio_addr = ADDR_UNSET, 58 58 .tda9887_conf = TDA9887_PRESENT, 59 59 .input = {{ 60 60 .type = CX88_VMUX_TELEVISION, ··· 84 78 [CX88_BOARD_GDI] = { 85 79 .name = "GDI Black Gold", 86 80 .tuner_type = UNSET, 81 + .radio_type = UNSET, 82 + .tuner_addr = ADDR_UNSET, 83 + .radio_addr = ADDR_UNSET, 87 84 .input = {{ 88 85 .type = CX88_VMUX_TELEVISION, 89 86 .vmux = 0, ··· 94 85 }, 95 86 [CX88_BOARD_PIXELVIEW] = { 96 87 .name = "PixelView", 97 - .tuner_type = 5, 88 + .tuner_type = TUNER_PHILIPS_PAL, 89 + .radio_type = UNSET, 90 + .tuner_addr = ADDR_UNSET, 91 + .radio_addr = ADDR_UNSET, 98 92 .input = {{ 99 93 .type = CX88_VMUX_TELEVISION, 100 94 .vmux = 0, ··· 116 104 }, 117 105 [CX88_BOARD_ATI_WONDER_PRO] = { 118 106 .name = "ATI TV Wonder Pro", 119 - .tuner_type = 44, 107 + .tuner_type = TUNER_PHILIPS_4IN1, 108 + .radio_type = UNSET, 109 + .tuner_addr = ADDR_UNSET, 110 + .radio_addr = ADDR_UNSET, 120 111 .tda9887_conf = TDA9887_PRESENT | TDA9887_INTERCARRIER, 121 112 .input = {{ 122 113 .type = CX88_VMUX_TELEVISION, ··· 137 122 }, 138 123 [CX88_BOARD_WINFAST2000XP_EXPERT] = { 139 124 .name = "Leadtek Winfast 2000XP Expert", 140 - .tuner_type = 44, 125 + .tuner_type = TUNER_PHILIPS_4IN1, 126 + .radio_type = UNSET, 127 + .tuner_addr = ADDR_UNSET, 128 + .radio_addr = ADDR_UNSET, 141 129 .tda9887_conf = TDA9887_PRESENT, 142 130 .input = {{ 143 131 .type = CX88_VMUX_TELEVISION, ··· 174 156 }, 175 157 [CX88_BOARD_AVERTV_303] = { 176 158 .name = "AverTV Studio 303 (M126)", 177 - .tuner_type = 38, 159 + .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, 160 + .radio_type = UNSET, 161 + .tuner_addr = ADDR_UNSET, 162 + .radio_addr = ADDR_UNSET, 178 163 .tda9887_conf = TDA9887_PRESENT, 179 164 .input = {{ 180 165 .type = CX88_VMUX_TELEVISION, ··· 200 179 // added gpio values thanks to Michal 201 180 // values for PAL from DScaler 202 181 .name = "MSI TV-@nywhere Master", 203 - .tuner_type = 33, 182 + .tuner_type = TUNER_MT2032, 183 + .radio_type = UNSET, 184 + .tuner_addr = ADDR_UNSET, 185 + .radio_addr = ADDR_UNSET, 204 186 .tda9887_conf = TDA9887_PRESENT, 205 187 .input = {{ 206 188 .type = CX88_VMUX_TELEVISION, ··· 230 206 }, 231 207 [CX88_BOARD_WINFAST_DV2000] = { 232 208 .name = "Leadtek Winfast DV2000", 233 - .tuner_type = 38, 209 + .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, 210 + .radio_type = UNSET, 211 + .tuner_addr = ADDR_UNSET, 212 + .radio_addr = ADDR_UNSET, 234 213 .tda9887_conf = TDA9887_PRESENT, 235 214 .input = {{ 236 215 .type = CX88_VMUX_TELEVISION, ··· 266 239 .gpio3 = 0x02000000, 267 240 }, 268 241 }, 269 - [CX88_BOARD_LEADTEK_PVR2000] = { 242 + [CX88_BOARD_LEADTEK_PVR2000] = { 270 243 // gpio values for PAL version from regspy by DScaler 271 - .name = "Leadtek PVR 2000", 272 - .tuner_type = 38, 244 + .name = "Leadtek PVR 2000", 245 + .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, 246 + .radio_type = UNSET, 247 + .tuner_addr = ADDR_UNSET, 248 + .radio_addr = ADDR_UNSET, 273 249 .tda9887_conf = TDA9887_PRESENT, 274 - .input = {{ 275 - .type = CX88_VMUX_TELEVISION, 276 - .vmux = 0, 277 - .gpio0 = 0x0000bde6, 278 - },{ 279 - .type = CX88_VMUX_COMPOSITE1, 280 - .vmux = 1, 281 - .gpio0 = 0x0000bde6, 282 - },{ 283 - .type = CX88_VMUX_SVIDEO, 284 - .vmux = 2, 285 - .gpio0 = 0x0000bde6, 286 - }}, 287 - .radio = { 288 - .type = CX88_RADIO, 289 - .gpio0 = 0x0000bd62, 290 - }, 250 + .input = {{ 251 + .type = CX88_VMUX_TELEVISION, 252 + .vmux = 0, 253 + .gpio0 = 0x0000bde2, 254 + },{ 255 + .type = CX88_VMUX_COMPOSITE1, 256 + .vmux = 1, 257 + .gpio0 = 0x0000bde6, 258 + },{ 259 + .type = CX88_VMUX_SVIDEO, 260 + .vmux = 2, 261 + .gpio0 = 0x0000bde6, 262 + }}, 263 + .radio = { 264 + .type = CX88_RADIO, 265 + .gpio0 = 0x0000bd62, 266 + }, 291 267 .blackbird = 1, 292 - }, 268 + }, 293 269 [CX88_BOARD_IODATA_GVVCP3PCI] = { 294 270 .name = "IODATA GV-VCP3/PCI", 295 271 .tuner_type = TUNER_ABSENT, 296 - .input = {{ 272 + .radio_type = UNSET, 273 + .tuner_addr = ADDR_UNSET, 274 + .radio_addr = ADDR_UNSET, 275 + .input = {{ 297 276 .type = CX88_VMUX_COMPOSITE1, 298 277 .vmux = 0, 299 278 },{ ··· 312 279 }, 313 280 [CX88_BOARD_PROLINK_PLAYTVPVR] = { 314 281 .name = "Prolink PlayTV PVR", 315 - .tuner_type = 43, 282 + .tuner_type = TUNER_PHILIPS_FM1236_MK3, 283 + .radio_type = UNSET, 284 + .tuner_addr = ADDR_UNSET, 285 + .radio_addr = ADDR_UNSET, 316 286 .tda9887_conf = TDA9887_PRESENT, 317 287 .input = {{ 318 288 .type = CX88_VMUX_TELEVISION, ··· 337 301 }, 338 302 [CX88_BOARD_ASUS_PVR_416] = { 339 303 .name = "ASUS PVR-416", 340 - .tuner_type = 43, 341 - .tda9887_conf = TDA9887_PRESENT, 304 + .tuner_type = TUNER_PHILIPS_FM1236_MK3, 305 + .radio_type = UNSET, 306 + .tuner_addr = ADDR_UNSET, 307 + .radio_addr = ADDR_UNSET, 308 + .tda9887_conf = TDA9887_PRESENT, 342 309 .input = {{ 343 310 .type = CX88_VMUX_TELEVISION, 344 311 .vmux = 0, ··· 359 320 }, 360 321 [CX88_BOARD_MSI_TVANYWHERE] = { 361 322 .name = "MSI TV-@nywhere", 362 - .tuner_type = 33, 323 + .tuner_type = TUNER_MT2032, 324 + .radio_type = UNSET, 325 + .tuner_addr = ADDR_UNSET, 326 + .radio_addr = ADDR_UNSET, 363 327 .tda9887_conf = TDA9887_PRESENT, 364 328 .input = {{ 365 329 .type = CX88_VMUX_TELEVISION, ··· 384 342 [CX88_BOARD_KWORLD_DVB_T] = { 385 343 .name = "KWorld/VStream XPert DVB-T", 386 344 .tuner_type = TUNER_ABSENT, 345 + .radio_type = UNSET, 346 + .tuner_addr = ADDR_UNSET, 347 + .radio_addr = ADDR_UNSET, 387 348 .input = {{ 388 349 .type = CX88_VMUX_COMPOSITE1, 389 350 .vmux = 1, ··· 403 358 [CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1] = { 404 359 .name = "DVICO FusionHDTV DVB-T1", 405 360 .tuner_type = TUNER_ABSENT, /* No analog tuner */ 361 + .radio_type = UNSET, 362 + .tuner_addr = ADDR_UNSET, 363 + .radio_addr = ADDR_UNSET, 406 364 .input = {{ 407 365 .type = CX88_VMUX_COMPOSITE1, 408 366 .vmux = 1, ··· 419 371 }, 420 372 [CX88_BOARD_KWORLD_LTV883] = { 421 373 .name = "KWorld LTV883RF", 422 - .tuner_type = 48, 374 + .tuner_type = TUNER_TNF_8831BGFF, 375 + .radio_type = UNSET, 376 + .tuner_addr = ADDR_UNSET, 377 + .radio_addr = ADDR_UNSET, 423 378 .input = {{ 424 379 .type = CX88_VMUX_TELEVISION, 425 380 .vmux = 0, ··· 448 397 [CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD] = { 449 398 .name = "DViCO - FusionHDTV 3 Gold", 450 399 .tuner_type = TUNER_MICROTUNE_4042FI5, 400 + .radio_type = UNSET, 401 + .tuner_addr = ADDR_UNSET, 402 + .radio_addr = ADDR_UNSET, 451 403 /* 452 404 GPIO[0] resets DT3302 DTV receiver 453 405 0 - reset asserted ··· 483 429 .gpio0 = 0x0f00, 484 430 }}, 485 431 }, 486 - [CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T] = { 487 - .name = "DViCO - FusionHDTV 3 Gold-T", 488 - .tuner_type = 60, /* Thomson DDT 7611 ATSC/NTSC */ 489 - /* See DViCO FusionHDTV 3 Gold for GPIO documentation. */ 490 - .input = {{ 491 - .type = CX88_VMUX_TELEVISION, 492 - .vmux = 0, 493 - .gpio0 = 0x0f0d, 494 - },{ 495 - .type = CX88_VMUX_CABLE, 496 - .vmux = 0, 497 - .gpio0 = 0x0f05, 498 - },{ 499 - .type = CX88_VMUX_COMPOSITE1, 500 - .vmux = 1, 501 - .gpio0 = 0x0f00, 502 - },{ 503 - .type = CX88_VMUX_SVIDEO, 504 - .vmux = 2, 505 - .gpio0 = 0x0f00, 506 - }}, 507 - }, 508 432 [CX88_BOARD_HAUPPAUGE_DVB_T1] = { 509 - .name = "Hauppauge Nova-T DVB-T", 433 + .name = "Hauppauge Nova-T DVB-T", 510 434 .tuner_type = TUNER_ABSENT, 511 - .input = {{ 435 + .radio_type = UNSET, 436 + .tuner_addr = ADDR_UNSET, 437 + .radio_addr = ADDR_UNSET, 438 + .input = {{ 512 439 .type = CX88_VMUX_DVB, 513 440 .vmux = 0, 514 441 }}, ··· 498 463 [CX88_BOARD_CONEXANT_DVB_T1] = { 499 464 .name = "Conexant DVB-T reference design", 500 465 .tuner_type = TUNER_ABSENT, 466 + .radio_type = UNSET, 467 + .tuner_addr = ADDR_UNSET, 468 + .radio_addr = ADDR_UNSET, 501 469 .input = {{ 502 470 .type = CX88_VMUX_DVB, 503 471 .vmux = 0, ··· 510 472 [CX88_BOARD_PROVIDEO_PV259] = { 511 473 .name = "Provideo PV259", 512 474 .tuner_type = TUNER_PHILIPS_FQ1216ME, 475 + .radio_type = UNSET, 476 + .tuner_addr = ADDR_UNSET, 477 + .radio_addr = ADDR_UNSET, 513 478 .input = {{ 514 479 .type = CX88_VMUX_TELEVISION, 515 480 .vmux = 0, ··· 522 481 [CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS] = { 523 482 .name = "DVICO FusionHDTV DVB-T Plus", 524 483 .tuner_type = TUNER_ABSENT, /* No analog tuner */ 484 + .radio_type = UNSET, 485 + .tuner_addr = ADDR_UNSET, 486 + .radio_addr = ADDR_UNSET, 525 487 .input = {{ 526 488 .type = CX88_VMUX_COMPOSITE1, 527 489 .vmux = 1, ··· 539 495 [CX88_BOARD_DNTV_LIVE_DVB_T] = { 540 496 .name = "digitalnow DNTV Live! DVB-T", 541 497 .tuner_type = TUNER_ABSENT, 498 + .radio_type = UNSET, 499 + .tuner_addr = ADDR_UNSET, 500 + .radio_addr = ADDR_UNSET, 542 501 .input = {{ 543 502 .type = CX88_VMUX_COMPOSITE1, 544 503 .vmux = 1, ··· 558 511 [CX88_BOARD_PCHDTV_HD3000] = { 559 512 .name = "pcHDTV HD3000 HDTV", 560 513 .tuner_type = TUNER_THOMSON_DTT7610, 514 + .radio_type = UNSET, 515 + .tuner_addr = ADDR_UNSET, 516 + .radio_addr = ADDR_UNSET, 561 517 .input = {{ 562 518 .type = CX88_VMUX_TELEVISION, 563 519 .vmux = 0, ··· 596 546 [CX88_BOARD_HAUPPAUGE_ROSLYN] = { 597 547 // entry added by Kaustubh D. Bhalerao <bhalerao.1@osu.edu> 598 548 // GPIO values obtained from regspy, courtesy Sean Covel 599 - .name = "Hauppauge WinTV 28xxx (Roslyn) models", 600 - .tuner_type = UNSET, 549 + .name = "Hauppauge WinTV 28xxx (Roslyn) models", 550 + .tuner_type = UNSET, 551 + .radio_type = UNSET, 552 + .tuner_addr = ADDR_UNSET, 553 + .radio_addr = ADDR_UNSET, 601 554 .input = {{ 602 555 .type = CX88_VMUX_TELEVISION, 603 556 .vmux = 0, ··· 628 575 .blackbird = 1, 629 576 }, 630 577 [CX88_BOARD_DIGITALLOGIC_MEC] = { 631 - /* params copied over from Leadtek PVR 2000 */ 632 578 .name = "Digital-Logic MICROSPACE Entertainment Center (MEC)", 633 - /* not sure yet about the tuner type */ 634 - .tuner_type = 38, 579 + .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, 580 + .radio_type = UNSET, 581 + .tuner_addr = ADDR_UNSET, 582 + .radio_addr = ADDR_UNSET, 635 583 .tda9887_conf = TDA9887_PRESENT, 636 584 .input = {{ 637 585 .type = CX88_VMUX_TELEVISION, 638 586 .vmux = 0, 639 - .gpio0 = 0x0000bde6, 587 + .gpio0 = 0x00009d80, 640 588 },{ 641 589 .type = CX88_VMUX_COMPOSITE1, 642 590 .vmux = 1, 643 - .gpio0 = 0x0000bde6, 591 + .gpio0 = 0x00009d76, 644 592 },{ 645 593 .type = CX88_VMUX_SVIDEO, 646 594 .vmux = 2, 647 - .gpio0 = 0x0000bde6, 595 + .gpio0 = 0x00009d76, 648 596 }}, 649 597 .radio = { 650 598 .type = CX88_RADIO, 651 - .gpio0 = 0x0000bd62, 599 + .gpio0 = 0x00009d00, 652 600 }, 653 601 .blackbird = 1, 654 602 }, 655 603 [CX88_BOARD_IODATA_GVBCTV7E] = { 656 604 .name = "IODATA GV/BCTV7E", 657 605 .tuner_type = TUNER_PHILIPS_FQ1286, 606 + .radio_type = UNSET, 607 + .tuner_addr = ADDR_UNSET, 608 + .radio_addr = ADDR_UNSET, 658 609 .tda9887_conf = TDA9887_PRESENT, 659 610 .input = {{ 660 611 .type = CX88_VMUX_TELEVISION, ··· 676 619 }, 677 620 [CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO] = { 678 621 .name = "PixelView PlayTV Ultra Pro (Stereo)", 679 - .tuner_type = 38, 622 + /* May be also TUNER_YMEC_TVF_5533MF for NTSC/M or PAL/M */ 623 + .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, 624 + .radio_type = TUNER_TEA5767, 625 + .tuner_addr = 0xc2>>1, 626 + .radio_addr = 0xc0>>1, 680 627 .input = {{ 681 628 .type = CX88_VMUX_TELEVISION, 682 629 .vmux = 0, 683 - .gpio0 = 0xbf61, // internal decoder 630 + .gpio0 = 0xbf61, /* internal decoder */ 684 631 },{ 685 632 .type = CX88_VMUX_COMPOSITE1, 686 633 .vmux = 1, 687 - .gpio0 = 0xbf63, 634 + .gpio0 = 0xbf63, 688 635 },{ 689 636 .type = CX88_VMUX_SVIDEO, 690 637 .vmux = 2, 691 - .gpio0 = 0xbf63, 638 + .gpio0 = 0xbf63, 692 639 }}, 693 640 .radio = { 694 - .type = CX88_RADIO, 695 - .gpio0 = 0xbf60, 696 - }, 641 + .type = CX88_RADIO, 642 + .gpio0 = 0xbf60, 643 + }, 697 644 }, 645 + [CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T] = { 646 + .name = "DViCO - FusionHDTV 3 Gold-T", 647 + .tuner_type = TUNER_THOMSON_DTT7611, 648 + .radio_type = UNSET, 649 + .tuner_addr = ADDR_UNSET, 650 + .radio_addr = ADDR_UNSET, 651 + /* See DViCO FusionHDTV 3 Gold for GPIO documentation. */ 652 + .input = {{ 653 + .type = CX88_VMUX_TELEVISION, 654 + .vmux = 0, 655 + .gpio0 = 0x0f0d, 656 + },{ 657 + .type = CX88_VMUX_CABLE, 658 + .vmux = 0, 659 + .gpio0 = 0x0f05, 660 + },{ 661 + .type = CX88_VMUX_COMPOSITE1, 662 + .vmux = 1, 663 + .gpio0 = 0x0f00, 664 + },{ 665 + .type = CX88_VMUX_SVIDEO, 666 + .vmux = 2, 667 + .gpio0 = 0x0f00, 668 + }}, 669 + }, 698 670 }; 699 671 const unsigned int cx88_bcount = ARRAY_SIZE(cx88_boards); 700 672 ··· 1062 976 * Local variables: 1063 977 * c-basic-offset: 8 1064 978 * End: 979 + * 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 1065 980 */
+17 -2
drivers/media/video/cx88/cx88-core.c
··· 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 4 * device driver for Conexant 2388x based TV cards 5 5 * driver core ··· 51 51 MODULE_PARM_DESC(latency,"pci latency timer"); 52 52 53 53 static unsigned int tuner[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET }; 54 + static unsigned int radio[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET }; 54 55 static unsigned int card[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET }; 55 56 56 57 module_param_array(tuner, int, NULL, 0444); 58 + module_param_array(radio, int, NULL, 0444); 57 59 module_param_array(card, int, NULL, 0444); 58 60 59 61 MODULE_PARM_DESC(tuner,"tuner type"); 62 + MODULE_PARM_DESC(radio,"radio tuner type"); 60 63 MODULE_PARM_DESC(card,"card type"); 61 64 62 65 static unsigned int nicam = 0; ··· 432 429 /* ------------------------------------------------------------------ */ 433 430 /* debug helper code */ 434 431 435 - static int cx88_risc_decode(u32 risc) 432 + int cx88_risc_decode(u32 risc) 436 433 { 437 434 static char *instr[16] = { 438 435 [ RISC_SYNC >> 28 ] = "sync", ··· 1176 1173 "insmod option" : "autodetected"); 1177 1174 1178 1175 core->tuner_type = tuner[core->nr]; 1176 + core->radio_type = radio[core->nr]; 1179 1177 if (UNSET == core->tuner_type) 1180 1178 core->tuner_type = cx88_boards[core->board].tuner_type; 1179 + if (UNSET == core->radio_type) 1180 + core->radio_type = cx88_boards[core->board].radio_type; 1181 + if (!core->tuner_addr) 1182 + core->tuner_addr = cx88_boards[core->board].tuner_addr; 1183 + if (!core->radio_addr) 1184 + core->radio_addr = cx88_boards[core->board].radio_addr; 1185 + 1186 + printk(KERN_INFO "TV tuner %d at 0x%02x, Radio tuner %d at 0x%02x\n", 1187 + core->tuner_type, core->tuner_addr<<1, 1188 + core->radio_type, core->radio_addr<<1); 1189 + 1181 1190 core->tda9887_conf = cx88_boards[core->board].tda9887_conf; 1182 1191 1183 1192 /* init hardware */
+1 -1
drivers/media/video/cx88/cx88-dvb.c
··· 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 4 * device driver for Conexant 2388x based TV cards 5 5 * MPEG Transport Stream (DVB) routines
+15 -3
drivers/media/video/cx88/cx88-i2c.c
··· 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 4 cx88-i2c.c -- all the i2c code is here 5 5 ··· 91 91 92 92 static int attach_inform(struct i2c_client *client) 93 93 { 94 + struct tuner_addr tun_addr; 94 95 struct cx88_core *core = i2c_get_adapdata(client->adapter); 95 96 96 97 dprintk(1, "i2c attach [addr=0x%x,client=%s]\n", ··· 99 98 if (!client->driver->command) 100 99 return 0; 101 100 102 - if (core->tuner_type != UNSET) 103 - client->driver->command(client, TUNER_SET_TYPE, &core->tuner_type); 101 + if (core->radio_type != UNSET) { 102 + tun_addr.v4l2_tuner = V4L2_TUNER_RADIO; 103 + tun_addr.type = core->radio_type; 104 + tun_addr.addr = core->radio_addr; 105 + client->driver->command(client,TUNER_SET_TYPE_ADDR, &tun_addr); 106 + } 107 + if (core->tuner_type != UNSET) { 108 + tun_addr.v4l2_tuner = V4L2_TUNER_ANALOG_TV; 109 + tun_addr.type = core->tuner_type; 110 + tun_addr.addr = core->tuner_addr; 111 + client->driver->command(client,TUNER_SET_TYPE_ADDR, &tun_addr); 112 + } 113 + 104 114 if (core->tda9887_conf) 105 115 client->driver->command(client, TDA9887_SET_CONFIG, &core->tda9887_conf); 106 116 return 0;
+3 -1
drivers/media/video/cx88/cx88-input.c
··· 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 4 * Device driver for GPIO attached remote control interfaces 5 5 * on Conexant 2388x based TV/DVB cards. ··· 235 235 /* detect & configure */ 236 236 switch (core->board) { 237 237 case CX88_BOARD_DNTV_LIVE_DVB_T: 238 + case CX88_BOARD_KWORLD_DVB_T: 238 239 ir_codes = ir_codes_dntv_live_dvb_t; 239 240 ir->gpio_addr = MO_GP1_IO; 240 241 ir->mask_keycode = 0x1f; ··· 270 269 ir->polling = 1; // ms 271 270 break; 272 271 } 272 + 273 273 if (NULL == ir_codes) { 274 274 kfree(ir); 275 275 return -ENODEV;
+42 -10
drivers/media/video/cx88/cx88-mpeg.c
··· 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 4 * Support for the mpeg transport stream transfers 5 5 * PCI function #2 of the cx2388x. ··· 55 55 { 56 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 60 /* setup fifo + format */ 61 61 cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH28], ··· 100 100 q->count = 1; 101 101 102 102 /* enable irqs */ 103 + dprintk( 0, "setting the interrupt mask\n" ); 103 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 108 /* start dma */ 107 - cx_write(MO_DEV_CNTRL2, (1<<5)); /* FIXME: s/write/set/ ??? */ 108 - cx_write(MO_TS_DMACNTRL, 0x11); 109 + cx_set(MO_DEV_CNTRL2, (1<<5)); 110 + cx_set(MO_TS_DMACNTRL, 0x11); 109 111 return 0; 110 112 } 111 113 112 114 static int cx8802_stop_dma(struct cx8802_dev *dev) 113 115 { 114 116 struct cx88_core *core = dev->core; 117 + dprintk( 0, "cx8802_stop_dma\n" ); 115 118 116 119 /* stop dma */ 117 120 cx_clear(MO_TS_DMACNTRL, 0x11); ··· 134 131 struct cx88_buffer *buf; 135 132 struct list_head *item; 136 133 134 + dprintk( 0, "cx8802_restart_queue\n" ); 137 135 if (list_empty(&q->active)) 136 + { 137 + dprintk( 0, "cx8802_restart_queue: queue is empty\n" ); 138 138 return 0; 139 + } 139 140 140 141 buf = list_entry(q->active.next, struct cx88_buffer, vb.queue); 141 142 dprintk(2,"restart_queue [%p/%d]: restart dma\n", ··· 189 182 struct cx88_buffer *prev; 190 183 struct cx88_dmaqueue *q = &dev->mpegq; 191 184 185 + dprintk( 1, "cx8802_buf_queue\n" ); 192 186 /* add jump to stopper */ 193 187 buf->risc.jmp[0] = cpu_to_le32(RISC_JUMP | RISC_IRQ1 | RISC_CNT_INC); 194 188 buf->risc.jmp[1] = cpu_to_le32(q->stopper.dma); 195 189 196 190 if (list_empty(&q->active)) { 191 + dprintk( 0, "queue is empty - first active\n" ); 197 192 list_add_tail(&buf->vb.queue,&q->active); 198 193 cx8802_start_dma(dev, q, buf); 199 194 buf->vb.state = STATE_ACTIVE; 200 195 buf->count = q->count++; 201 196 mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT); 202 - dprintk(2,"[%p/%d] %s - first active\n", 197 + dprintk(0,"[%p/%d] %s - first active\n", 203 198 buf, buf->vb.i, __FUNCTION__); 199 + //udelay(100); 204 200 205 201 } else { 202 + dprintk( 1, "queue is not empty - append to active\n" ); 206 203 prev = list_entry(q->active.prev, struct cx88_buffer, vb.queue); 207 204 list_add_tail(&buf->vb.queue,&q->active); 208 205 buf->vb.state = STATE_ACTIVE; 209 206 buf->count = q->count++; 210 207 prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma); 211 - dprintk(2,"[%p/%d] %s - append to active\n", 208 + dprintk( 1, "[%p/%d] %s - append to active\n", 212 209 buf, buf->vb.i, __FUNCTION__); 210 + //udelay(100); 213 211 } 214 212 } 215 213 ··· 236 224 buf, buf->vb.i, reason, (unsigned long)buf->risc.dma); 237 225 } 238 226 if (restart) 227 + { 228 + dprintk(0, "restarting queue\n" ); 239 229 cx8802_restart_queue(dev,q); 230 + } 240 231 spin_unlock_irqrestore(&dev->slock,flags); 241 232 } 242 233 ··· 247 232 { 248 233 struct cx88_dmaqueue *q = &dev->mpegq; 249 234 235 + dprintk( 1, "cx8802_cancel_buffers" ); 250 236 del_timer_sync(&q->timeout); 251 237 cx8802_stop_dma(dev); 252 238 do_cancel_buffers(dev,"cancel",0); ··· 257 241 { 258 242 struct cx8802_dev *dev = (struct cx8802_dev*)data; 259 243 260 - dprintk(1, "%s\n",__FUNCTION__); 244 + dprintk(0, "%s\n",__FUNCTION__); 261 245 262 246 if (debug) 263 247 cx88_sram_channel_dump(dev->core, &cx88_sram_channels[SRAM_CH28]); ··· 270 254 struct cx88_core *core = dev->core; 271 255 u32 status, mask, count; 272 256 257 + dprintk( 1, "cx8802_mpeg_irq\n" ); 273 258 status = cx_read(MO_TS_INTSTAT); 274 259 mask = cx_read(MO_TS_INTMSK); 275 260 if (0 == (status & mask)) 276 261 return; 277 262 278 263 cx_write(MO_TS_INTSTAT, status); 264 + #if 0 265 + cx88_print_irqbits(core->name, "irq mpeg ", 266 + cx88_mpeg_irqs, status, mask); 267 + #endif 279 268 if (debug || (status & mask & ~0xff)) 280 269 cx88_print_irqbits(core->name, "irq mpeg ", 281 270 cx88_mpeg_irqs, status, mask); ··· 294 273 295 274 /* risc1 y */ 296 275 if (status & 0x01) { 276 + dprintk( 1, "wake up\n" ); 297 277 spin_lock(&dev->slock); 298 278 count = cx_read(MO_TS_GPCNT); 299 279 cx88_wakeup(dev->core, &dev->mpegq, count); ··· 310 288 311 289 /* other general errors */ 312 290 if (status & 0x1f0100) { 291 + dprintk( 0, "general errors: 0x%08x\n", status & 0x1f0100 ); 313 292 spin_lock(&dev->slock); 314 293 cx8802_stop_dma(dev); 315 294 cx8802_restart_queue(dev,&dev->mpegq); 316 295 spin_unlock(&dev->slock); 317 296 } 318 297 } 298 + 299 + #define MAX_IRQ_LOOP 10 319 300 320 301 static irqreturn_t cx8802_irq(int irq, void *dev_id, struct pt_regs *regs) 321 302 { ··· 327 302 u32 status; 328 303 int loop, handled = 0; 329 304 330 - for (loop = 0; loop < 10; loop++) { 305 + for (loop = 0; loop < MAX_IRQ_LOOP; loop++) { 331 306 status = cx_read(MO_PCI_INTSTAT) & (core->pci_irqmask | 0x04); 332 307 if (0 == status) 333 308 goto out; 309 + dprintk( 1, "cx8802_irq\n" ); 310 + dprintk( 1, " loop: %d/%d\n", loop, MAX_IRQ_LOOP ); 311 + dprintk( 1, " status: %d\n", status ); 334 312 handled = 1; 335 313 cx_write(MO_PCI_INTSTAT, status); 336 314 ··· 342 314 if (status & 0x04) 343 315 cx8802_mpeg_irq(dev); 344 316 }; 345 - if (10 == loop) { 317 + if (MAX_IRQ_LOOP == loop) { 318 + dprintk( 0, "clearing mask\n" ); 346 319 printk(KERN_WARNING "%s/0: irq loop -- clearing mask\n", 347 320 core->name); 348 321 cx_write(MO_PCI_INTMSK,0); ··· 407 378 408 379 void cx8802_fini_common(struct cx8802_dev *dev) 409 380 { 381 + dprintk( 2, "cx8802_fini_common\n" ); 410 382 cx8802_stop_dma(dev); 411 383 pci_disable_device(dev->pci); 412 384 ··· 429 399 /* stop mpeg dma */ 430 400 spin_lock(&dev->slock); 431 401 if (!list_empty(&dev->mpegq.active)) { 402 + dprintk( 2, "suspend\n" ); 432 403 printk("%s: suspend mpeg\n", core->name); 433 404 cx8802_stop_dma(dev); 434 405 del_timer(&dev->mpegq.timeout); ··· 494 463 * Local variables: 495 464 * c-basic-offset: 8 496 465 * End: 466 + * 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 497 467 */
+2 -1
drivers/media/video/cx88/cx88-reg.h
··· 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 4 cx88x-hw.h - CX2388x register offsets 5 5 ··· 397 397 #define AUD_RATE_ADJ4 0x3205e4 398 398 #define AUD_RATE_ADJ5 0x3205e8 399 399 #define AUD_APB_IN_RATE_ADJ 0x3205ec 400 + #define AUD_I2SCNTL 0x3205ec 400 401 #define AUD_PHASE_FIX_CTL 0x3205f0 401 402 #define AUD_PLL_PRESCALE 0x320600 402 403 #define AUD_PLL_DDS 0x320604
+61 -38
drivers/media/video/cx88/cx88-tvaudio.c
··· 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 4 cx88x-audio.c - Conexant CX23880/23881 audio downstream driver driver 5 5 ··· 127 127 cx_write(AUD_VOL_CTL, (1 << 6)); 128 128 129 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 133 // start programming 133 134 cx_write(AUD_CTL, 0x0000); ··· 144 143 u32 volume; 145 144 146 145 if (cx88_boards[core->board].blackbird) { 146 + // sets sound input from external adc 147 + cx_set(AUD_CTL, EN_I2SIN_ENABLE); 148 + //cx_write(AUD_I2SINPUTCNTL, 0); 149 + cx_write(AUD_I2SINPUTCNTL, 4); 150 + cx_write(AUD_BAUDRATE, 1); 147 151 // 'pass-thru mode': this enables the i2s output to the mpeg encoder 148 - cx_set(AUD_CTL, 0x2000); 152 + cx_set(AUD_CTL, EN_I2SOUT_ENABLE); 149 153 cx_write(AUD_I2SOUTPUTCNTL, 1); 154 + cx_write(AUD_I2SCNTL, 0); 150 155 //cx_write(AUD_APB_IN_RATE_ADJ, 0); 151 156 } 152 157 ··· 714 707 set_audio_finish(core); 715 708 } 716 709 717 - static void set_audio_standard_FM(struct cx88_core *core) 710 + static void set_audio_standard_FM(struct cx88_core *core, enum cx88_deemph_type deemph) 718 711 { 719 - #if 0 /* FIXME */ 720 - switch (dev->audio_properties.FM_deemphasis) 721 - { 722 - case WW_FM_DEEMPH_50: 723 - //Set De-emphasis filter coefficients for 50 usec 724 - cx_write(AUD_DEEMPH0_G0, 0x0C45); 725 - cx_write(AUD_DEEMPH0_A0, 0x6262); 726 - cx_write(AUD_DEEMPH0_B0, 0x1C29); 727 - cx_write(AUD_DEEMPH0_A1, 0x3FC66); 728 - cx_write(AUD_DEEMPH0_B1, 0x399A); 712 + static const struct rlist fm_deemph_50[] = { 713 + { AUD_DEEMPH0_G0, 0x0C45 }, 714 + { AUD_DEEMPH0_A0, 0x6262 }, 715 + { AUD_DEEMPH0_B0, 0x1C29 }, 716 + { AUD_DEEMPH0_A1, 0x3FC66}, 717 + { AUD_DEEMPH0_B1, 0x399A }, 729 718 730 - cx_write(AUD_DEEMPH1_G0, 0x0D80); 731 - cx_write(AUD_DEEMPH1_A0, 0x6262); 732 - cx_write(AUD_DEEMPH1_B0, 0x1C29); 733 - cx_write(AUD_DEEMPH1_A1, 0x3FC66); 734 - cx_write(AUD_DEEMPH1_B1, 0x399A); 719 + { AUD_DEEMPH1_G0, 0x0D80 }, 720 + { AUD_DEEMPH1_A0, 0x6262 }, 721 + { AUD_DEEMPH1_B0, 0x1C29 }, 722 + { AUD_DEEMPH1_A1, 0x3FC66}, 723 + { AUD_DEEMPH1_B1, 0x399A}, 735 724 736 - break; 725 + { AUD_POLYPH80SCALEFAC, 0x0003}, 726 + { /* end of list */ }, 727 + }; 728 + static const struct rlist fm_deemph_75[] = { 729 + { AUD_DEEMPH0_G0, 0x091B }, 730 + { AUD_DEEMPH0_A0, 0x6B68 }, 731 + { AUD_DEEMPH0_B0, 0x11EC }, 732 + { AUD_DEEMPH0_A1, 0x3FC66}, 733 + { AUD_DEEMPH0_B1, 0x399A }, 737 734 738 - case WW_FM_DEEMPH_75: 739 - //Set De-emphasis filter coefficients for 75 usec 740 - cx_write(AUD_DEEMPH0_G0, 0x91B ); 741 - cx_write(AUD_DEEMPH0_A0, 0x6B68); 742 - cx_write(AUD_DEEMPH0_B0, 0x11EC); 743 - cx_write(AUD_DEEMPH0_A1, 0x3FC66); 744 - cx_write(AUD_DEEMPH0_B1, 0x399A); 735 + { AUD_DEEMPH1_G0, 0x0AA0 }, 736 + { AUD_DEEMPH1_A0, 0x6B68 }, 737 + { AUD_DEEMPH1_B0, 0x11EC }, 738 + { AUD_DEEMPH1_A1, 0x3FC66}, 739 + { AUD_DEEMPH1_B1, 0x399A}, 745 740 746 - cx_write(AUD_DEEMPH1_G0, 0xAA0 ); 747 - cx_write(AUD_DEEMPH1_A0, 0x6B68); 748 - cx_write(AUD_DEEMPH1_B0, 0x11EC); 749 - cx_write(AUD_DEEMPH1_A1, 0x3FC66); 750 - cx_write(AUD_DEEMPH1_B1, 0x399A); 741 + { AUD_POLYPH80SCALEFAC, 0x0003}, 742 + { /* end of list */ }, 743 + }; 751 744 752 - break; 753 - } 754 - #endif 745 + /* It is enough to leave default values? */ 746 + static const struct rlist fm_no_deemph[] = { 747 + 748 + { AUD_POLYPH80SCALEFAC, 0x0003}, 749 + { /* end of list */ }, 750 + }; 755 751 756 752 dprintk("%s (status: unknown)\n",__FUNCTION__); 757 753 set_audio_start(core, 0x0020, EN_FMRADIO_AUTO_STEREO); 758 754 759 - // AB: 10/2/01: this register is not being reset appropriately on occasion. 760 - cx_write(AUD_POLYPH80SCALEFAC,3); 755 + switch (deemph) 756 + { 757 + case FM_NO_DEEMPH: 758 + set_audio_registers(core, fm_no_deemph); 759 + break; 760 + 761 + case FM_DEEMPH_50: 762 + set_audio_registers(core, fm_deemph_50); 763 + break; 764 + 765 + case FM_DEEMPH_75: 766 + set_audio_registers(core, fm_deemph_75); 767 + break; 768 + } 761 769 762 770 set_audio_finish(core); 763 771 } ··· 800 778 set_audio_standard_EIAJ(core); 801 779 break; 802 780 case WW_FM: 803 - set_audio_standard_FM(core); 781 + set_audio_standard_FM(core,FM_NO_DEEMPH); 804 782 break; 805 783 case WW_SYSTEM_L_AM: 806 784 set_audio_standard_NICAM_L(core, 1); ··· 1051 1029 * Local variables: 1052 1030 * c-basic-offset: 8 1053 1031 * End: 1032 + * 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 1054 1033 */
+3 -3
drivers/media/video/cx88/cx88-vbi.c
··· 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 4 #include <linux/kernel.h> 5 5 #include <linux/module.h> ··· 47 47 } 48 48 49 49 static int cx8800_start_vbi_dma(struct cx8800_dev *dev, 50 - struct cx88_dmaqueue *q, 51 - struct cx88_buffer *buf) 50 + struct cx88_dmaqueue *q, 51 + struct cx88_buffer *buf) 52 52 { 53 53 struct cx88_core *core = dev->core; 54 54
+47 -12
drivers/media/video/cx88/cx88-video.c
··· 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 4 * device driver for Conexant 2388x based TV cards 5 5 * video4linux video interface ··· 1187 1187 .id = V4L2_CID_AUDIO_VOLUME, 1188 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 1203 set_control(dev,&mute); 1192 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 /* ------------------------------------------------------------------ */ ··· 1350 1335 V4L2_CAP_READWRITE | 1351 1336 V4L2_CAP_STREAMING | 1352 1337 V4L2_CAP_VBI_CAPTURE | 1338 + #if 0 1339 + V4L2_TUNER_CAP_LOW | 1340 + #endif 1353 1341 #if 0 1354 1342 V4L2_CAP_VIDEO_OVERLAY | 1355 1343 #endif ··· 1714 1696 sizeof(cap->card)); 1715 1697 sprintf(cap->bus_info,"PCI:%s", pci_name(dev->pci)); 1716 1698 cap->version = CX88_VERSION_CODE; 1717 - cap->capabilities = V4L2_CAP_TUNER; 1699 + cap->capabilities = V4L2_CAP_TUNER 1700 + #if 0 1701 + | V4L2_TUNER_CAP_LOW 1702 + #endif 1703 + ; 1718 1704 return 0; 1719 1705 } 1720 1706 case VIDIOC_G_TUNER: ··· 2014 1992 { 2015 1993 struct cx8800_dev *dev; 2016 1994 struct cx88_core *core; 1995 + struct tuner_addr tun_addr; 2017 1996 int err; 2018 1997 2019 1998 dev = kmalloc(sizeof(*dev),GFP_KERNEL); ··· 2088 2065 request_module("tuner"); 2089 2066 if (core->tda9887_conf) 2090 2067 request_module("tda9887"); 2091 - if (core->tuner_type != UNSET) 2092 - cx88_call_i2c_clients(dev->core,TUNER_SET_TYPE,&core->tuner_type); 2068 + if (core->radio_type != UNSET) { 2069 + tun_addr.v4l2_tuner = V4L2_TUNER_RADIO; 2070 + tun_addr.type = core->radio_type; 2071 + tun_addr.addr = core->radio_addr; 2072 + cx88_call_i2c_clients(dev->core,TUNER_SET_TYPE_ADDR, &tun_addr); 2073 + } 2074 + if (core->tuner_type != UNSET) { 2075 + tun_addr.v4l2_tuner = V4L2_TUNER_ANALOG_TV; 2076 + tun_addr.type = core->tuner_type; 2077 + tun_addr.addr = core->tuner_addr; 2078 + cx88_call_i2c_clients(dev->core,TUNER_SET_TYPE_ADDR, &tun_addr); 2079 + } 2080 + 2093 2081 if (core->tda9887_conf) 2094 2082 cx88_call_i2c_clients(dev->core,TDA9887_SET_CONFIG,&core->tda9887_conf); 2095 2083 ··· 2196 2162 2197 2163 static int cx8800_suspend(struct pci_dev *pci_dev, pm_message_t state) 2198 2164 { 2199 - struct cx8800_dev *dev = pci_get_drvdata(pci_dev); 2165 + struct cx8800_dev *dev = pci_get_drvdata(pci_dev); 2200 2166 struct cx88_core *core = dev->core; 2201 2167 2202 2168 /* stop video+vbi capture */ ··· 2228 2194 2229 2195 static int cx8800_resume(struct pci_dev *pci_dev) 2230 2196 { 2231 - struct cx8800_dev *dev = pci_get_drvdata(pci_dev); 2197 + struct cx8800_dev *dev = pci_get_drvdata(pci_dev); 2232 2198 struct cx88_core *core = dev->core; 2233 2199 2234 2200 if (dev->state.disabled) { ··· 2264 2230 { 2265 2231 .vendor = 0x14f1, 2266 2232 .device = 0x8800, 2267 - .subvendor = PCI_ANY_ID, 2268 - .subdevice = PCI_ANY_ID, 2233 + .subvendor = PCI_ANY_ID, 2234 + .subdevice = PCI_ANY_ID, 2269 2235 },{ 2270 2236 /* --- end of list --- */ 2271 2237 } ··· 2273 2239 MODULE_DEVICE_TABLE(pci, cx8800_pci_tbl); 2274 2240 2275 2241 static struct pci_driver cx8800_pci_driver = { 2276 - .name = "cx8800", 2277 - .id_table = cx8800_pci_tbl, 2278 - .probe = cx8800_initdev, 2279 - .remove = __devexit_p(cx8800_finidev), 2242 + .name = "cx8800", 2243 + .id_table = cx8800_pci_tbl, 2244 + .probe = cx8800_initdev, 2245 + .remove = __devexit_p(cx8800_finidev), 2280 2246 2281 2247 .suspend = cx8800_suspend, 2282 2248 .resume = cx8800_resume, ··· 2308 2274 * Local variables: 2309 2275 * c-basic-offset: 8 2310 2276 * End: 2277 + * 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 2311 2278 */
+21 -2
drivers/media/video/cx88/cx88.h
··· 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 4 * v4l2 device driver for cx2388x based TV cards 5 5 * ··· 63 63 #define SHADOW_AUD_VOL_CTL 1 64 64 #define SHADOW_AUD_BAL_CTL 2 65 65 #define SHADOW_MAX 2 66 + 67 + /* FM Radio deemphasis type */ 68 + enum cx88_deemph_type { 69 + FM_NO_DEEMPH = 0, 70 + FM_DEEMPH_50, 71 + FM_DEEMPH_75 72 + }; 66 73 67 74 /* ----------------------------------------------------------- */ 68 75 /* tv norms */ ··· 170 163 #define CX88_BOARD_DIGITALLOGIC_MEC 25 171 164 #define CX88_BOARD_IODATA_GVBCTV7E 26 172 165 #define CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO 27 173 - #define CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T 28 166 + #define CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T 28 174 167 175 168 enum cx88_itype { 176 169 CX88_VMUX_COMPOSITE1 = 1, ··· 194 187 struct cx88_board { 195 188 char *name; 196 189 unsigned int tuner_type; 190 + unsigned int radio_type; 191 + unsigned char tuner_addr; 192 + unsigned char radio_addr; 197 193 int tda9887_conf; 198 194 struct cx88_input input[8]; 199 195 struct cx88_input radio; ··· 267 257 /* config info -- analog */ 268 258 unsigned int board; 269 259 unsigned int tuner_type; 260 + unsigned int radio_type; 261 + unsigned char tuner_addr; 262 + unsigned char radio_addr; 270 263 unsigned int tda9887_conf; 271 264 unsigned int has_radio; 272 265 ··· 435 422 /* ----------------------------------------------------------- */ 436 423 /* cx88-core.c */ 437 424 425 + extern char *cx88_pci_irqs[32]; 438 426 extern char *cx88_vid_irqs[32]; 439 427 extern char *cx88_mpeg_irqs[32]; 440 428 extern void cx88_print_irqbits(char *name, char *tag, char **strings, ··· 487 473 /* cx88-vbi.c */ 488 474 489 475 void cx8800_vbi_fmt(struct cx8800_dev *dev, struct v4l2_format *f); 476 + /* 477 + int cx8800_start_vbi_dma(struct cx8800_dev *dev, 478 + struct cx88_dmaqueue *q, 479 + struct cx88_buffer *buf); 480 + */ 490 481 int cx8800_stop_vbi_dma(struct cx8800_dev *dev); 491 482 int cx8800_restart_vbi_queue(struct cx8800_dev *dev, 492 483 struct cx88_dmaqueue *q);
+1 -1
drivers/media/video/ir-kbd-gpio.c
··· 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 4 * Copyright (c) 2003 Gerd Knorr 5 5 * Copyright (c) 2003 Pavel Machek