aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/em28xx/em28xx-cards.c
diff options
context:
space:
mode:
authorDevin Heitmueller <devin.heitmueller@gmail.com>2008-11-12 00:05:06 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-12-29 14:53:32 -0500
commit6a1acc3bc5144e004996029b20e46e6020d128a7 (patch)
treeeb49b54db622afdbcca0a119f07533c0b98727d3 /drivers/media/video/em28xx/em28xx-cards.c
parent600bd7f0edee0f9687c3c77e6fe63c74452acbfa (diff)
V4L/DVB (9584): Support different GPIO/GPO registers for newer devices
Empia moved the location of the GPIO/GPO registers in newer devices. Add the ability to specify the relocated registers (including caching of register contents). Thanks for Ray Lu from Empia for providing the em2874 datasheet. Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-cards.c')
-rw-r--r--drivers/media/video/em28xx/em28xx-cards.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c
index 90389270389b..791ab2cc7d8f 100644
--- a/drivers/media/video/em28xx/em28xx-cards.c
+++ b/drivers/media/video/em28xx/em28xx-cards.c
@@ -1312,11 +1312,13 @@ void em28xx_pre_card_setup(struct em28xx *dev)
1312{ 1312{
1313 int rc; 1313 int rc;
1314 1314
1315 rc = em28xx_read_reg(dev, EM2880_R04_GPO); 1315 /* Set the default GPO/GPIO for legacy devices */
1316 if (rc >= 0) 1316 dev->reg_gpo_num = EM2880_R04_GPO;
1317 dev->reg_gpo = rc; 1317 dev->reg_gpio_num = EM28XX_R08_GPIO;
1318 1318
1319 dev->wait_after_write = 5; 1319 dev->wait_after_write = 5;
1320
1321 /* Based on the Chip ID, set the device configuration */
1320 rc = em28xx_read_reg(dev, EM28XX_R0A_CHIPID); 1322 rc = em28xx_read_reg(dev, EM28XX_R0A_CHIPID);
1321 if (rc > 0) { 1323 if (rc > 0) {
1322 dev->chip_id = rc; 1324 dev->chip_id = rc;
@@ -1326,6 +1328,7 @@ void em28xx_pre_card_setup(struct em28xx *dev)
1326 break; 1328 break;
1327 case CHIP_ID_EM2874: 1329 case CHIP_ID_EM2874:
1328 em28xx_info("chip ID is em2874\n"); 1330 em28xx_info("chip ID is em2874\n");
1331 dev->reg_gpio_num = EM2874_R80_GPIO;
1329 dev->wait_after_write = 0; 1332 dev->wait_after_write = 0;
1330 break; 1333 break;
1331 case CHIP_ID_EM2883: 1334 case CHIP_ID_EM2883:
@@ -1336,6 +1339,12 @@ void em28xx_pre_card_setup(struct em28xx *dev)
1336 em28xx_info("em28xx chip ID = %d\n", rc); 1339 em28xx_info("em28xx chip ID = %d\n", rc);
1337 } 1340 }
1338 } 1341 }
1342
1343 /* Prepopulate cached GPO register content */
1344 rc = em28xx_read_reg(dev, dev->reg_gpo_num);
1345 if (rc >= 0)
1346 dev->reg_gpo = rc;
1347
1339 em28xx_set_model(dev); 1348 em28xx_set_model(dev);
1340 1349
1341 /* request some modules */ 1350 /* request some modules */