summaryrefslogtreecommitdiff
path: root/drivers/media/video/au0828
diff options
context:
space:
mode:
authorSteven Toth <stoth@hauppauge.com>2008-03-29 19:53:07 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 14:09:42 -0300
commit28930fa9af9be77abe3d8bce3193908bf266efc6 (patch)
treebb867ecfd3069e79ef398bbe3550dabdeefa99dc /drivers/media/video/au0828
parent265a6510629ab39f33ece43a857089dd37978184 (diff)
V4L/DVB (7622): HVR950Q Hauppauge eeprom support
HVR950Q Hauppauge eeprom support. Signed-off-by: Steven Toth <stoth@hauppauge.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/au0828')
-rw-r--r--drivers/media/video/au0828/au0828-cards.c39
-rw-r--r--drivers/media/video/au0828/au0828-core.c3
-rw-r--r--drivers/media/video/au0828/au0828.h2
3 files changed, 44 insertions, 0 deletions
diff --git a/drivers/media/video/au0828/au0828-cards.c b/drivers/media/video/au0828/au0828-cards.c
index c4cb11e9d6fc..cbcc6f81f460 100644
--- a/drivers/media/video/au0828/au0828-cards.c
+++ b/drivers/media/video/au0828/au0828-cards.c
@@ -75,6 +75,45 @@ int au0828_tuner_callback(void *priv, int command, int arg)
return 0; /* Should never be here */
}
+static void hauppauge_eeprom(struct au0828_dev *dev, u8 *eeprom_data)
+{
+ struct tveeprom tv;
+
+ tveeprom_hauppauge_analog(&dev->i2c_client, &tv, eeprom_data);
+
+ /* Make sure we support the board model */
+ switch (tv.model)
+ {
+ case 72001: /* WinTV-HVR950q (Retail, IR, ATSC/QAM and basic analog video */
+ break;
+ default:
+ printk("%s: warning: unknown hauppauge model #%d\n", __FUNCTION__, tv.model);
+ break;
+ }
+
+ printk(KERN_INFO "%s: hauppauge eeprom: model=%d\n", __FUNCTION__, tv.model);
+}
+
+
+void au0828_card_setup(struct au0828_dev *dev)
+{
+
+ static u8 eeprom[256];
+
+ if (dev->i2c_rc == 0) {
+ dev->i2c_client.addr = 0xa0 >> 1;
+ tveeprom_read(&dev->i2c_client, eeprom, sizeof(eeprom));
+ }
+
+ switch(dev->board) {
+ case AU0828_BOARD_HAUPPAUGE_HVR850:
+ case AU0828_BOARD_HAUPPAUGE_HVR950Q:
+ if (dev->i2c_rc == 0)
+ hauppauge_eeprom(dev, eeprom+0xa0);
+ break;
+ }
+}
+
/*
* The bridge has between 8 and 12 gpios.
* Regs 1 and 0 deal with output enables.
diff --git a/drivers/media/video/au0828/au0828-core.c b/drivers/media/video/au0828/au0828-core.c
index 8d0b8a8b06bd..f5df99ea3b9f 100644
--- a/drivers/media/video/au0828/au0828-core.c
+++ b/drivers/media/video/au0828/au0828-core.c
@@ -210,6 +210,9 @@ static int au0828_usb_probe (struct usb_interface *interface,
/* I2C */
au0828_i2c_register(dev);
+ /* Setup */
+ au0828_card_setup(dev);
+
/* Digital TV */
au0828_dvb_register(dev);
diff --git a/drivers/media/video/au0828/au0828.h b/drivers/media/video/au0828/au0828.h
index 517227667040..3dc09f8ffef7 100644
--- a/drivers/media/video/au0828/au0828.h
+++ b/drivers/media/video/au0828/au0828.h
@@ -22,6 +22,7 @@
#include <linux/usb.h>
#include <linux/i2c.h>
#include <linux/i2c-algo-bit.h>
+#include <media/tveeprom.h>
/* DVB */
#include "demux.h"
@@ -103,6 +104,7 @@ extern struct usb_device_id au0828_usb_id_table[];
extern const unsigned int au0828_bcount;
extern void au0828_gpio_setup(struct au0828_dev *dev);
extern int au0828_tuner_callback(void *priv, int command, int arg);
+extern void au0828_card_setup(struct au0828_dev *dev);
/* ----------------------------------------------------------- */
/* au0828-i2c.c */