[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 /* 2 - * $Id: cx88-blackbird.c,v 1.26 2005/03/07 15:58:05 kraxel Exp $ 3 * 4 * Support for a cx23416 mpeg encoder via cx2388x host port. 5 * "blackbird" reference design. ··· 61 62 #define IVTV_CMD_HW_BLOCKS_RST 0xFFFFFFFF 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 95 96 /* Registers */ 97 #define IVTV_REG_ENC_SDRAM_REFRESH (0x07F8 /*| IVTV_REG_OFFSET*/) ··· 672 return 0; 673 } 674 675 static void blackbird_codec_settings(struct cx8802_dev *dev) 676 { 677 int bitrate_mode = 1; 678 int bitrate = 7500000; 679 int bitrate_peak = 7500000; 680 681 /* 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 */ 686 687 - /* assign output port */ 688 - blackbird_api_cmd(dev, IVTV_API_ASSIGN_OUTPUT_PORT, 1, 0, 1); /* 1 = Host */ 689 690 - /* assign framerate */ 691 - blackbird_api_cmd(dev, IVTV_API_ASSIGN_FRAMERATE, 1, 0, 0); 692 693 - /* assign frame size */ 694 - blackbird_api_cmd(dev, IVTV_API_ASSIGN_FRAME_SIZE, 2, 0, 695 dev->height, dev->width); 696 697 - /* assign aspect ratio */ 698 - blackbird_api_cmd(dev, IVTV_API_ASSIGN_ASPECT_RATIO, 1, 0, 2); 699 700 - /* assign bitrates */ 701 - blackbird_api_cmd(dev, IVTV_API_ASSIGN_BITRATES, 5, 0, 702 bitrate_mode, /* mode */ 703 bitrate, /* bps */ 704 - bitrate_peak / 400, /* peak/400 */ 705 - 0, 0x70); /* encoding buffer, ckennedy */ 706 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); 710 711 - /* assign 3 2 pulldown */ 712 - blackbird_api_cmd(dev, IVTV_API_ASSIGN_3_2_PULLDOWN, 1, 0, 0); 713 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)); 716 717 /* assign gop closure */ 718 - blackbird_api_cmd(dev, IVTV_API_ASSIGN_GOP_CLOSURE, 1, 0, 0); 719 720 - /* assign audio properties */ 721 - blackbird_api_cmd(dev, IVTV_API_ASSIGN_AUDIO_PROPERTIES, 1, 0, 0 | (2 << 2) | (14 << 4)); 722 723 - /* assign dnr filter mode */ 724 - blackbird_api_cmd(dev, IVTV_API_ASSIGN_DNR_FILTER_MODE, 2, 0, 0, 0); 725 726 - /* assign dnr filter props*/ 727 - blackbird_api_cmd(dev, IVTV_API_ASSIGN_DNR_FILTER_PROPS, 2, 0, 0, 0); 728 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); 731 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); 734 735 - /* assign frame drop rate */ 736 - blackbird_api_cmd(dev, IVTV_API_ASSIGN_FRAME_DROP_RATE, 1, 0, 0); 737 } 738 739 static int blackbird_initialize_codec(struct cx8802_dev *dev) ··· 775 int retval; 776 777 dprintk(1,"Initialize codec\n"); 778 - retval = blackbird_api_cmd(dev, IVTV_API_ENC_PING_FW, 0, 0); /* ping */ 779 if (retval < 0) { 780 /* ping was not successful, reset and upload firmware */ 781 cx_write(MO_SRST_IO, 0); /* SYS_RSTO=0 */ ··· 790 if (dev->mailbox < 0) 791 return -1; 792 793 - retval = blackbird_api_cmd(dev, IVTV_API_ENC_PING_FW, 0, 0); /* ping */ 794 if (retval < 0) { 795 dprintk(0, "ERROR: Firmware ping failed!\n"); 796 return -1; 797 } 798 799 - retval = blackbird_api_cmd(dev, IVTV_API_ENC_GETVER, 0, 1, &version); 800 if (retval < 0) { 801 dprintk(0, "ERROR: Firmware get encoder version failed!\n"); 802 return -1; ··· 816 blackbird_codec_settings(dev); 817 msleep(1); 818 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); 823 824 - blackbird_api_cmd(dev, IVTV_API_INITIALIZE_INPUT, 0, 0); /* initialize the video input */ 825 826 msleep(1); 827 828 - blackbird_api_cmd(dev, IVTV_API_MUTE_VIDEO, 1, 0, 0); 829 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 */ 835 msleep(1); 836 837 - blackbird_api_cmd(dev, IVTV_API_REFRESH_INPUT, 0,0); 838 return 0; 839 } 840 ··· 1019 { 1020 struct cx8802_fh *fh = file->private_data; 1021 1022 - blackbird_api_cmd(fh->dev, IVTV_API_END_CAPTURE, 3, 0, 1, 0, 0x13); 1023 1024 /* stop mpeg capture */ 1025 if (fh->mpegq.streaming) ··· 1223 * Local variables: 1224 * c-basic-offset: 8 1225 * End: 1226 */
··· 1 /* 2 + * $Id: cx88-blackbird.c,v 1.27 2005/06/03 13:31:50 mchehab Exp $ 3 * 4 * Support for a cx23416 mpeg encoder via cx2388x host port. 5 * "blackbird" reference design. ··· 61 62 #define IVTV_CMD_HW_BLOCKS_RST 0xFFFFFFFF 63 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 362 363 /* Registers */ 364 #define IVTV_REG_ENC_SDRAM_REFRESH (0x07F8 /*| IVTV_REG_OFFSET*/) ··· 405 return 0; 406 } 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 + */ 421 static void blackbird_codec_settings(struct cx8802_dev *dev) 422 { 423 int bitrate_mode = 1; 424 int bitrate = 7500000; 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 431 432 /* assign stream type */ 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); */ 435 436 + /* assign output port */ 437 + blackbird_api_cmd(dev, BLACKBIRD_API_SET_OUTPUT_PORT, 1, 0, BLACKBIRD_OUTPUT_PORT_STREAMING); /* Host */ 438 439 + /* assign framerate */ 440 + blackbird_api_cmd(dev, BLACKBIRD_API_SET_FRAMERATE, 1, 0, BLACKBIRD_FRAMERATE_PAL_25); 441 442 + /* assign frame size */ 443 + blackbird_api_cmd(dev, BLACKBIRD_API_SET_RESOLUTION, 2, 0, 444 dev->height, dev->width); 445 446 + /* assign aspect ratio */ 447 + blackbird_api_cmd(dev, BLACKBIRD_API_SET_ASPECT_RATIO, 1, 0, BLACKBIRD_ASPECT_RATIO_4_3); 448 449 + /* assign bitrates */ 450 + blackbird_api_cmd(dev, BLACKBIRD_API_SET_VIDEO_BITRATE, 5, 0, 451 bitrate_mode, /* mode */ 452 bitrate, /* bps */ 453 + bitrate_peak / BLACKBIRD_PEAK_RATE_DIVISOR, /* peak/400 */ 454 + BLACKBIRD_MUX_RATE_DEFAULT /*, 0x70*/); /* encoding buffer, ckennedy */ 455 456 + /* assign gop properties */ 457 + blackbird_api_cmd(dev, BLACKBIRD_API_SET_GOP_STRUCTURE, 2, 0, 15, 3); 458 459 + /* assign 3 2 pulldown */ 460 + blackbird_api_cmd(dev, BLACKBIRD_API_SET_3_2_PULLDOWN, 1, 0, BLACKBIRD_3_2_PULLDOWN_DISABLED); 461 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 + ); 477 478 /* assign gop closure */ 479 + blackbird_api_cmd(dev, BLACKBIRD_API_SET_GOP_CLOSURE, 1, 0, BLACKBIRD_GOP_CLOSURE_OFF); 480 481 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 + ); 487 488 + /* assign dnr filter props*/ 489 + blackbird_api_cmd(dev, BLACKBIRD_API_SET_MANUAL_DNR, 2, 0, 0, 0); 490 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); 493 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 + ); 499 500 + /* assign frame drop rate */ 501 + /* blackbird_api_cmd(dev, IVTV_API_ASSIGN_FRAME_DROP_RATE, 1, 0, 0); */ 502 } 503 504 static int blackbird_initialize_codec(struct cx8802_dev *dev) ··· 476 int retval; 477 478 dprintk(1,"Initialize codec\n"); 479 + retval = blackbird_api_cmd(dev, BLACKBIRD_API_PING, 0, 0); /* ping */ 480 if (retval < 0) { 481 /* ping was not successful, reset and upload firmware */ 482 cx_write(MO_SRST_IO, 0); /* SYS_RSTO=0 */ ··· 491 if (dev->mailbox < 0) 492 return -1; 493 494 + retval = blackbird_api_cmd(dev, BLACKBIRD_API_PING, 0, 0); /* ping */ 495 if (retval < 0) { 496 dprintk(0, "ERROR: Firmware ping failed!\n"); 497 return -1; 498 } 499 500 + retval = blackbird_api_cmd(dev, BLACKBIRD_API_GET_VERSION, 0, 1, &version); 501 if (retval < 0) { 502 dprintk(0, "ERROR: Firmware get encoder version failed!\n"); 503 return -1; ··· 517 blackbird_codec_settings(dev); 518 msleep(1); 519 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 + ); 527 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 */ 534 535 msleep(1); 536 537 + blackbird_api_cmd(dev, BLACKBIRD_API_MUTE_VIDEO, 1, 0, BLACKBIRD_UNMUTE); 538 msleep(1); 539 + blackbird_api_cmd(dev, BLACKBIRD_API_MUTE_AUDIO, 1, 0, BLACKBIRD_UNMUTE); 540 msleep(1); 541 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); 550 return 0; 551 } 552 ··· 709 { 710 struct cx8802_fh *fh = file->private_data; 711 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 + ); 718 719 /* stop mpeg capture */ 720 if (fh->mpegq.streaming) ··· 908 * Local variables: 909 * c-basic-offset: 8 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 912 */
+161 -74
drivers/media/video/cx88/cx88-cards.c
··· 1 /* 2 - * $Id: cx88-cards.c,v 1.66 2005/03/04 09:12:23 kraxel Exp $ 3 * 4 * device driver for Conexant 2388x based TV cards 5 * card-specific stuff. ··· 35 [CX88_BOARD_UNKNOWN] = { 36 .name = "UNKNOWN/GENERIC", 37 .tuner_type = UNSET, 38 .input = {{ 39 .type = CX88_VMUX_COMPOSITE1, 40 .vmux = 0, ··· 55 [CX88_BOARD_HAUPPAUGE] = { 56 .name = "Hauppauge WinTV 34xxx models", 57 .tuner_type = UNSET, 58 .tda9887_conf = TDA9887_PRESENT, 59 .input = {{ 60 .type = CX88_VMUX_TELEVISION, ··· 84 [CX88_BOARD_GDI] = { 85 .name = "GDI Black Gold", 86 .tuner_type = UNSET, 87 .input = {{ 88 .type = CX88_VMUX_TELEVISION, 89 .vmux = 0, ··· 94 }, 95 [CX88_BOARD_PIXELVIEW] = { 96 .name = "PixelView", 97 - .tuner_type = 5, 98 .input = {{ 99 .type = CX88_VMUX_TELEVISION, 100 .vmux = 0, ··· 116 }, 117 [CX88_BOARD_ATI_WONDER_PRO] = { 118 .name = "ATI TV Wonder Pro", 119 - .tuner_type = 44, 120 .tda9887_conf = TDA9887_PRESENT | TDA9887_INTERCARRIER, 121 .input = {{ 122 .type = CX88_VMUX_TELEVISION, ··· 137 }, 138 [CX88_BOARD_WINFAST2000XP_EXPERT] = { 139 .name = "Leadtek Winfast 2000XP Expert", 140 - .tuner_type = 44, 141 .tda9887_conf = TDA9887_PRESENT, 142 .input = {{ 143 .type = CX88_VMUX_TELEVISION, ··· 174 }, 175 [CX88_BOARD_AVERTV_303] = { 176 .name = "AverTV Studio 303 (M126)", 177 - .tuner_type = 38, 178 .tda9887_conf = TDA9887_PRESENT, 179 .input = {{ 180 .type = CX88_VMUX_TELEVISION, ··· 200 // added gpio values thanks to Michal 201 // values for PAL from DScaler 202 .name = "MSI TV-@nywhere Master", 203 - .tuner_type = 33, 204 .tda9887_conf = TDA9887_PRESENT, 205 .input = {{ 206 .type = CX88_VMUX_TELEVISION, ··· 230 }, 231 [CX88_BOARD_WINFAST_DV2000] = { 232 .name = "Leadtek Winfast DV2000", 233 - .tuner_type = 38, 234 .tda9887_conf = TDA9887_PRESENT, 235 .input = {{ 236 .type = CX88_VMUX_TELEVISION, ··· 266 .gpio3 = 0x02000000, 267 }, 268 }, 269 - [CX88_BOARD_LEADTEK_PVR2000] = { 270 // gpio values for PAL version from regspy by DScaler 271 - .name = "Leadtek PVR 2000", 272 - .tuner_type = 38, 273 .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 - }, 291 .blackbird = 1, 292 - }, 293 [CX88_BOARD_IODATA_GVVCP3PCI] = { 294 .name = "IODATA GV-VCP3/PCI", 295 .tuner_type = TUNER_ABSENT, 296 - .input = {{ 297 .type = CX88_VMUX_COMPOSITE1, 298 .vmux = 0, 299 },{ ··· 312 }, 313 [CX88_BOARD_PROLINK_PLAYTVPVR] = { 314 .name = "Prolink PlayTV PVR", 315 - .tuner_type = 43, 316 .tda9887_conf = TDA9887_PRESENT, 317 .input = {{ 318 .type = CX88_VMUX_TELEVISION, ··· 337 }, 338 [CX88_BOARD_ASUS_PVR_416] = { 339 .name = "ASUS PVR-416", 340 - .tuner_type = 43, 341 - .tda9887_conf = TDA9887_PRESENT, 342 .input = {{ 343 .type = CX88_VMUX_TELEVISION, 344 .vmux = 0, ··· 359 }, 360 [CX88_BOARD_MSI_TVANYWHERE] = { 361 .name = "MSI TV-@nywhere", 362 - .tuner_type = 33, 363 .tda9887_conf = TDA9887_PRESENT, 364 .input = {{ 365 .type = CX88_VMUX_TELEVISION, ··· 384 [CX88_BOARD_KWORLD_DVB_T] = { 385 .name = "KWorld/VStream XPert DVB-T", 386 .tuner_type = TUNER_ABSENT, 387 .input = {{ 388 .type = CX88_VMUX_COMPOSITE1, 389 .vmux = 1, ··· 403 [CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1] = { 404 .name = "DVICO FusionHDTV DVB-T1", 405 .tuner_type = TUNER_ABSENT, /* No analog tuner */ 406 .input = {{ 407 .type = CX88_VMUX_COMPOSITE1, 408 .vmux = 1, ··· 419 }, 420 [CX88_BOARD_KWORLD_LTV883] = { 421 .name = "KWorld LTV883RF", 422 - .tuner_type = 48, 423 .input = {{ 424 .type = CX88_VMUX_TELEVISION, 425 .vmux = 0, ··· 448 [CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD] = { 449 .name = "DViCO - FusionHDTV 3 Gold", 450 .tuner_type = TUNER_MICROTUNE_4042FI5, 451 /* 452 GPIO[0] resets DT3302 DTV receiver 453 0 - reset asserted ··· 483 .gpio0 = 0x0f00, 484 }}, 485 }, 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 [CX88_BOARD_HAUPPAUGE_DVB_T1] = { 509 - .name = "Hauppauge Nova-T DVB-T", 510 .tuner_type = TUNER_ABSENT, 511 - .input = {{ 512 .type = CX88_VMUX_DVB, 513 .vmux = 0, 514 }}, ··· 498 [CX88_BOARD_CONEXANT_DVB_T1] = { 499 .name = "Conexant DVB-T reference design", 500 .tuner_type = TUNER_ABSENT, 501 .input = {{ 502 .type = CX88_VMUX_DVB, 503 .vmux = 0, ··· 510 [CX88_BOARD_PROVIDEO_PV259] = { 511 .name = "Provideo PV259", 512 .tuner_type = TUNER_PHILIPS_FQ1216ME, 513 .input = {{ 514 .type = CX88_VMUX_TELEVISION, 515 .vmux = 0, ··· 522 [CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS] = { 523 .name = "DVICO FusionHDTV DVB-T Plus", 524 .tuner_type = TUNER_ABSENT, /* No analog tuner */ 525 .input = {{ 526 .type = CX88_VMUX_COMPOSITE1, 527 .vmux = 1, ··· 539 [CX88_BOARD_DNTV_LIVE_DVB_T] = { 540 .name = "digitalnow DNTV Live! DVB-T", 541 .tuner_type = TUNER_ABSENT, 542 .input = {{ 543 .type = CX88_VMUX_COMPOSITE1, 544 .vmux = 1, ··· 558 [CX88_BOARD_PCHDTV_HD3000] = { 559 .name = "pcHDTV HD3000 HDTV", 560 .tuner_type = TUNER_THOMSON_DTT7610, 561 .input = {{ 562 .type = CX88_VMUX_TELEVISION, 563 .vmux = 0, ··· 596 [CX88_BOARD_HAUPPAUGE_ROSLYN] = { 597 // entry added by Kaustubh D. Bhalerao <bhalerao.1@osu.edu> 598 // GPIO values obtained from regspy, courtesy Sean Covel 599 - .name = "Hauppauge WinTV 28xxx (Roslyn) models", 600 - .tuner_type = UNSET, 601 .input = {{ 602 .type = CX88_VMUX_TELEVISION, 603 .vmux = 0, ··· 628 .blackbird = 1, 629 }, 630 [CX88_BOARD_DIGITALLOGIC_MEC] = { 631 - /* params copied over from Leadtek PVR 2000 */ 632 .name = "Digital-Logic MICROSPACE Entertainment Center (MEC)", 633 - /* not sure yet about the tuner type */ 634 - .tuner_type = 38, 635 .tda9887_conf = TDA9887_PRESENT, 636 .input = {{ 637 .type = CX88_VMUX_TELEVISION, 638 .vmux = 0, 639 - .gpio0 = 0x0000bde6, 640 },{ 641 .type = CX88_VMUX_COMPOSITE1, 642 .vmux = 1, 643 - .gpio0 = 0x0000bde6, 644 },{ 645 .type = CX88_VMUX_SVIDEO, 646 .vmux = 2, 647 - .gpio0 = 0x0000bde6, 648 }}, 649 .radio = { 650 .type = CX88_RADIO, 651 - .gpio0 = 0x0000bd62, 652 }, 653 .blackbird = 1, 654 }, 655 [CX88_BOARD_IODATA_GVBCTV7E] = { 656 .name = "IODATA GV/BCTV7E", 657 .tuner_type = TUNER_PHILIPS_FQ1286, 658 .tda9887_conf = TDA9887_PRESENT, 659 .input = {{ 660 .type = CX88_VMUX_TELEVISION, ··· 676 }, 677 [CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO] = { 678 .name = "PixelView PlayTV Ultra Pro (Stereo)", 679 - .tuner_type = 38, 680 .input = {{ 681 .type = CX88_VMUX_TELEVISION, 682 .vmux = 0, 683 - .gpio0 = 0xbf61, // internal decoder 684 },{ 685 .type = CX88_VMUX_COMPOSITE1, 686 .vmux = 1, 687 - .gpio0 = 0xbf63, 688 },{ 689 .type = CX88_VMUX_SVIDEO, 690 .vmux = 2, 691 - .gpio0 = 0xbf63, 692 }}, 693 .radio = { 694 - .type = CX88_RADIO, 695 - .gpio0 = 0xbf60, 696 - }, 697 }, 698 }; 699 const unsigned int cx88_bcount = ARRAY_SIZE(cx88_boards); 700 ··· 1062 * Local variables: 1063 * c-basic-offset: 8 1064 * End: 1065 */
··· 1 /* 2 + * $Id: cx88-cards.c,v 1.76 2005/06/08 01:28:09 mchehab Exp $ 3 * 4 * device driver for Conexant 2388x based TV cards 5 * card-specific stuff. ··· 35 [CX88_BOARD_UNKNOWN] = { 36 .name = "UNKNOWN/GENERIC", 37 .tuner_type = UNSET, 38 + .radio_type = UNSET, 39 + .tuner_addr = ADDR_UNSET, 40 + .radio_addr = ADDR_UNSET, 41 .input = {{ 42 .type = CX88_VMUX_COMPOSITE1, 43 .vmux = 0, ··· 52 [CX88_BOARD_HAUPPAUGE] = { 53 .name = "Hauppauge WinTV 34xxx models", 54 .tuner_type = UNSET, 55 + .radio_type = UNSET, 56 + .tuner_addr = ADDR_UNSET, 57 + .radio_addr = ADDR_UNSET, 58 .tda9887_conf = TDA9887_PRESENT, 59 .input = {{ 60 .type = CX88_VMUX_TELEVISION, ··· 78 [CX88_BOARD_GDI] = { 79 .name = "GDI Black Gold", 80 .tuner_type = UNSET, 81 + .radio_type = UNSET, 82 + .tuner_addr = ADDR_UNSET, 83 + .radio_addr = ADDR_UNSET, 84 .input = {{ 85 .type = CX88_VMUX_TELEVISION, 86 .vmux = 0, ··· 85 }, 86 [CX88_BOARD_PIXELVIEW] = { 87 .name = "PixelView", 88 + .tuner_type = TUNER_PHILIPS_PAL, 89 + .radio_type = UNSET, 90 + .tuner_addr = ADDR_UNSET, 91 + .radio_addr = ADDR_UNSET, 92 .input = {{ 93 .type = CX88_VMUX_TELEVISION, 94 .vmux = 0, ··· 104 }, 105 [CX88_BOARD_ATI_WONDER_PRO] = { 106 .name = "ATI TV Wonder Pro", 107 + .tuner_type = TUNER_PHILIPS_4IN1, 108 + .radio_type = UNSET, 109 + .tuner_addr = ADDR_UNSET, 110 + .radio_addr = ADDR_UNSET, 111 .tda9887_conf = TDA9887_PRESENT | TDA9887_INTERCARRIER, 112 .input = {{ 113 .type = CX88_VMUX_TELEVISION, ··· 122 }, 123 [CX88_BOARD_WINFAST2000XP_EXPERT] = { 124 .name = "Leadtek Winfast 2000XP Expert", 125 + .tuner_type = TUNER_PHILIPS_4IN1, 126 + .radio_type = UNSET, 127 + .tuner_addr = ADDR_UNSET, 128 + .radio_addr = ADDR_UNSET, 129 .tda9887_conf = TDA9887_PRESENT, 130 .input = {{ 131 .type = CX88_VMUX_TELEVISION, ··· 156 }, 157 [CX88_BOARD_AVERTV_303] = { 158 .name = "AverTV Studio 303 (M126)", 159 + .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, 160 + .radio_type = UNSET, 161 + .tuner_addr = ADDR_UNSET, 162 + .radio_addr = ADDR_UNSET, 163 .tda9887_conf = TDA9887_PRESENT, 164 .input = {{ 165 .type = CX88_VMUX_TELEVISION, ··· 179 // added gpio values thanks to Michal 180 // values for PAL from DScaler 181 .name = "MSI TV-@nywhere Master", 182 + .tuner_type = TUNER_MT2032, 183 + .radio_type = UNSET, 184 + .tuner_addr = ADDR_UNSET, 185 + .radio_addr = ADDR_UNSET, 186 .tda9887_conf = TDA9887_PRESENT, 187 .input = {{ 188 .type = CX88_VMUX_TELEVISION, ··· 206 }, 207 [CX88_BOARD_WINFAST_DV2000] = { 208 .name = "Leadtek Winfast DV2000", 209 + .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, 210 + .radio_type = UNSET, 211 + .tuner_addr = ADDR_UNSET, 212 + .radio_addr = ADDR_UNSET, 213 .tda9887_conf = TDA9887_PRESENT, 214 .input = {{ 215 .type = CX88_VMUX_TELEVISION, ··· 239 .gpio3 = 0x02000000, 240 }, 241 }, 242 + [CX88_BOARD_LEADTEK_PVR2000] = { 243 // gpio values for PAL version from regspy by DScaler 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, 249 .tda9887_conf = TDA9887_PRESENT, 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 + }, 267 .blackbird = 1, 268 + }, 269 [CX88_BOARD_IODATA_GVVCP3PCI] = { 270 .name = "IODATA GV-VCP3/PCI", 271 .tuner_type = TUNER_ABSENT, 272 + .radio_type = UNSET, 273 + .tuner_addr = ADDR_UNSET, 274 + .radio_addr = ADDR_UNSET, 275 + .input = {{ 276 .type = CX88_VMUX_COMPOSITE1, 277 .vmux = 0, 278 },{ ··· 279 }, 280 [CX88_BOARD_PROLINK_PLAYTVPVR] = { 281 .name = "Prolink PlayTV PVR", 282 + .tuner_type = TUNER_PHILIPS_FM1236_MK3, 283 + .radio_type = UNSET, 284 + .tuner_addr = ADDR_UNSET, 285 + .radio_addr = ADDR_UNSET, 286 .tda9887_conf = TDA9887_PRESENT, 287 .input = {{ 288 .type = CX88_VMUX_TELEVISION, ··· 301 }, 302 [CX88_BOARD_ASUS_PVR_416] = { 303 .name = "ASUS PVR-416", 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, 309 .input = {{ 310 .type = CX88_VMUX_TELEVISION, 311 .vmux = 0, ··· 320 }, 321 [CX88_BOARD_MSI_TVANYWHERE] = { 322 .name = "MSI TV-@nywhere", 323 + .tuner_type = TUNER_MT2032, 324 + .radio_type = UNSET, 325 + .tuner_addr = ADDR_UNSET, 326 + .radio_addr = ADDR_UNSET, 327 .tda9887_conf = TDA9887_PRESENT, 328 .input = {{ 329 .type = CX88_VMUX_TELEVISION, ··· 342 [CX88_BOARD_KWORLD_DVB_T] = { 343 .name = "KWorld/VStream XPert DVB-T", 344 .tuner_type = TUNER_ABSENT, 345 + .radio_type = UNSET, 346 + .tuner_addr = ADDR_UNSET, 347 + .radio_addr = ADDR_UNSET, 348 .input = {{ 349 .type = CX88_VMUX_COMPOSITE1, 350 .vmux = 1, ··· 358 [CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1] = { 359 .name = "DVICO FusionHDTV DVB-T1", 360 .tuner_type = TUNER_ABSENT, /* No analog tuner */ 361 + .radio_type = UNSET, 362 + .tuner_addr = ADDR_UNSET, 363 + .radio_addr = ADDR_UNSET, 364 .input = {{ 365 .type = CX88_VMUX_COMPOSITE1, 366 .vmux = 1, ··· 371 }, 372 [CX88_BOARD_KWORLD_LTV883] = { 373 .name = "KWorld LTV883RF", 374 + .tuner_type = TUNER_TNF_8831BGFF, 375 + .radio_type = UNSET, 376 + .tuner_addr = ADDR_UNSET, 377 + .radio_addr = ADDR_UNSET, 378 .input = {{ 379 .type = CX88_VMUX_TELEVISION, 380 .vmux = 0, ··· 397 [CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD] = { 398 .name = "DViCO - FusionHDTV 3 Gold", 399 .tuner_type = TUNER_MICROTUNE_4042FI5, 400 + .radio_type = UNSET, 401 + .tuner_addr = ADDR_UNSET, 402 + .radio_addr = ADDR_UNSET, 403 /* 404 GPIO[0] resets DT3302 DTV receiver 405 0 - reset asserted ··· 429 .gpio0 = 0x0f00, 430 }}, 431 }, 432 [CX88_BOARD_HAUPPAUGE_DVB_T1] = { 433 + .name = "Hauppauge Nova-T DVB-T", 434 .tuner_type = TUNER_ABSENT, 435 + .radio_type = UNSET, 436 + .tuner_addr = ADDR_UNSET, 437 + .radio_addr = ADDR_UNSET, 438 + .input = {{ 439 .type = CX88_VMUX_DVB, 440 .vmux = 0, 441 }}, ··· 463 [CX88_BOARD_CONEXANT_DVB_T1] = { 464 .name = "Conexant DVB-T reference design", 465 .tuner_type = TUNER_ABSENT, 466 + .radio_type = UNSET, 467 + .tuner_addr = ADDR_UNSET, 468 + .radio_addr = ADDR_UNSET, 469 .input = {{ 470 .type = CX88_VMUX_DVB, 471 .vmux = 0, ··· 472 [CX88_BOARD_PROVIDEO_PV259] = { 473 .name = "Provideo PV259", 474 .tuner_type = TUNER_PHILIPS_FQ1216ME, 475 + .radio_type = UNSET, 476 + .tuner_addr = ADDR_UNSET, 477 + .radio_addr = ADDR_UNSET, 478 .input = {{ 479 .type = CX88_VMUX_TELEVISION, 480 .vmux = 0, ··· 481 [CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS] = { 482 .name = "DVICO FusionHDTV DVB-T Plus", 483 .tuner_type = TUNER_ABSENT, /* No analog tuner */ 484 + .radio_type = UNSET, 485 + .tuner_addr = ADDR_UNSET, 486 + .radio_addr = ADDR_UNSET, 487 .input = {{ 488 .type = CX88_VMUX_COMPOSITE1, 489 .vmux = 1, ··· 495 [CX88_BOARD_DNTV_LIVE_DVB_T] = { 496 .name = "digitalnow DNTV Live! DVB-T", 497 .tuner_type = TUNER_ABSENT, 498 + .radio_type = UNSET, 499 + .tuner_addr = ADDR_UNSET, 500 + .radio_addr = ADDR_UNSET, 501 .input = {{ 502 .type = CX88_VMUX_COMPOSITE1, 503 .vmux = 1, ··· 511 [CX88_BOARD_PCHDTV_HD3000] = { 512 .name = "pcHDTV HD3000 HDTV", 513 .tuner_type = TUNER_THOMSON_DTT7610, 514 + .radio_type = UNSET, 515 + .tuner_addr = ADDR_UNSET, 516 + .radio_addr = ADDR_UNSET, 517 .input = {{ 518 .type = CX88_VMUX_TELEVISION, 519 .vmux = 0, ··· 546 [CX88_BOARD_HAUPPAUGE_ROSLYN] = { 547 // entry added by Kaustubh D. Bhalerao <bhalerao.1@osu.edu> 548 // GPIO values obtained from regspy, courtesy Sean Covel 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, 554 .input = {{ 555 .type = CX88_VMUX_TELEVISION, 556 .vmux = 0, ··· 575 .blackbird = 1, 576 }, 577 [CX88_BOARD_DIGITALLOGIC_MEC] = { 578 .name = "Digital-Logic MICROSPACE Entertainment Center (MEC)", 579 + .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, 580 + .radio_type = UNSET, 581 + .tuner_addr = ADDR_UNSET, 582 + .radio_addr = ADDR_UNSET, 583 .tda9887_conf = TDA9887_PRESENT, 584 .input = {{ 585 .type = CX88_VMUX_TELEVISION, 586 .vmux = 0, 587 + .gpio0 = 0x00009d80, 588 },{ 589 .type = CX88_VMUX_COMPOSITE1, 590 .vmux = 1, 591 + .gpio0 = 0x00009d76, 592 },{ 593 .type = CX88_VMUX_SVIDEO, 594 .vmux = 2, 595 + .gpio0 = 0x00009d76, 596 }}, 597 .radio = { 598 .type = CX88_RADIO, 599 + .gpio0 = 0x00009d00, 600 }, 601 .blackbird = 1, 602 }, 603 [CX88_BOARD_IODATA_GVBCTV7E] = { 604 .name = "IODATA GV/BCTV7E", 605 .tuner_type = TUNER_PHILIPS_FQ1286, 606 + .radio_type = UNSET, 607 + .tuner_addr = ADDR_UNSET, 608 + .radio_addr = ADDR_UNSET, 609 .tda9887_conf = TDA9887_PRESENT, 610 .input = {{ 611 .type = CX88_VMUX_TELEVISION, ··· 619 }, 620 [CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO] = { 621 .name = "PixelView PlayTV Ultra Pro (Stereo)", 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, 627 .input = {{ 628 .type = CX88_VMUX_TELEVISION, 629 .vmux = 0, 630 + .gpio0 = 0xbf61, /* internal decoder */ 631 },{ 632 .type = CX88_VMUX_COMPOSITE1, 633 .vmux = 1, 634 + .gpio0 = 0xbf63, 635 },{ 636 .type = CX88_VMUX_SVIDEO, 637 .vmux = 2, 638 + .gpio0 = 0xbf63, 639 }}, 640 .radio = { 641 + .type = CX88_RADIO, 642 + .gpio0 = 0xbf60, 643 + }, 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 + }, 670 }; 671 const unsigned int cx88_bcount = ARRAY_SIZE(cx88_boards); 672 ··· 976 * Local variables: 977 * c-basic-offset: 8 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 980 */
+17 -2
drivers/media/video/cx88/cx88-core.c
··· 1 /* 2 - * $Id: cx88-core.c,v 1.24 2005/01/19 12:01:55 kraxel Exp $ 3 * 4 * device driver for Conexant 2388x based TV cards 5 * driver core ··· 51 MODULE_PARM_DESC(latency,"pci latency timer"); 52 53 static unsigned int tuner[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET }; 54 static unsigned int card[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET }; 55 56 module_param_array(tuner, int, NULL, 0444); 57 module_param_array(card, int, NULL, 0444); 58 59 MODULE_PARM_DESC(tuner,"tuner type"); 60 MODULE_PARM_DESC(card,"card type"); 61 62 static unsigned int nicam = 0; ··· 432 /* ------------------------------------------------------------------ */ 433 /* debug helper code */ 434 435 - static int cx88_risc_decode(u32 risc) 436 { 437 static char *instr[16] = { 438 [ RISC_SYNC >> 28 ] = "sync", ··· 1176 "insmod option" : "autodetected"); 1177 1178 core->tuner_type = tuner[core->nr]; 1179 if (UNSET == core->tuner_type) 1180 core->tuner_type = cx88_boards[core->board].tuner_type; 1181 core->tda9887_conf = cx88_boards[core->board].tda9887_conf; 1182 1183 /* init hardware */
··· 1 /* 2 + * $Id: cx88-core.c,v 1.28 2005/06/12 04:19:19 mchehab Exp $ 3 * 4 * device driver for Conexant 2388x based TV cards 5 * driver core ··· 51 MODULE_PARM_DESC(latency,"pci latency timer"); 52 53 static unsigned int tuner[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET }; 54 + static unsigned int radio[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET }; 55 static unsigned int card[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET }; 56 57 module_param_array(tuner, int, NULL, 0444); 58 + module_param_array(radio, int, NULL, 0444); 59 module_param_array(card, int, NULL, 0444); 60 61 MODULE_PARM_DESC(tuner,"tuner type"); 62 + MODULE_PARM_DESC(radio,"radio tuner type"); 63 MODULE_PARM_DESC(card,"card type"); 64 65 static unsigned int nicam = 0; ··· 429 /* ------------------------------------------------------------------ */ 430 /* debug helper code */ 431 432 + int cx88_risc_decode(u32 risc) 433 { 434 static char *instr[16] = { 435 [ RISC_SYNC >> 28 ] = "sync", ··· 1173 "insmod option" : "autodetected"); 1174 1175 core->tuner_type = tuner[core->nr]; 1176 + core->radio_type = radio[core->nr]; 1177 if (UNSET == core->tuner_type) 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 + 1190 core->tda9887_conf = cx88_boards[core->board].tda9887_conf; 1191 1192 /* init hardware */
+1 -1
drivers/media/video/cx88/cx88-dvb.c
··· 1 /* 2 - * $Id: cx88-dvb.c,v 1.31 2005/03/07 15:58:05 kraxel Exp $ 3 * 4 * device driver for Conexant 2388x based TV cards 5 * MPEG Transport Stream (DVB) routines
··· 1 /* 2 + * $Id: cx88-dvb.c,v 1.33 2005/06/12 04:19:19 mchehab Exp $ 3 * 4 * device driver for Conexant 2388x based TV cards 5 * MPEG Transport Stream (DVB) routines
+15 -3
drivers/media/video/cx88/cx88-i2c.c
··· 1 /* 2 - $Id: cx88-i2c.c,v 1.20 2005/02/15 15:59:35 kraxel Exp $ 3 4 cx88-i2c.c -- all the i2c code is here 5 ··· 91 92 static int attach_inform(struct i2c_client *client) 93 { 94 struct cx88_core *core = i2c_get_adapdata(client->adapter); 95 96 dprintk(1, "i2c attach [addr=0x%x,client=%s]\n", ··· 99 if (!client->driver->command) 100 return 0; 101 102 - if (core->tuner_type != UNSET) 103 - client->driver->command(client, TUNER_SET_TYPE, &core->tuner_type); 104 if (core->tda9887_conf) 105 client->driver->command(client, TDA9887_SET_CONFIG, &core->tda9887_conf); 106 return 0;
··· 1 /* 2 + $Id: cx88-i2c.c,v 1.23 2005/06/12 04:19:19 mchehab Exp $ 3 4 cx88-i2c.c -- all the i2c code is here 5 ··· 91 92 static int attach_inform(struct i2c_client *client) 93 { 94 + struct tuner_addr tun_addr; 95 struct cx88_core *core = i2c_get_adapdata(client->adapter); 96 97 dprintk(1, "i2c attach [addr=0x%x,client=%s]\n", ··· 98 if (!client->driver->command) 99 return 0; 100 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 + 114 if (core->tda9887_conf) 115 client->driver->command(client, TDA9887_SET_CONFIG, &core->tda9887_conf); 116 return 0;
+3 -1
drivers/media/video/cx88/cx88-input.c
··· 1 /* 2 - * $Id: cx88-input.c,v 1.9 2005/03/04 09:12:23 kraxel Exp $ 3 * 4 * Device driver for GPIO attached remote control interfaces 5 * on Conexant 2388x based TV/DVB cards. ··· 235 /* detect & configure */ 236 switch (core->board) { 237 case CX88_BOARD_DNTV_LIVE_DVB_T: 238 ir_codes = ir_codes_dntv_live_dvb_t; 239 ir->gpio_addr = MO_GP1_IO; 240 ir->mask_keycode = 0x1f; ··· 270 ir->polling = 1; // ms 271 break; 272 } 273 if (NULL == ir_codes) { 274 kfree(ir); 275 return -ENODEV;
··· 1 /* 2 + * $Id: cx88-input.c,v 1.11 2005/05/22 20:57:56 nsh Exp $ 3 * 4 * Device driver for GPIO attached remote control interfaces 5 * on Conexant 2388x based TV/DVB cards. ··· 235 /* detect & configure */ 236 switch (core->board) { 237 case CX88_BOARD_DNTV_LIVE_DVB_T: 238 + case CX88_BOARD_KWORLD_DVB_T: 239 ir_codes = ir_codes_dntv_live_dvb_t; 240 ir->gpio_addr = MO_GP1_IO; 241 ir->mask_keycode = 0x1f; ··· 269 ir->polling = 1; // ms 270 break; 271 } 272 + 273 if (NULL == ir_codes) { 274 kfree(ir); 275 return -ENODEV;
+42 -10
drivers/media/video/cx88/cx88-mpeg.c
··· 1 /* 2 - * $Id: cx88-mpeg.c,v 1.25 2005/03/07 14:18:00 kraxel Exp $ 3 * 4 * Support for the mpeg transport stream transfers 5 * PCI function #2 of the cx2388x. ··· 55 { 56 struct cx88_core *core = dev->core; 57 58 - dprintk(1, "cx8802_start_mpegport_dma %d\n", buf->vb.width); 59 60 /* setup fifo + format */ 61 cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH28], ··· 100 q->count = 1; 101 102 /* enable irqs */ 103 cx_set(MO_PCI_INTMSK, core->pci_irqmask | 0x04); 104 - cx_write(MO_TS_INTMSK, 0x1f0011); 105 106 /* start dma */ 107 - cx_write(MO_DEV_CNTRL2, (1<<5)); /* FIXME: s/write/set/ ??? */ 108 - cx_write(MO_TS_DMACNTRL, 0x11); 109 return 0; 110 } 111 112 static int cx8802_stop_dma(struct cx8802_dev *dev) 113 { 114 struct cx88_core *core = dev->core; 115 116 /* stop dma */ 117 cx_clear(MO_TS_DMACNTRL, 0x11); ··· 134 struct cx88_buffer *buf; 135 struct list_head *item; 136 137 if (list_empty(&q->active)) 138 return 0; 139 140 buf = list_entry(q->active.next, struct cx88_buffer, vb.queue); 141 dprintk(2,"restart_queue [%p/%d]: restart dma\n", ··· 189 struct cx88_buffer *prev; 190 struct cx88_dmaqueue *q = &dev->mpegq; 191 192 /* add jump to stopper */ 193 buf->risc.jmp[0] = cpu_to_le32(RISC_JUMP | RISC_IRQ1 | RISC_CNT_INC); 194 buf->risc.jmp[1] = cpu_to_le32(q->stopper.dma); 195 196 if (list_empty(&q->active)) { 197 list_add_tail(&buf->vb.queue,&q->active); 198 cx8802_start_dma(dev, q, buf); 199 buf->vb.state = STATE_ACTIVE; 200 buf->count = q->count++; 201 mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT); 202 - dprintk(2,"[%p/%d] %s - first active\n", 203 buf, buf->vb.i, __FUNCTION__); 204 205 } else { 206 prev = list_entry(q->active.prev, struct cx88_buffer, vb.queue); 207 list_add_tail(&buf->vb.queue,&q->active); 208 buf->vb.state = STATE_ACTIVE; 209 buf->count = q->count++; 210 prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma); 211 - dprintk(2,"[%p/%d] %s - append to active\n", 212 buf, buf->vb.i, __FUNCTION__); 213 } 214 } 215 ··· 236 buf, buf->vb.i, reason, (unsigned long)buf->risc.dma); 237 } 238 if (restart) 239 cx8802_restart_queue(dev,q); 240 spin_unlock_irqrestore(&dev->slock,flags); 241 } 242 ··· 247 { 248 struct cx88_dmaqueue *q = &dev->mpegq; 249 250 del_timer_sync(&q->timeout); 251 cx8802_stop_dma(dev); 252 do_cancel_buffers(dev,"cancel",0); ··· 257 { 258 struct cx8802_dev *dev = (struct cx8802_dev*)data; 259 260 - dprintk(1, "%s\n",__FUNCTION__); 261 262 if (debug) 263 cx88_sram_channel_dump(dev->core, &cx88_sram_channels[SRAM_CH28]); ··· 270 struct cx88_core *core = dev->core; 271 u32 status, mask, count; 272 273 status = cx_read(MO_TS_INTSTAT); 274 mask = cx_read(MO_TS_INTMSK); 275 if (0 == (status & mask)) 276 return; 277 278 cx_write(MO_TS_INTSTAT, status); 279 if (debug || (status & mask & ~0xff)) 280 cx88_print_irqbits(core->name, "irq mpeg ", 281 cx88_mpeg_irqs, status, mask); ··· 294 295 /* risc1 y */ 296 if (status & 0x01) { 297 spin_lock(&dev->slock); 298 count = cx_read(MO_TS_GPCNT); 299 cx88_wakeup(dev->core, &dev->mpegq, count); ··· 310 311 /* other general errors */ 312 if (status & 0x1f0100) { 313 spin_lock(&dev->slock); 314 cx8802_stop_dma(dev); 315 cx8802_restart_queue(dev,&dev->mpegq); 316 spin_unlock(&dev->slock); 317 } 318 } 319 320 static irqreturn_t cx8802_irq(int irq, void *dev_id, struct pt_regs *regs) 321 { ··· 327 u32 status; 328 int loop, handled = 0; 329 330 - for (loop = 0; loop < 10; loop++) { 331 status = cx_read(MO_PCI_INTSTAT) & (core->pci_irqmask | 0x04); 332 if (0 == status) 333 goto out; 334 handled = 1; 335 cx_write(MO_PCI_INTSTAT, status); 336 ··· 342 if (status & 0x04) 343 cx8802_mpeg_irq(dev); 344 }; 345 - if (10 == loop) { 346 printk(KERN_WARNING "%s/0: irq loop -- clearing mask\n", 347 core->name); 348 cx_write(MO_PCI_INTMSK,0); ··· 407 408 void cx8802_fini_common(struct cx8802_dev *dev) 409 { 410 cx8802_stop_dma(dev); 411 pci_disable_device(dev->pci); 412 ··· 429 /* stop mpeg dma */ 430 spin_lock(&dev->slock); 431 if (!list_empty(&dev->mpegq.active)) { 432 printk("%s: suspend mpeg\n", core->name); 433 cx8802_stop_dma(dev); 434 del_timer(&dev->mpegq.timeout); ··· 494 * Local variables: 495 * c-basic-offset: 8 496 * End: 497 */
··· 1 /* 2 + * $Id: cx88-mpeg.c,v 1.26 2005/06/03 13:31:51 mchehab Exp $ 3 * 4 * Support for the mpeg transport stream transfers 5 * PCI function #2 of the cx2388x. ··· 55 { 56 struct cx88_core *core = dev->core; 57 58 + dprintk(0, "cx8802_start_dma %d\n", buf->vb.width); 59 60 /* setup fifo + format */ 61 cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH28], ··· 100 q->count = 1; 101 102 /* enable irqs */ 103 + dprintk( 0, "setting the interrupt mask\n" ); 104 cx_set(MO_PCI_INTMSK, core->pci_irqmask | 0x04); 105 + cx_set(MO_TS_INTMSK, 0x1f0011); 106 + //cx_write(MO_TS_INTMSK, 0x0f0011); 107 108 /* start dma */ 109 + cx_set(MO_DEV_CNTRL2, (1<<5)); 110 + cx_set(MO_TS_DMACNTRL, 0x11); 111 return 0; 112 } 113 114 static int cx8802_stop_dma(struct cx8802_dev *dev) 115 { 116 struct cx88_core *core = dev->core; 117 + dprintk( 0, "cx8802_stop_dma\n" ); 118 119 /* stop dma */ 120 cx_clear(MO_TS_DMACNTRL, 0x11); ··· 131 struct cx88_buffer *buf; 132 struct list_head *item; 133 134 + dprintk( 0, "cx8802_restart_queue\n" ); 135 if (list_empty(&q->active)) 136 + { 137 + dprintk( 0, "cx8802_restart_queue: queue is empty\n" ); 138 return 0; 139 + } 140 141 buf = list_entry(q->active.next, struct cx88_buffer, vb.queue); 142 dprintk(2,"restart_queue [%p/%d]: restart dma\n", ··· 182 struct cx88_buffer *prev; 183 struct cx88_dmaqueue *q = &dev->mpegq; 184 185 + dprintk( 1, "cx8802_buf_queue\n" ); 186 /* add jump to stopper */ 187 buf->risc.jmp[0] = cpu_to_le32(RISC_JUMP | RISC_IRQ1 | RISC_CNT_INC); 188 buf->risc.jmp[1] = cpu_to_le32(q->stopper.dma); 189 190 if (list_empty(&q->active)) { 191 + dprintk( 0, "queue is empty - first active\n" ); 192 list_add_tail(&buf->vb.queue,&q->active); 193 cx8802_start_dma(dev, q, buf); 194 buf->vb.state = STATE_ACTIVE; 195 buf->count = q->count++; 196 mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT); 197 + dprintk(0,"[%p/%d] %s - first active\n", 198 buf, buf->vb.i, __FUNCTION__); 199 + //udelay(100); 200 201 } else { 202 + dprintk( 1, "queue is not empty - append to active\n" ); 203 prev = list_entry(q->active.prev, struct cx88_buffer, vb.queue); 204 list_add_tail(&buf->vb.queue,&q->active); 205 buf->vb.state = STATE_ACTIVE; 206 buf->count = q->count++; 207 prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma); 208 + dprintk( 1, "[%p/%d] %s - append to active\n", 209 buf, buf->vb.i, __FUNCTION__); 210 + //udelay(100); 211 } 212 } 213 ··· 224 buf, buf->vb.i, reason, (unsigned long)buf->risc.dma); 225 } 226 if (restart) 227 + { 228 + dprintk(0, "restarting queue\n" ); 229 cx8802_restart_queue(dev,q); 230 + } 231 spin_unlock_irqrestore(&dev->slock,flags); 232 } 233 ··· 232 { 233 struct cx88_dmaqueue *q = &dev->mpegq; 234 235 + dprintk( 1, "cx8802_cancel_buffers" ); 236 del_timer_sync(&q->timeout); 237 cx8802_stop_dma(dev); 238 do_cancel_buffers(dev,"cancel",0); ··· 241 { 242 struct cx8802_dev *dev = (struct cx8802_dev*)data; 243 244 + dprintk(0, "%s\n",__FUNCTION__); 245 246 if (debug) 247 cx88_sram_channel_dump(dev->core, &cx88_sram_channels[SRAM_CH28]); ··· 254 struct cx88_core *core = dev->core; 255 u32 status, mask, count; 256 257 + dprintk( 1, "cx8802_mpeg_irq\n" ); 258 status = cx_read(MO_TS_INTSTAT); 259 mask = cx_read(MO_TS_INTMSK); 260 if (0 == (status & mask)) 261 return; 262 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 268 if (debug || (status & mask & ~0xff)) 269 cx88_print_irqbits(core->name, "irq mpeg ", 270 cx88_mpeg_irqs, status, mask); ··· 273 274 /* risc1 y */ 275 if (status & 0x01) { 276 + dprintk( 1, "wake up\n" ); 277 spin_lock(&dev->slock); 278 count = cx_read(MO_TS_GPCNT); 279 cx88_wakeup(dev->core, &dev->mpegq, count); ··· 288 289 /* other general errors */ 290 if (status & 0x1f0100) { 291 + dprintk( 0, "general errors: 0x%08x\n", status & 0x1f0100 ); 292 spin_lock(&dev->slock); 293 cx8802_stop_dma(dev); 294 cx8802_restart_queue(dev,&dev->mpegq); 295 spin_unlock(&dev->slock); 296 } 297 } 298 + 299 + #define MAX_IRQ_LOOP 10 300 301 static irqreturn_t cx8802_irq(int irq, void *dev_id, struct pt_regs *regs) 302 { ··· 302 u32 status; 303 int loop, handled = 0; 304 305 + for (loop = 0; loop < MAX_IRQ_LOOP; loop++) { 306 status = cx_read(MO_PCI_INTSTAT) & (core->pci_irqmask | 0x04); 307 if (0 == status) 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 ); 312 handled = 1; 313 cx_write(MO_PCI_INTSTAT, status); 314 ··· 314 if (status & 0x04) 315 cx8802_mpeg_irq(dev); 316 }; 317 + if (MAX_IRQ_LOOP == loop) { 318 + dprintk( 0, "clearing mask\n" ); 319 printk(KERN_WARNING "%s/0: irq loop -- clearing mask\n", 320 core->name); 321 cx_write(MO_PCI_INTMSK,0); ··· 378 379 void cx8802_fini_common(struct cx8802_dev *dev) 380 { 381 + dprintk( 2, "cx8802_fini_common\n" ); 382 cx8802_stop_dma(dev); 383 pci_disable_device(dev->pci); 384 ··· 399 /* stop mpeg dma */ 400 spin_lock(&dev->slock); 401 if (!list_empty(&dev->mpegq.active)) { 402 + dprintk( 2, "suspend\n" ); 403 printk("%s: suspend mpeg\n", core->name); 404 cx8802_stop_dma(dev); 405 del_timer(&dev->mpegq.timeout); ··· 463 * Local variables: 464 * c-basic-offset: 8 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 467 */
+2 -1
drivers/media/video/cx88/cx88-reg.h
··· 1 /* 2 - $Id: cx88-reg.h,v 1.6 2004/10/13 10:39:00 kraxel Exp $ 3 4 cx88x-hw.h - CX2388x register offsets 5 ··· 397 #define AUD_RATE_ADJ4 0x3205e4 398 #define AUD_RATE_ADJ5 0x3205e8 399 #define AUD_APB_IN_RATE_ADJ 0x3205ec 400 #define AUD_PHASE_FIX_CTL 0x3205f0 401 #define AUD_PLL_PRESCALE 0x320600 402 #define AUD_PLL_DDS 0x320604
··· 1 /* 2 + $Id: cx88-reg.h,v 1.7 2005/06/03 13:31:51 mchehab Exp $ 3 4 cx88x-hw.h - CX2388x register offsets 5 ··· 397 #define AUD_RATE_ADJ4 0x3205e4 398 #define AUD_RATE_ADJ5 0x3205e8 399 #define AUD_APB_IN_RATE_ADJ 0x3205ec 400 + #define AUD_I2SCNTL 0x3205ec 401 #define AUD_PHASE_FIX_CTL 0x3205f0 402 #define AUD_PLL_PRESCALE 0x320600 403 #define AUD_PLL_DDS 0x320604
+61 -38
drivers/media/video/cx88/cx88-tvaudio.c
··· 1 /* 2 - $Id: cx88-tvaudio.c,v 1.34 2005/03/07 16:10:51 kraxel Exp $ 3 4 cx88x-audio.c - Conexant CX23880/23881 audio downstream driver driver 5 ··· 127 cx_write(AUD_VOL_CTL, (1 << 6)); 128 129 // increase level of input by 12dB 130 - cx_write(AUD_AFE_12DB_EN, 0x0001); 131 132 // start programming 133 cx_write(AUD_CTL, 0x0000); ··· 144 u32 volume; 145 146 if (cx88_boards[core->board].blackbird) { 147 // 'pass-thru mode': this enables the i2s output to the mpeg encoder 148 - cx_set(AUD_CTL, 0x2000); 149 cx_write(AUD_I2SOUTPUTCNTL, 1); 150 //cx_write(AUD_APB_IN_RATE_ADJ, 0); 151 } 152 ··· 714 set_audio_finish(core); 715 } 716 717 - static void set_audio_standard_FM(struct cx88_core *core) 718 { 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); 729 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); 735 736 - break; 737 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); 745 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); 751 752 - break; 753 - } 754 - #endif 755 756 dprintk("%s (status: unknown)\n",__FUNCTION__); 757 set_audio_start(core, 0x0020, EN_FMRADIO_AUTO_STEREO); 758 759 - // AB: 10/2/01: this register is not being reset appropriately on occasion. 760 - cx_write(AUD_POLYPH80SCALEFAC,3); 761 762 set_audio_finish(core); 763 } ··· 800 set_audio_standard_EIAJ(core); 801 break; 802 case WW_FM: 803 - set_audio_standard_FM(core); 804 break; 805 case WW_SYSTEM_L_AM: 806 set_audio_standard_NICAM_L(core, 1); ··· 1051 * Local variables: 1052 * c-basic-offset: 8 1053 * End: 1054 */
··· 1 /* 2 + $Id: cx88-tvaudio.c,v 1.36 2005/06/05 05:53:45 mchehab Exp $ 3 4 cx88x-audio.c - Conexant CX23880/23881 audio downstream driver driver 5 ··· 127 cx_write(AUD_VOL_CTL, (1 << 6)); 128 129 // increase level of input by 12dB 130 + // cx_write(AUD_AFE_12DB_EN, 0x0001); 131 + cx_write(AUD_AFE_12DB_EN, 0x0000); 132 133 // start programming 134 cx_write(AUD_CTL, 0x0000); ··· 143 u32 volume; 144 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); 151 // 'pass-thru mode': this enables the i2s output to the mpeg encoder 152 + cx_set(AUD_CTL, EN_I2SOUT_ENABLE); 153 cx_write(AUD_I2SOUTPUTCNTL, 1); 154 + cx_write(AUD_I2SCNTL, 0); 155 //cx_write(AUD_APB_IN_RATE_ADJ, 0); 156 } 157 ··· 707 set_audio_finish(core); 708 } 709 710 + static void set_audio_standard_FM(struct cx88_core *core, enum cx88_deemph_type deemph) 711 { 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 }, 718 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}, 724 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 }, 734 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}, 740 741 + { AUD_POLYPH80SCALEFAC, 0x0003}, 742 + { /* end of list */ }, 743 + }; 744 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 + }; 751 752 dprintk("%s (status: unknown)\n",__FUNCTION__); 753 set_audio_start(core, 0x0020, EN_FMRADIO_AUTO_STEREO); 754 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 + } 769 770 set_audio_finish(core); 771 } ··· 778 set_audio_standard_EIAJ(core); 779 break; 780 case WW_FM: 781 + set_audio_standard_FM(core,FM_NO_DEEMPH); 782 break; 783 case WW_SYSTEM_L_AM: 784 set_audio_standard_NICAM_L(core, 1); ··· 1029 * Local variables: 1030 * c-basic-offset: 8 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 1033 */
+3 -3
drivers/media/video/cx88/cx88-vbi.c
··· 1 /* 2 - * $Id: cx88-vbi.c,v 1.16 2004/12/10 12:33:39 kraxel Exp $ 3 */ 4 #include <linux/kernel.h> 5 #include <linux/module.h> ··· 47 } 48 49 static int cx8800_start_vbi_dma(struct cx8800_dev *dev, 50 - struct cx88_dmaqueue *q, 51 - struct cx88_buffer *buf) 52 { 53 struct cx88_core *core = dev->core; 54
··· 1 /* 2 + * $Id: cx88-vbi.c,v 1.17 2005/06/12 04:19:19 mchehab Exp $ 3 */ 4 #include <linux/kernel.h> 5 #include <linux/module.h> ··· 47 } 48 49 static int cx8800_start_vbi_dma(struct cx8800_dev *dev, 50 + struct cx88_dmaqueue *q, 51 + struct cx88_buffer *buf) 52 { 53 struct cx88_core *core = dev->core; 54
+47 -12
drivers/media/video/cx88/cx88-video.c
··· 1 /* 2 - * $Id: cx88-video.c,v 1.58 2005/03/07 15:58:05 kraxel Exp $ 3 * 4 * device driver for Conexant 2388x based TV cards 5 * video4linux video interface ··· 1187 .id = V4L2_CID_AUDIO_VOLUME, 1188 .value = 0x3f, 1189 }; 1190 1191 set_control(dev,&mute); 1192 set_control(dev,&volume); 1193 } 1194 1195 /* ------------------------------------------------------------------ */ ··· 1350 V4L2_CAP_READWRITE | 1351 V4L2_CAP_STREAMING | 1352 V4L2_CAP_VBI_CAPTURE | 1353 #if 0 1354 V4L2_CAP_VIDEO_OVERLAY | 1355 #endif ··· 1714 sizeof(cap->card)); 1715 sprintf(cap->bus_info,"PCI:%s", pci_name(dev->pci)); 1716 cap->version = CX88_VERSION_CODE; 1717 - cap->capabilities = V4L2_CAP_TUNER; 1718 return 0; 1719 } 1720 case VIDIOC_G_TUNER: ··· 2014 { 2015 struct cx8800_dev *dev; 2016 struct cx88_core *core; 2017 int err; 2018 2019 dev = kmalloc(sizeof(*dev),GFP_KERNEL); ··· 2088 request_module("tuner"); 2089 if (core->tda9887_conf) 2090 request_module("tda9887"); 2091 - if (core->tuner_type != UNSET) 2092 - cx88_call_i2c_clients(dev->core,TUNER_SET_TYPE,&core->tuner_type); 2093 if (core->tda9887_conf) 2094 cx88_call_i2c_clients(dev->core,TDA9887_SET_CONFIG,&core->tda9887_conf); 2095 ··· 2196 2197 static int cx8800_suspend(struct pci_dev *pci_dev, pm_message_t state) 2198 { 2199 - struct cx8800_dev *dev = pci_get_drvdata(pci_dev); 2200 struct cx88_core *core = dev->core; 2201 2202 /* stop video+vbi capture */ ··· 2228 2229 static int cx8800_resume(struct pci_dev *pci_dev) 2230 { 2231 - struct cx8800_dev *dev = pci_get_drvdata(pci_dev); 2232 struct cx88_core *core = dev->core; 2233 2234 if (dev->state.disabled) { ··· 2264 { 2265 .vendor = 0x14f1, 2266 .device = 0x8800, 2267 - .subvendor = PCI_ANY_ID, 2268 - .subdevice = PCI_ANY_ID, 2269 },{ 2270 /* --- end of list --- */ 2271 } ··· 2273 MODULE_DEVICE_TABLE(pci, cx8800_pci_tbl); 2274 2275 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), 2280 2281 .suspend = cx8800_suspend, 2282 .resume = cx8800_resume, ··· 2308 * Local variables: 2309 * c-basic-offset: 8 2310 * End: 2311 */
··· 1 /* 2 + * $Id: cx88-video.c,v 1.63 2005/06/12 04:19:19 mchehab Exp $ 3 * 4 * device driver for Conexant 2388x based TV cards 5 * video4linux video interface ··· 1187 .id = V4L2_CID_AUDIO_VOLUME, 1188 .value = 0x3f, 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 + }; 1202 1203 set_control(dev,&mute); 1204 set_control(dev,&volume); 1205 + set_control(dev,&hue); 1206 + set_control(dev,&contrast); 1207 + set_control(dev,&brightness); 1208 } 1209 1210 /* ------------------------------------------------------------------ */ ··· 1335 V4L2_CAP_READWRITE | 1336 V4L2_CAP_STREAMING | 1337 V4L2_CAP_VBI_CAPTURE | 1338 + #if 0 1339 + V4L2_TUNER_CAP_LOW | 1340 + #endif 1341 #if 0 1342 V4L2_CAP_VIDEO_OVERLAY | 1343 #endif ··· 1696 sizeof(cap->card)); 1697 sprintf(cap->bus_info,"PCI:%s", pci_name(dev->pci)); 1698 cap->version = CX88_VERSION_CODE; 1699 + cap->capabilities = V4L2_CAP_TUNER 1700 + #if 0 1701 + | V4L2_TUNER_CAP_LOW 1702 + #endif 1703 + ; 1704 return 0; 1705 } 1706 case VIDIOC_G_TUNER: ··· 1992 { 1993 struct cx8800_dev *dev; 1994 struct cx88_core *core; 1995 + struct tuner_addr tun_addr; 1996 int err; 1997 1998 dev = kmalloc(sizeof(*dev),GFP_KERNEL); ··· 2065 request_module("tuner"); 2066 if (core->tda9887_conf) 2067 request_module("tda9887"); 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 + 2081 if (core->tda9887_conf) 2082 cx88_call_i2c_clients(dev->core,TDA9887_SET_CONFIG,&core->tda9887_conf); 2083 ··· 2162 2163 static int cx8800_suspend(struct pci_dev *pci_dev, pm_message_t state) 2164 { 2165 + struct cx8800_dev *dev = pci_get_drvdata(pci_dev); 2166 struct cx88_core *core = dev->core; 2167 2168 /* stop video+vbi capture */ ··· 2194 2195 static int cx8800_resume(struct pci_dev *pci_dev) 2196 { 2197 + struct cx8800_dev *dev = pci_get_drvdata(pci_dev); 2198 struct cx88_core *core = dev->core; 2199 2200 if (dev->state.disabled) { ··· 2230 { 2231 .vendor = 0x14f1, 2232 .device = 0x8800, 2233 + .subvendor = PCI_ANY_ID, 2234 + .subdevice = PCI_ANY_ID, 2235 },{ 2236 /* --- end of list --- */ 2237 } ··· 2239 MODULE_DEVICE_TABLE(pci, cx8800_pci_tbl); 2240 2241 static struct pci_driver cx8800_pci_driver = { 2242 + .name = "cx8800", 2243 + .id_table = cx8800_pci_tbl, 2244 + .probe = cx8800_initdev, 2245 + .remove = __devexit_p(cx8800_finidev), 2246 2247 .suspend = cx8800_suspend, 2248 .resume = cx8800_resume, ··· 2274 * Local variables: 2275 * c-basic-offset: 8 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 2278 */
+21 -2
drivers/media/video/cx88/cx88.h
··· 1 /* 2 - * $Id: cx88.h,v 1.56 2005/03/04 09:12:23 kraxel Exp $ 3 * 4 * v4l2 device driver for cx2388x based TV cards 5 * ··· 63 #define SHADOW_AUD_VOL_CTL 1 64 #define SHADOW_AUD_BAL_CTL 2 65 #define SHADOW_MAX 2 66 67 /* ----------------------------------------------------------- */ 68 /* tv norms */ ··· 170 #define CX88_BOARD_DIGITALLOGIC_MEC 25 171 #define CX88_BOARD_IODATA_GVBCTV7E 26 172 #define CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO 27 173 - #define CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T 28 174 175 enum cx88_itype { 176 CX88_VMUX_COMPOSITE1 = 1, ··· 194 struct cx88_board { 195 char *name; 196 unsigned int tuner_type; 197 int tda9887_conf; 198 struct cx88_input input[8]; 199 struct cx88_input radio; ··· 267 /* config info -- analog */ 268 unsigned int board; 269 unsigned int tuner_type; 270 unsigned int tda9887_conf; 271 unsigned int has_radio; 272 ··· 435 /* ----------------------------------------------------------- */ 436 /* cx88-core.c */ 437 438 extern char *cx88_vid_irqs[32]; 439 extern char *cx88_mpeg_irqs[32]; 440 extern void cx88_print_irqbits(char *name, char *tag, char **strings, ··· 487 /* cx88-vbi.c */ 488 489 void cx8800_vbi_fmt(struct cx8800_dev *dev, struct v4l2_format *f); 490 int cx8800_stop_vbi_dma(struct cx8800_dev *dev); 491 int cx8800_restart_vbi_queue(struct cx8800_dev *dev, 492 struct cx88_dmaqueue *q);
··· 1 /* 2 + * $Id: cx88.h,v 1.62 2005/06/12 04:19:19 mchehab Exp $ 3 * 4 * v4l2 device driver for cx2388x based TV cards 5 * ··· 63 #define SHADOW_AUD_VOL_CTL 1 64 #define SHADOW_AUD_BAL_CTL 2 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 + }; 73 74 /* ----------------------------------------------------------- */ 75 /* tv norms */ ··· 163 #define CX88_BOARD_DIGITALLOGIC_MEC 25 164 #define CX88_BOARD_IODATA_GVBCTV7E 26 165 #define CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO 27 166 + #define CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T 28 167 168 enum cx88_itype { 169 CX88_VMUX_COMPOSITE1 = 1, ··· 187 struct cx88_board { 188 char *name; 189 unsigned int tuner_type; 190 + unsigned int radio_type; 191 + unsigned char tuner_addr; 192 + unsigned char radio_addr; 193 int tda9887_conf; 194 struct cx88_input input[8]; 195 struct cx88_input radio; ··· 257 /* config info -- analog */ 258 unsigned int board; 259 unsigned int tuner_type; 260 + unsigned int radio_type; 261 + unsigned char tuner_addr; 262 + unsigned char radio_addr; 263 unsigned int tda9887_conf; 264 unsigned int has_radio; 265 ··· 422 /* ----------------------------------------------------------- */ 423 /* cx88-core.c */ 424 425 + extern char *cx88_pci_irqs[32]; 426 extern char *cx88_vid_irqs[32]; 427 extern char *cx88_mpeg_irqs[32]; 428 extern void cx88_print_irqbits(char *name, char *tag, char **strings, ··· 473 /* cx88-vbi.c */ 474 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 + */ 481 int cx8800_stop_vbi_dma(struct cx8800_dev *dev); 482 int cx8800_restart_vbi_queue(struct cx8800_dev *dev, 483 struct cx88_dmaqueue *q);
+1 -1
drivers/media/video/ir-kbd-gpio.c
··· 1 /* 2 - * $Id: ir-kbd-gpio.c,v 1.12 2005/02/22 12:28:40 kraxel Exp $ 3 * 4 * Copyright (c) 2003 Gerd Knorr 5 * Copyright (c) 2003 Pavel Machek
··· 1 /* 2 + * $Id: ir-kbd-gpio.c,v 1.13 2005/05/15 19:01:26 mchehab Exp $ 3 * 4 * Copyright (c) 2003 Gerd Knorr 5 * Copyright (c) 2003 Pavel Machek