summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/em28xx/em28xx-cards.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2007-11-04 09:06:48 -0200
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-11-04 09:06:48 -0200
commit398fa9b90714b59f76f253bd3d787484d6f89ebf (patch)
treeef7ee4f656c82af182de50422aac0f6befcc85fb /linux/drivers/media/video/em28xx/em28xx-cards.c
parentb46e1e93b7a6abd37652c7bcd2353cf6de4b68c0 (diff)
downloadmediapointer-dvb-s2-398fa9b90714b59f76f253bd3d787484d6f89ebf.tar.gz
mediapointer-dvb-s2-398fa9b90714b59f76f253bd3d787484d6f89ebf.tar.bz2
em28xx: autodetect Cinergy 200 USB and VGear PocketTV
From: Sascha Sommer <saschasommer@freenet.de> Adds autodetection support for the Cinergy200 USB and the VGear PocketTV. Whenever a usb device with generic empia em2800 usb ids is detected the device gets scanned for connected i2c devices. If the device list matches an em2800 device in the device list the model id gets changed accordingly. Signed-off-by: Sascha Sommer <saschasommer@freenet.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/video/em28xx/em28xx-cards.c')
-rw-r--r--linux/drivers/media/video/em28xx/em28xx-cards.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/linux/drivers/media/video/em28xx/em28xx-cards.c b/linux/drivers/media/video/em28xx/em28xx-cards.c
index 510896dbe..1ee7391b9 100644
--- a/linux/drivers/media/video/em28xx/em28xx-cards.c
+++ b/linux/drivers/media/video/em28xx/em28xx-cards.c
@@ -403,6 +403,11 @@ static struct em28xx_hash_table em28xx_hash [] = {
{ 0x6ce05a8f, EM2820_BOARD_PROLINK_PLAYTV_USB2, TUNER_YMEC_TVF_5533MF },
};
+static struct em28xx_hash_table em28xx_i2c_hash[] = {
+ { 0xb06a32c3, EM2800_BOARD_TERRATEC_CINERGY_200, TUNER_LG_PAL_NEW_TAPC },
+ { 0xf51200e3, EM2800_BOARD_VGEAR_POCKETTV, TUNER_LG_PAL_NEW_TAPC },
+};
+
/* Since em28xx_pre_card_setup() requires a proper dev->model,
* this won't work for boards with generic PCI IDs
*/
@@ -499,6 +504,30 @@ static int em28xx_hint_board(struct em28xx *dev)
return 0;
}
}
+
+ /* user did not request i2c scanning => do it now */
+ if (!dev->i2c_hash)
+ em28xx_do_i2c_scan(dev);
+
+ for (i = 0; i < ARRAY_SIZE(em28xx_i2c_hash); i++) {
+ if (dev->i2c_hash == em28xx_i2c_hash[i].hash) {
+ dev->model = em28xx_i2c_hash[i].model;
+ dev->tuner_type = em28xx_i2c_hash[i].tuner;
+ em28xx_errdev("Your board has no unique USB ID.\n");
+ em28xx_errdev("A hint were successfully done, "
+ "based on i2c devicelist hash.\n");
+ em28xx_errdev("This method is not 100%% failproof.\n");
+ em28xx_errdev("If the board were missdetected, "
+ "please email this log to:\n");
+ em28xx_errdev("\tV4L Mailing List "
+ " <video4linux-list@redhat.com>\n");
+ em28xx_errdev("Board detected as %s\n",
+ em28xx_boards[dev->model].name);
+
+ return 0;
+ }
+ }
+
em28xx_errdev("Your board has no unique USB ID and thus need a "
"hint to be detected.\n");
em28xx_errdev("You may try to use card=<n> insmod option to "
@@ -506,6 +535,7 @@ static int em28xx_hint_board(struct em28xx *dev)
em28xx_errdev("Please send an email with this log to:\n");
em28xx_errdev("\tV4L Mailing List <video4linux-list@redhat.com>\n");
em28xx_errdev("Board eeprom hash is 0x%08lx\n", dev->hash);
+ em28xx_errdev("Board i2c devicelist hash is 0x%08lx\n", dev->i2c_hash);
em28xx_errdev("Here is a list of valid choices for the card=<n>"
" insmod option:\n");