diff options
author | Steven Toth <stoth@hauppauge.com> | 2005-12-01 03:51:27 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-12-01 18:48:57 -0500 |
commit | 3ca0ea980697d3b3c3d5c13ba7e525ed6c434756 (patch) | |
tree | db5d423db74e88ce836588bb77ab8ae77649b5f8 /drivers/media/video/tveeprom.c | |
parent | 759324c3c4b8d63203d7ea41b56553330bc0df06 (diff) |
[PATCH] V4L: tveeprom MAC address parsing/cleanup
- Added a mac address field to the tveeprom structure.
- allow callers to query the MAC address.
- removed some redundant eeprom parsing code in cx88-cards.c (specific to
Hauppauge DVB products) Instead, placed calls directly to the single eeprom
parsing function in tveeprom.c
Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Michael Krufky <mkrufky@m1k.net>
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>
Diffstat (limited to 'drivers/media/video/tveeprom.c')
-rw-r--r-- | drivers/media/video/tveeprom.c | 54 |
1 files changed, 46 insertions, 8 deletions
diff --git a/drivers/media/video/tveeprom.c b/drivers/media/video/tveeprom.c index 72e8741e8b59..d6afd918f324 100644 --- a/drivers/media/video/tveeprom.c +++ b/drivers/media/video/tveeprom.c | |||
@@ -81,7 +81,7 @@ hauppauge_tuner_fmt[] = | |||
81 | { 0x00000010, " PAL(I)" }, | 81 | { 0x00000010, " PAL(I)" }, |
82 | { 0x00400000, " SECAM(L/L')" }, | 82 | { 0x00400000, " SECAM(L/L')" }, |
83 | { 0x00000e00, " PAL(D/K)" }, | 83 | { 0x00000e00, " PAL(D/K)" }, |
84 | { 0x03000000, " ATSC Digital" }, | 84 | { 0x03000000, " ATSC/DVB Digital" }, |
85 | }; | 85 | }; |
86 | 86 | ||
87 | /* This is the full list of possible tuners. Many thanks to Hauppauge for | 87 | /* This is the full list of possible tuners. Many thanks to Hauppauge for |
@@ -216,6 +216,20 @@ hauppauge_tuner[] = | |||
216 | { TUNER_ABSENT, "LG TAPC-W701D"}, | 216 | { TUNER_ABSENT, "LG TAPC-W701D"}, |
217 | { TUNER_ABSENT, "TCL 9886P-WM"}, | 217 | { TUNER_ABSENT, "TCL 9886P-WM"}, |
218 | { TUNER_ABSENT, "TCL 1676NM-WM"}, | 218 | { TUNER_ABSENT, "TCL 1676NM-WM"}, |
219 | /* 110-119 */ | ||
220 | { TUNER_ABSENT, "Thompson DTT75105"}, | ||
221 | { TUNER_ABSENT, "Conexant_CX24109"}, | ||
222 | { TUNER_ABSENT, "TCL M2523_5N_E"}, | ||
223 | { TUNER_ABSENT, "TCL M2523_3DB_E"}, | ||
224 | { TUNER_ABSENT, "Philips 8275A"}, | ||
225 | { TUNER_ABSENT, "Microtune MT2060"}, | ||
226 | { TUNER_ABSENT, "Philips FM1236 MK5"}, | ||
227 | { TUNER_ABSENT, "Philips FM1216ME MK5"}, | ||
228 | { TUNER_ABSENT, "TCL M2523_3DI_E"}, | ||
229 | { TUNER_ABSENT, "Samsung THPD5222FG30A"}, | ||
230 | /* 120-129 */ | ||
231 | { TUNER_ABSENT, "Xceive XC3028"}, | ||
232 | { TUNER_ABSENT, "Philips FQ1216LME MK5"}, | ||
219 | }; | 233 | }; |
220 | 234 | ||
221 | static struct HAUPPAUGE_AUDIOIC | 235 | static struct HAUPPAUGE_AUDIOIC |
@@ -369,9 +383,13 @@ void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee, | |||
369 | done = len = beenhere = 0; | 383 | done = len = beenhere = 0; |
370 | 384 | ||
371 | /* Hack for processing eeprom for em28xx */ | 385 | /* Hack for processing eeprom for em28xx */ |
372 | if ((eeprom_data[0]==0x1a)&&(eeprom_data[1]==0xeb)&& | 386 | if ((eeprom_data[0] == 0x1a) && (eeprom_data[1] == 0xeb) && |
373 | (eeprom_data[2]==0x67)&&(eeprom_data[3]==0x95)) | 387 | (eeprom_data[2] == 0x67) && (eeprom_data[3] == 0x95)) |
374 | start=0xa0; | 388 | start=0xa0; |
389 | else if ((eeprom_data[0] == 0x1f) && (eeprom_data[8] == 0x84)) | ||
390 | start=8; | ||
391 | else if ((eeprom_data[0] == 0x17) && (eeprom_data[8] == 0x84)) | ||
392 | start=8; | ||
375 | else | 393 | else |
376 | start=0; | 394 | start=0; |
377 | 395 | ||
@@ -448,6 +466,17 @@ void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee, | |||
448 | eeprom_data[i+5] + | 466 | eeprom_data[i+5] + |
449 | (eeprom_data[i+6] << 8) + | 467 | (eeprom_data[i+6] << 8) + |
450 | (eeprom_data[i+7] << 16); | 468 | (eeprom_data[i+7] << 16); |
469 | |||
470 | if ( (eeprom_data[i + 8] && 0xf0) && | ||
471 | (tvee->serial_number < 0xffffff) ) { | ||
472 | tvee->MAC_address[0] = 0x00; | ||
473 | tvee->MAC_address[1] = 0x0D; | ||
474 | tvee->MAC_address[2] = 0xFE; | ||
475 | tvee->MAC_address[3] = eeprom_data[i + 7]; | ||
476 | tvee->MAC_address[4] = eeprom_data[i + 6]; | ||
477 | tvee->MAC_address[5] = eeprom_data[i + 5]; | ||
478 | tvee->has_MAC_address = 1; | ||
479 | } | ||
451 | break; | 480 | break; |
452 | 481 | ||
453 | case 0x05: | 482 | case 0x05: |
@@ -466,11 +495,14 @@ void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee, | |||
466 | case 0x06: | 495 | case 0x06: |
467 | /* tag 'ModelRev' */ | 496 | /* tag 'ModelRev' */ |
468 | tvee->model = | 497 | tvee->model = |
469 | eeprom_data[i+1] + | 498 | eeprom_data[i + 1] + |
470 | (eeprom_data[i+2] << 8); | 499 | (eeprom_data[i + 2] << 8) + |
471 | tvee->revision = eeprom_data[i+5] + | 500 | (eeprom_data[i + 3] << 16) + |
472 | (eeprom_data[i+6] << 8) + | 501 | (eeprom_data[i + 4] << 24); |
473 | (eeprom_data[i+7] << 16); | 502 | tvee->revision = |
503 | eeprom_data[i +5 ] + | ||
504 | (eeprom_data[i + 6] << 8) + | ||
505 | (eeprom_data[i + 7] << 16); | ||
474 | break; | 506 | break; |
475 | 507 | ||
476 | case 0x07: | 508 | case 0x07: |
@@ -578,6 +610,12 @@ void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee, | |||
578 | 610 | ||
579 | tveeprom_info("Hauppauge model %d, rev %s, serial# %d\n", | 611 | tveeprom_info("Hauppauge model %d, rev %s, serial# %d\n", |
580 | tvee->model, tvee->rev_str, tvee->serial_number); | 612 | tvee->model, tvee->rev_str, tvee->serial_number); |
613 | if (tvee->has_MAC_address == 1) { | ||
614 | tveeprom_info("MAC address is %02X-%02X-%02X-%02X-%02X-%02X\n", | ||
615 | tvee->MAC_address[0], tvee->MAC_address[1], | ||
616 | tvee->MAC_address[2], tvee->MAC_address[3], | ||
617 | tvee->MAC_address[4], tvee->MAC_address[5]); | ||
618 | } | ||
581 | tveeprom_info("tuner model is %s (idx %d, type %d)\n", | 619 | tveeprom_info("tuner model is %s (idx %d, type %d)\n", |
582 | t_name1, tuner1, tvee->tuner_type); | 620 | t_name1, tuner1, tvee->tuner_type); |
583 | tveeprom_info("TV standards%s%s%s%s%s%s%s%s (eeprom 0x%02x)\n", | 621 | tveeprom_info("TV standards%s%s%s%s%s%s%s%s (eeprom 0x%02x)\n", |