summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <devnull@localhost>2005-11-18 07:25:08 +0000
committerMauro Carvalho Chehab <devnull@localhost>2005-11-18 07:25:08 +0000
commit8ad5767c565d70f73a0cb6c65a9144b7196f9616 (patch)
tree0b726a3bdefe12c79384780faa109b7f25e3c3d6
parent2723671270469dcf207cdcc6a7b6d74223ef64cd (diff)
downloadmediapointer-dvb-s2-8ad5767c565d70f73a0cb6c65a9144b7196f9616.tar.gz
mediapointer-dvb-s2-8ad5767c565d70f73a0cb6c65a9144b7196f9616.tar.bz2
tveeprom MAC address parsing/cleanup
From: Steven Toth <stoth@hauppauge.com> - 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>
-rw-r--r--linux/drivers/media/video/cx88/cx88-cards.c40
-rw-r--r--linux/drivers/media/video/tveeprom.c54
-rw-r--r--linux/include/media/tveeprom.h4
-rw-r--r--v4l/ChangeLog20
4 files changed, 80 insertions, 38 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-cards.c b/linux/drivers/media/video/cx88/cx88-cards.c
index 575770cb6..962f224b2 100644
--- a/linux/drivers/media/video/cx88/cx88-cards.c
+++ b/linux/drivers/media/video/cx88/cx88-cards.c
@@ -1,5 +1,5 @@
/*
- * $Id: cx88-cards.c,v 1.105 2005/11/18 01:02:18 mkrufky Exp $
+ * $Id: cx88-cards.c,v 1.106 2005/11/18 07:25:08 mchehab Exp $
*
* device driver for Conexant 2388x based TV cards
* card-specific stuff.
@@ -1128,44 +1128,26 @@ static void hauppauge_eeprom(struct cx88_core *core, u8 *eeprom_data)
tveeprom_hauppauge_analog(&core->i2c_client, &tv, eeprom_data);
core->tuner_type = tv.tuner_type;
core->has_radio = tv.has_radio;
-}
-
-/* fixme: This is bogus code... add new pnp code to parse or see tveeprom.ko */
-static int hauppauge_eeprom_dvb(struct cx88_core *core, u8 *ee)
-{
- int model;
- int tuner;
/* Make sure we support the board model */
- model = ee[0x1f] << 24 | ee[0x1e] << 16 | ee[0x1d] << 8 | ee[0x1c];
- switch(model) {
+ switch (tv.model)
+ {
case 90002: /* Nova-T-PCI (9002) */
case 90500: /* Nova-T-PCI (oem) */
case 90501: /* Nova-T-PCI (oem/IR) */
- case 92000: /* Nova-S-Plus */
- case 92002: /* Nova-SE2 */
+ case 92000: /* Nova-SE2 (OEM, No Video or IR) */
+ case 92001: /* Nova-S-Plus (Video and IR) */
+ case 92002: /* Nova-S-Plus (Video and IR) */
/* known */
break;
default:
printk("%s: warning: unknown hauppauge model #%d\n",
- core->name, model);
+ core->name, tv.model);
break;
}
- /* Make sure we support the tuner */
- tuner = ee[0x2d];
- switch(tuner) {
- case 0x4B: /* dtt 7595 */
- case 0x4C: /* dtt 7592 */
- break;
- default:
- printk("%s: error: unknown hauppauge tuner 0x%02x\n",
- core->name, tuner);
- return -ENODEV;
- }
- printk(KERN_INFO "%s: hauppauge eeprom: model=%d, tuner=%d\n",
- core->name, model, tuner);
- return 0;
+ printk(KERN_INFO "%s: hauppauge eeprom: model=%d\n",
+ core->name, tv.model);
}
/* ----------------------------------------------------------------------- */
@@ -1249,7 +1231,7 @@ void cx88_card_list(struct cx88_core *core, struct pci_dev *pci)
void cx88_card_setup(struct cx88_core *core)
{
- static u8 eeprom[128];
+ static u8 eeprom[256];
if (0 == core->i2c_rc) {
core->i2c_client.addr = 0xa0 >> 1;
@@ -1274,7 +1256,7 @@ void cx88_card_setup(struct cx88_core *core)
case CX88_BOARD_HAUPPAUGE_NOVASE2_S1:
case CX88_BOARD_HAUPPAUGE_DVB_T1:
if (0 == core->i2c_rc)
- hauppauge_eeprom_dvb(core,eeprom);
+ hauppauge_eeprom(core,eeprom);
break;
case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1:
case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS:
diff --git a/linux/drivers/media/video/tveeprom.c b/linux/drivers/media/video/tveeprom.c
index 3288cd7df..0b090e849 100644
--- a/linux/drivers/media/video/tveeprom.c
+++ b/linux/drivers/media/video/tveeprom.c
@@ -96,7 +96,7 @@ hauppauge_tuner_fmt[] =
{ 0x00000010, " PAL(I)" },
{ 0x00400000, " SECAM(L/L')" },
{ 0x00000e00, " PAL(D/K)" },
- { 0x03000000, " ATSC Digital" },
+ { 0x03000000, " ATSC/DVB Digital" },
};
/* This is the full list of possible tuners. Many thanks to Hauppauge for
@@ -231,6 +231,20 @@ hauppauge_tuner[] =
{ TUNER_ABSENT, "LG TAPC-W701D"},
{ TUNER_ABSENT, "TCL 9886P-WM"},
{ TUNER_ABSENT, "TCL 1676NM-WM"},
+ /* 110-119 */
+ { TUNER_ABSENT, "Thompson DTT75105"},
+ { TUNER_ABSENT, "Conexant_CX24109"},
+ { TUNER_ABSENT, "TCL M2523_5N_E"},
+ { TUNER_ABSENT, "TCL M2523_3DB_E"},
+ { TUNER_ABSENT, "Philips 8275A"},
+ { TUNER_ABSENT, "Microtune MT2060"},
+ { TUNER_ABSENT, "Philips FM1236 MK5"},
+ { TUNER_ABSENT, "Philips FM1216ME MK5"},
+ { TUNER_ABSENT, "TCL M2523_3DI_E"},
+ { TUNER_ABSENT, "Samsung THPD5222FG30A"},
+ /* 120-129 */
+ { TUNER_ABSENT, "Xceive XC3028"},
+ { TUNER_ABSENT, "Philips FQ1216LME MK5"},
};
static struct HAUPPAUGE_AUDIOIC
@@ -384,9 +398,13 @@ void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee,
done = len = beenhere = 0;
/* Hack for processing eeprom for em28xx */
- if ((eeprom_data[0]==0x1a)&&(eeprom_data[1]==0xeb)&&
- (eeprom_data[2]==0x67)&&(eeprom_data[3]==0x95))
+ if ((eeprom_data[0] == 0x1a) && (eeprom_data[1] == 0xeb) &&
+ (eeprom_data[2] == 0x67) && (eeprom_data[3] == 0x95))
start=0xa0;
+ else if ((eeprom_data[0] == 0x1f) && (eeprom_data[8] == 0x84))
+ start=8;
+ else if ((eeprom_data[0] == 0x17) && (eeprom_data[8] == 0x84))
+ start=8;
else
start=0;
@@ -463,6 +481,17 @@ void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee,
eeprom_data[i+5] +
(eeprom_data[i+6] << 8) +
(eeprom_data[i+7] << 16);
+
+ if ( (eeprom_data[i + 8] && 0xf0) &&
+ (tvee->serial_number < 0xffffff) ) {
+ tvee->MAC_address[0] = 0x00;
+ tvee->MAC_address[1] = 0x0D;
+ tvee->MAC_address[2] = 0xFE;
+ tvee->MAC_address[3] = eeprom_data[i + 7];
+ tvee->MAC_address[4] = eeprom_data[i + 6];
+ tvee->MAC_address[5] = eeprom_data[i + 5];
+ tvee->has_MAC_address = 1;
+ }
break;
case 0x05:
@@ -481,11 +510,14 @@ void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee,
case 0x06:
/* tag 'ModelRev' */
tvee->model =
- eeprom_data[i+1] +
- (eeprom_data[i+2] << 8);
- tvee->revision = eeprom_data[i+5] +
- (eeprom_data[i+6] << 8) +
- (eeprom_data[i+7] << 16);
+ eeprom_data[i + 1] +
+ (eeprom_data[i + 2] << 8) +
+ (eeprom_data[i + 3] << 16) +
+ (eeprom_data[i + 4] << 24);
+ tvee->revision =
+ eeprom_data[i +5 ] +
+ (eeprom_data[i + 6] << 8) +
+ (eeprom_data[i + 7] << 16);
break;
case 0x07:
@@ -593,6 +625,12 @@ void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee,
tveeprom_info("Hauppauge model %d, rev %s, serial# %d\n",
tvee->model, tvee->rev_str, tvee->serial_number);
+ if (tvee->has_MAC_address == 1) {
+ tveeprom_info("MAC address is %02X-%02X-%02X-%02X-%02X-%02X\n",
+ tvee->MAC_address[0], tvee->MAC_address[1],
+ tvee->MAC_address[2], tvee->MAC_address[3],
+ tvee->MAC_address[4], tvee->MAC_address[5]);
+ }
tveeprom_info("tuner model is %s (idx %d, type %d)\n",
t_name1, tuner1, tvee->tuner_type);
tveeprom_info("TV standards%s%s%s%s%s%s%s%s (eeprom 0x%02x)\n",
diff --git a/linux/include/media/tveeprom.h b/linux/include/media/tveeprom.h
index 334e64216..4722f3d3f 100644
--- a/linux/include/media/tveeprom.h
+++ b/linux/include/media/tveeprom.h
@@ -1,10 +1,11 @@
/*
- * $Id: tveeprom.h,v 1.4 2005/08/30 05:11:41 mchehab Exp $
+ * $Id: tveeprom.h,v 1.5 2005/11/18 07:25:08 mchehab Exp $
*/
struct tveeprom {
u32 has_radio;
u32 has_ir; /* 0: no IR, 1: IR present, 2: unknown */
+ u32 has_MAC_address; /* 0: no MAC, 1: MAC present, 2: unknown */
u32 tuner_type;
u32 tuner_formats;
@@ -22,6 +23,7 @@ struct tveeprom {
u32 revision;
u32 serial_number;
char rev_str[5];
+ u8 MAC_address[6];
};
void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee,
diff --git a/v4l/ChangeLog b/v4l/ChangeLog
index 4f5271e97..420663f97 100644
--- a/v4l/ChangeLog
+++ b/v4l/ChangeLog
@@ -1,3 +1,23 @@
+2005-11-18 07:22 mchehab
+
+ * ../linux/drivers/media/video/cx88/cx88-cards.c:
+ (hauppauge_eeprom), (cx88_card_setup):
+
+ - 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
+
+ * ../linux/drivers/media/video/tveeprom.c:
+ (tveeprom_hauppauge_analog):
+ * ../linux/include/media/tveeprom.h:
+
+ - added a mac address field to the tveeprom structure.
+ - allow callers to query the MAC address.
+
+ 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>
+
2005-11-18 03:37 mkrufky
* ../v4l/Makefile: