Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] v4l: tveeprom improved to support newer Hauppage cards

- tveeprom improved and updated to reflect newer Hauppage cards.
- CodingStyle fixes.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
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
0f97a931 18fc59e2

+238 -103
+2 -1
drivers/media/video/bttv-cards.c
··· 3060 3060 { 3061 3061 struct tveeprom tv; 3062 3062 3063 - tveeprom_hauppauge_analog(&tv, eeprom_data); 3063 + tveeprom_hauppauge_analog(&btv->i2c_client, &tv, eeprom_data); 3064 3064 btv->tuner_type = tv.tuner_type; 3065 3065 btv->has_radio = tv.has_radio; 3066 3066 } ··· 4485 4485 } 4486 4486 if (UNSET != latency) 4487 4487 printk(KERN_INFO "bttv: pci latency fixup [%d]\n",latency); 4488 + 4488 4489 while ((dev = pci_find_device(PCI_VENDOR_ID_INTEL, 4489 4490 PCI_DEVICE_ID_INTEL_82441, dev))) { 4490 4491 unsigned char b;
+1
drivers/media/video/bttv-driver.c
··· 4079 4079 struct bttv_buffer_set idle; 4080 4080 unsigned long flags; 4081 4081 4082 + dprintk("bttv%d: suspend %d\n", btv->c.nr, state.event); 4082 4083 4083 4084 /* stop dma + irqs */ 4084 4085 spin_lock_irqsave(&btv->s_lock,flags);
+1 -1
drivers/media/video/cx88/cx88-cards.c
··· 945 945 { 946 946 struct tveeprom tv; 947 947 948 - tveeprom_hauppauge_analog(&tv, eeprom_data); 948 + tveeprom_hauppauge_analog(&core->i2c_client, &tv, eeprom_data); 949 949 core->tuner_type = tv.tuner_type; 950 950 core->has_radio = tv.has_radio; 951 951 }
+228 -99
drivers/media/video/tveeprom.c
··· 47 47 48 48 static int debug = 0; 49 49 module_param(debug, int, 0644); 50 - MODULE_PARM_DESC(debug, "Debug level (0-2)"); 50 + MODULE_PARM_DESC(debug, "Debug level (0-1)"); 51 51 52 52 #define STRM(array,i) (i < sizeof(array)/sizeof(char*) ? array[i] : "unknown") 53 53 54 - #define dprintk(num, args...) \ 55 - do { \ 56 - if (debug >= num) \ 57 - printk(KERN_INFO "tveeprom: " args); \ 58 - } while (0) 54 + #define tveeprom_info(fmt, arg...) do {\ 55 + printk(KERN_INFO "tveeprom %d-%04x: " fmt, \ 56 + c->adapter->nr, c->addr , ##arg); } while (0) 57 + #define tveeprom_warn(fmt, arg...) do {\ 58 + printk(KERN_WARNING "tveeprom %d-%04x: " fmt, \ 59 + c->adapter->nr, c->addr , ##arg); } while (0) 60 + #define tveeprom_dbg(fmt, arg...) do {\ 61 + if (debug) \ 62 + printk(KERN_INFO "tveeprom %d-%04x: " fmt, \ 63 + c->adapter->nr, c->addr , ##arg); } while (0) 59 64 60 - #define TVEEPROM_KERN_ERR(args...) printk(KERN_ERR "tveeprom: " args); 61 - #define TVEEPROM_KERN_INFO(args...) printk(KERN_INFO "tveeprom: " args); 62 65 63 66 /* ----------------------------------------------------------------------- */ 64 67 /* some hauppauge specific stuff */ ··· 73 70 } 74 71 hauppauge_tuner_fmt[] = 75 72 { 76 - { 0x00000000, "unknown1" }, 77 - { 0x00000000, "unknown2" }, 78 - { 0x00000007, "PAL(B/G)" }, 79 - { 0x00001000, "NTSC(M)" }, 80 - { 0x00000010, "PAL(I)" }, 81 - { 0x00400000, "SECAM(L/L�)" }, 82 - { 0x00000e00, "PAL(D/K)" }, 83 - { 0x03000000, "ATSC Digital" }, 73 + { 0x00000000, " unknown1" }, 74 + { 0x00000000, " unknown2" }, 75 + { 0x00000007, " PAL(B/G)" }, 76 + { 0x00001000, " NTSC(M)" }, 77 + { 0x00000010, " PAL(I)" }, 78 + { 0x00400000, " SECAM(L/L')" }, 79 + { 0x00000e00, " PAL(D/K)" }, 80 + { 0x03000000, " ATSC Digital" }, 84 81 }; 85 82 86 83 /* This is the full list of possible tuners. Many thanks to Hauppauge for ··· 206 203 { TUNER_TCL_2002N, "TCL 2002N 5H"}, 207 204 /* 100-103 */ 208 205 { TUNER_ABSENT, "Unspecified"}, 209 - { TUNER_ABSENT, "Unspecified"}, 206 + { TUNER_TEA5767, "Philips TEA5767HN FM Radio"}, 210 207 { TUNER_ABSENT, "Unspecified"}, 211 208 { TUNER_PHILIPS_FM1236_MK3, "TCL MFNM05 4"}, 212 209 }; 213 210 214 - static char *sndtype[] = { 215 - "None", "TEA6300", "TEA6320", "TDA9850", "MSP3400C", "MSP3410D", 216 - "MSP3415", "MSP3430", "MSP3438", "CS5331", "MSP3435", "MSP3440", 217 - "MSP3445", "MSP3411", "MSP3416", "MSP3425", 211 + /* This list is supplied by Hauppauge. Thanks! */ 212 + static const char *audioIC[] = { 213 + /* 0-4 */ 214 + "None", "TEA6300", "TEA6320", "TDA9850", "MSP3400C", 215 + /* 5-9 */ 216 + "MSP3410D", "MSP3415", "MSP3430", "MSP3438", "CS5331", 217 + /* 10-14 */ 218 + "MSP3435", "MSP3440", "MSP3445", "MSP3411", "MSP3416", 219 + /* 15-19 */ 220 + "MSP3425", "MSP3451", "MSP3418", "Type 0x12", "OKI7716", 221 + /* 20-24 */ 222 + "MSP4410", "MSP4420", "MSP4440", "MSP4450", "MSP4408", 223 + /* 25-29 */ 224 + "MSP4418", "MSP4428", "MSP4448", "MSP4458", "Type 0x1d", 225 + /* 30-34 */ 226 + "CX880", "CX881", "CX883", "CX882", "CX25840", 227 + /* 35-38 */ 228 + "CX25841", "CX25842", "CX25843", "CX23418", 229 + }; 218 230 219 - "Type 0x10","Type 0x11","Type 0x12","Type 0x13", 220 - "Type 0x14","Type 0x15","Type 0x16","Type 0x17", 221 - "Type 0x18","MSP4418","Type 0x1a","MSP4448", 222 - "Type 0x1c","Type 0x1d","Type 0x1e","Type 0x1f", 231 + /* This list is supplied by Hauppauge. Thanks! */ 232 + static const char *decoderIC[] = { 233 + /* 0-4 */ 234 + "None", "BT815", "BT817", "BT819", "BT815A", 235 + /* 5-9 */ 236 + "BT817A", "BT819A", "BT827", "BT829", "BT848", 237 + /* 10-14 */ 238 + "BT848A", "BT849A", "BT829A", "BT827A", "BT878", 239 + /* 15-19 */ 240 + "BT879", "BT880", "VPX3226E", "SAA7114", "SAA7115", 241 + /* 20-24 */ 242 + "CX880", "CX881", "CX883", "SAA7111", "SAA7113", 243 + /* 25-29 */ 244 + "CX882", "TVP5150A", "CX25840", "CX25841", "CX25842", 245 + /* 30-31 */ 246 + "CX25843", "CX23418", 223 247 }; 224 248 225 249 static int hasRadioTuner(int tunerType) ··· 287 257 return 0; 288 258 } 289 259 290 - void tveeprom_hauppauge_analog(struct tveeprom *tvee, unsigned char *eeprom_data) 260 + void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee, 261 + unsigned char *eeprom_data) 291 262 { 292 263 /* ---------------------------------------------- 293 264 ** The hauppauge eeprom format is tagged ··· 298 267 ** if packet[0] & f8 == f8, then EOD and packet[1] == checksum 299 268 ** 300 269 ** In our (ivtv) case we're interested in the following: 301 - ** tuner type: tag [00].05 or [0a].01 (index into hauppauge_tuner) 302 - ** tuner fmts: tag [00].04 or [0a].00 (bitmask index into hauppauge_tuner_fmt) 303 - ** radio: tag [00].{last} or [0e].00 (bitmask. bit2=FM) 304 - ** audio proc: tag [02].01 or [05].00 (lower nibble indexes lut?) 270 + ** tuner type: tag [00].05 or [0a].01 (index into hauppauge_tuner) 271 + ** tuner fmts: tag [00].04 or [0a].00 (bitmask index into hauppauge_tuner_fmt) 272 + ** radio: tag [00].{last} or [0e].00 (bitmask. bit2=FM) 273 + ** audio proc: tag [02].01 or [05].00 (mask with 0x7f) 274 + ** decoder proc: tag [09].01) 305 275 306 276 ** Fun info: 307 277 ** model: tag [00].07-08 or [06].00-01 ··· 312 280 ** # of inputs/outputs ??? 313 281 */ 314 282 315 - int i, j, len, done, beenhere, tag, tuner = 0, t_format = 0; 316 - char *t_name = NULL, *t_fmt_name = NULL; 283 + int i, j, len, done, beenhere, tag; 317 284 318 - dprintk(1, "%s\n",__FUNCTION__); 319 - tvee->revision = done = len = beenhere = 0; 285 + int tuner1 = 0, t_format1 = 0; 286 + char *t_name1 = NULL; 287 + const char *t_fmt_name1[8] = { " none", "", "", "", "", "", "", "" }; 288 + 289 + int tuner2 = 0, t_format2 = 0; 290 + char *t_name2 = NULL; 291 + const char *t_fmt_name2[8] = { " none", "", "", "", "", "", "", "" }; 292 + 293 + memset(tvee, 0, sizeof(*tvee)); 294 + done = len = beenhere = 0; 320 295 for (i = 0; !done && i < 256; i += len) { 321 - dprintk(2, "processing pos = %02x (%02x, %02x)\n", 322 - i, eeprom_data[i], eeprom_data[i + 1]); 323 - 324 296 if (eeprom_data[i] == 0x84) { 325 297 len = eeprom_data[i + 1] + (eeprom_data[i + 2] << 8); 326 - i+=3; 298 + i += 3; 327 299 } else if ((eeprom_data[i] & 0xf0) == 0x70) { 328 - if ((eeprom_data[i] & 0x08)) { 300 + if (eeprom_data[i] & 0x08) { 329 301 /* verify checksum! */ 330 302 done = 1; 331 303 break; ··· 337 301 len = eeprom_data[i] & 0x07; 338 302 ++i; 339 303 } else { 340 - TVEEPROM_KERN_ERR("Encountered bad packet header [%02x]. " 304 + tveeprom_warn("Encountered bad packet header [%02x]. " 341 305 "Corrupt or not a Hauppauge eeprom.\n", eeprom_data[i]); 342 306 return; 343 307 } 344 308 345 - dprintk(1, "%3d [%02x] ", len, eeprom_data[i]); 346 - for(j = 1; j < len; j++) { 347 - dprintk(1, "%02x ", eeprom_data[i + j]); 348 - } 349 - dprintk(1, "\n"); 309 + if (debug) { 310 + tveeprom_info("Tag [%02x] + %d bytes:", eeprom_data[i], len - 1); 311 + for(j = 1; j < len; j++) { 312 + printk(" %02x", eeprom_data[i + j]); 313 + } 314 + printk("\n"); 315 + } 350 316 351 317 /* process by tag */ 352 318 tag = eeprom_data[i]; 353 319 switch (tag) { 354 320 case 0x00: 355 - tuner = eeprom_data[i+6]; 356 - t_format = eeprom_data[i+5]; 321 + /* tag: 'Comprehensive' */ 322 + tuner1 = eeprom_data[i+6]; 323 + t_format1 = eeprom_data[i+5]; 357 324 tvee->has_radio = eeprom_data[i+len-1]; 325 + /* old style tag, don't know how to detect 326 + IR presence, mark as unknown. */ 327 + tvee->has_ir = 2; 358 328 tvee->model = 359 329 eeprom_data[i+8] + 360 330 (eeprom_data[i+9] << 8); ··· 368 326 (eeprom_data[i+11] << 8) + 369 327 (eeprom_data[i+12] << 16); 370 328 break; 329 + 371 330 case 0x01: 331 + /* tag: 'SerialID' */ 372 332 tvee->serial_number = 373 333 eeprom_data[i+6] + 374 334 (eeprom_data[i+7] << 8) + 375 335 (eeprom_data[i+8] << 16); 376 336 break; 337 + 377 338 case 0x02: 378 - tvee->audio_processor = eeprom_data[i+2] & 0x0f; 339 + /* tag 'AudioInfo' 340 + Note mask with 0x7F, high bit used on some older models 341 + to indicate 4052 mux was removed in favor of using MSP 342 + inputs directly. */ 343 + tvee->audio_processor = eeprom_data[i+2] & 0x7f; 379 344 break; 345 + 346 + /* case 0x03: tag 'EEInfo' */ 347 + 380 348 case 0x04: 349 + /* tag 'SerialID2' */ 381 350 tvee->serial_number = 382 351 eeprom_data[i+5] + 383 352 (eeprom_data[i+6] << 8) + 384 353 (eeprom_data[i+7] << 16); 385 354 break; 355 + 386 356 case 0x05: 387 - tvee->audio_processor = eeprom_data[i+1] & 0x0f; 357 + /* tag 'Audio2' 358 + Note mask with 0x7F, high bit used on some older models 359 + to indicate 4052 mux was removed in favor of using MSP 360 + inputs directly. */ 361 + tvee->audio_processor = eeprom_data[i+1] & 0x7f; 388 362 break; 363 + 389 364 case 0x06: 365 + /* tag 'ModelRev' */ 390 366 tvee->model = 391 367 eeprom_data[i+1] + 392 368 (eeprom_data[i+2] << 8); ··· 412 352 (eeprom_data[i+6] << 8) + 413 353 (eeprom_data[i+7] << 16); 414 354 break; 355 + 356 + case 0x07: 357 + /* tag 'Details': according to Hauppauge not interesting 358 + on any PCI-era or later boards. */ 359 + break; 360 + 361 + /* there is no tag 0x08 defined */ 362 + 363 + case 0x09: 364 + /* tag 'Video' */ 365 + tvee->decoder_processor = eeprom_data[i + 1]; 366 + break; 367 + 415 368 case 0x0a: 416 - if(beenhere == 0) { 417 - tuner = eeprom_data[i+2]; 418 - t_format = eeprom_data[i+1]; 369 + /* tag 'Tuner' */ 370 + if (beenhere == 0) { 371 + tuner1 = eeprom_data[i+2]; 372 + t_format1 = eeprom_data[i+1]; 419 373 beenhere = 1; 420 - break; 421 374 } else { 422 - break; 423 - } 375 + /* a second (radio) tuner may be present */ 376 + tuner2 = eeprom_data[i+2]; 377 + t_format2 = eeprom_data[i+1]; 378 + if (t_format2 == 0) { /* not a TV tuner? */ 379 + tvee->has_radio = 1; /* must be radio */ 380 + } 381 + } 382 + break; 383 + 384 + case 0x0b: 385 + /* tag 'Inputs': according to Hauppauge this is specific 386 + to each driver family, so no good assumptions can be 387 + made. */ 388 + break; 389 + 390 + /* case 0x0c: tag 'Balun' */ 391 + /* case 0x0d: tag 'Teletext' */ 392 + 424 393 case 0x0e: 394 + /* tag: 'Radio' */ 425 395 tvee->has_radio = eeprom_data[i+1]; 426 396 break; 397 + 398 + case 0x0f: 399 + /* tag 'IRInfo' */ 400 + tvee->has_ir = eeprom_data[i+1]; 401 + break; 402 + 403 + /* case 0x10: tag 'VBIInfo' */ 404 + /* case 0x11: tag 'QCInfo' */ 405 + /* case 0x12: tag 'InfoBits' */ 406 + 427 407 default: 428 - dprintk(1, "Not sure what to do with tag [%02x]\n", tag); 408 + tveeprom_dbg("Not sure what to do with tag [%02x]\n", tag); 429 409 /* dump the rest of the packet? */ 430 410 } 431 - 432 411 } 433 412 434 413 if (!done) { 435 - TVEEPROM_KERN_ERR("Ran out of data!\n"); 414 + tveeprom_warn("Ran out of data!\n"); 436 415 return; 437 416 } 438 417 ··· 483 384 tvee->rev_str[4] = 0; 484 385 } 485 386 486 - if (hasRadioTuner(tuner) && !tvee->has_radio) { 487 - TVEEPROM_KERN_INFO("The eeprom says no radio is present, but the tuner type\n"); 488 - TVEEPROM_KERN_INFO("indicates otherwise. I will assume that radio is present.\n"); 387 + if (hasRadioTuner(tuner1) && !tvee->has_radio) { 388 + tveeprom_info("The eeprom says no radio is present, but the tuner type\n"); 389 + tveeprom_info("indicates otherwise. I will assume that radio is present.\n"); 489 390 tvee->has_radio = 1; 490 391 } 491 392 492 - if (tuner < sizeof(hauppauge_tuner)/sizeof(struct HAUPPAUGE_TUNER)) { 493 - tvee->tuner_type = hauppauge_tuner[tuner].id; 494 - t_name = hauppauge_tuner[tuner].name; 393 + if (tuner1 < sizeof(hauppauge_tuner)/sizeof(struct HAUPPAUGE_TUNER)) { 394 + tvee->tuner_type = hauppauge_tuner[tuner1].id; 395 + t_name1 = hauppauge_tuner[tuner1].name; 495 396 } else { 496 - t_name = "<unknown>"; 397 + t_name1 = "unknown"; 398 + } 399 + 400 + if (tuner2 < sizeof(hauppauge_tuner)/sizeof(struct HAUPPAUGE_TUNER)) { 401 + tvee->tuner2_type = hauppauge_tuner[tuner2].id; 402 + t_name2 = hauppauge_tuner[tuner2].name; 403 + } else { 404 + t_name2 = "unknown"; 497 405 } 498 406 499 407 tvee->tuner_formats = 0; 500 - t_fmt_name = "<none>"; 501 - for (i = 0; i < 8; i++) { 502 - if (t_format & (1<<i)) { 408 + tvee->tuner2_formats = 0; 409 + for (i = j = 0; i < 8; i++) { 410 + if (t_format1 & (1 << i)) { 503 411 tvee->tuner_formats |= hauppauge_tuner_fmt[i].id; 504 - /* yuck */ 505 - t_fmt_name = hauppauge_tuner_fmt[i].name; 412 + t_fmt_name1[j++] = hauppauge_tuner_fmt[i].name; 506 413 } 414 + if (t_format2 & (1 << i)) { 415 + tvee->tuner2_formats |= hauppauge_tuner_fmt[i].id; 416 + t_fmt_name2[j++] = hauppauge_tuner_fmt[i].name; 417 + } 507 418 } 508 419 509 - 510 - TVEEPROM_KERN_INFO("Hauppauge: model = %d, rev = %s, serial# = %d\n", 511 - tvee->model, 512 - tvee->rev_str, 513 - tvee->serial_number); 514 - TVEEPROM_KERN_INFO("tuner = %s (idx = %d, type = %d)\n", 515 - t_name, 516 - tuner, 517 - tvee->tuner_type); 518 - TVEEPROM_KERN_INFO("tuner fmt = %s (eeprom = 0x%02x, v4l2 = 0x%08x)\n", 519 - t_fmt_name, 520 - t_format, 521 - tvee->tuner_formats); 522 - 523 - TVEEPROM_KERN_INFO("audio_processor = %s (type = %d)\n", 524 - STRM(sndtype,tvee->audio_processor), 420 + tveeprom_info("Hauppauge model %d, rev %s, serial# %d\n", 421 + tvee->model, tvee->rev_str, tvee->serial_number); 422 + tveeprom_info("tuner model is %s (idx %d, type %d)\n", 423 + t_name1, tuner1, tvee->tuner_type); 424 + tveeprom_info("TV standards%s%s%s%s%s%s%s%s (eeprom 0x%02x)\n", 425 + t_fmt_name1[0], t_fmt_name1[1], t_fmt_name1[2], t_fmt_name1[3], 426 + t_fmt_name1[4], t_fmt_name1[5], t_fmt_name1[6], t_fmt_name1[7], 427 + t_format1); 428 + if (tuner2) { 429 + tveeprom_info("second tuner model is %s (idx %d, type %d)\n", 430 + t_name2, tuner2, tvee->tuner2_type); 431 + } 432 + if (t_format2) { 433 + tveeprom_info("TV standards%s%s%s%s%s%s%s%s (eeprom 0x%02x)\n", 434 + t_fmt_name2[0], t_fmt_name2[1], t_fmt_name2[2], t_fmt_name2[3], 435 + t_fmt_name2[4], t_fmt_name2[5], t_fmt_name2[6], t_fmt_name2[7], 436 + t_format2); 437 + } 438 + tveeprom_info("audio processor is %s (idx %d)\n", 439 + STRM(audioIC, tvee->audio_processor), 525 440 tvee->audio_processor); 526 - 441 + if (tvee->decoder_processor) { 442 + tveeprom_info("decoder processor is %s (idx %d)\n", 443 + STRM(decoderIC, tvee->decoder_processor), 444 + tvee->decoder_processor); 445 + } 446 + if (tvee->has_ir == 2) 447 + tveeprom_info("has %sradio\n", 448 + tvee->has_radio ? "" : "no "); 449 + else 450 + tveeprom_info("has %sradio, has %sIR remote\n", 451 + tvee->has_radio ? "" : "no ", 452 + tvee->has_ir ? "" : "no "); 527 453 } 528 454 EXPORT_SYMBOL(tveeprom_hauppauge_analog); 529 455 ··· 560 436 unsigned char buf; 561 437 int err; 562 438 563 - dprintk(1, "%s\n",__FUNCTION__); 564 439 buf = 0; 565 - if (1 != (err = i2c_master_send(c,&buf,1))) { 566 - printk(KERN_INFO "tveeprom(%s): Huh, no eeprom present (err=%d)?\n", 567 - c->name,err); 440 + if (1 != (err = i2c_master_send(c, &buf, 1))) { 441 + tveeprom_info("Huh, no eeprom present (err=%d)?\n", err); 568 442 return -1; 569 443 } 570 - if (len != (err = i2c_master_recv(c,eedata,len))) { 571 - printk(KERN_WARNING "tveeprom(%s): i2c eeprom read error (err=%d)\n", 572 - c->name,err); 444 + if (len != (err = i2c_master_recv(c, eedata, len))) { 445 + tveeprom_warn("i2c eeprom read error (err=%d)\n", err); 573 446 return -1; 574 447 } 448 + if (debug) { 449 + int i; 450 + 451 + tveeprom_info("full 256-byte eeprom dump:\n"); 452 + for (i = 0; i < len; i++) { 453 + if (0 == (i % 16)) 454 + tveeprom_info("%02x:", i); 455 + printk(" %02x", eedata[i]); 456 + if (15 == (i % 16)) 457 + printk("\n"); 458 + } 459 + } 575 460 return 0; 576 461 } 577 462 EXPORT_SYMBOL(tveeprom_read); 578 - 579 463 580 464 /* ----------------------------------------------------------------------- */ 581 465 /* needed for ivtv.sf.net at the moment. Should go away in the long */ ··· 617 485 buf = kmalloc(256,GFP_KERNEL); 618 486 memset(buf,0,256); 619 487 tveeprom_read(client,buf,256); 620 - tveeprom_hauppauge_analog(&eeprom,buf); 488 + tveeprom_hauppauge_analog(client, &eeprom,buf); 621 489 kfree(buf); 622 490 eeprom_props[0] = eeprom.tuner_type; 623 491 eeprom_props[1] = eeprom.tuner_formats; ··· 638 506 { 639 507 struct i2c_client *client; 640 508 641 - dprintk(1,"%s: id 0x%x @ 0x%x\n",__FUNCTION__, 642 - adapter->id, address << 1); 643 509 client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); 644 510 if (NULL == client) 645 511 return -ENOMEM; ··· 654 524 static int 655 525 tveeprom_attach_adapter (struct i2c_adapter *adapter) 656 526 { 657 - dprintk(1,"%s: id 0x%x\n",__FUNCTION__,adapter->id); 658 527 if (adapter->id != I2C_HW_B_BT848) 659 528 return 0; 660 529 return i2c_probe(adapter, &addr_data, tveeprom_detect_client);
+6 -2
include/media/tveeprom.h
··· 3 3 4 4 struct tveeprom { 5 5 u32 has_radio; 6 + u32 has_ir; /* 0: no IR, 1: IR present, 2: unknown */ 6 7 7 8 u32 tuner_type; 8 9 u32 tuner_formats; 10 + 11 + u32 tuner2_type; 12 + u32 tuner2_formats; 9 13 10 14 u32 digitizer; 11 15 u32 digitizer_formats; 12 16 13 17 u32 audio_processor; 14 - /* a_p_fmts? */ 18 + u32 decoder_processor; 15 19 16 20 u32 model; 17 21 u32 revision; ··· 23 19 char rev_str[5]; 24 20 }; 25 21 26 - void tveeprom_hauppauge_analog(struct tveeprom *tvee, 22 + void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee, 27 23 unsigned char *eeprom_data); 28 24 29 25 int tveeprom_read(struct i2c_client *c, unsigned char *eedata, int len);