aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2008-11-25 11:10:14 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-12-29 14:53:42 -0500
commitc864405747fa8b50c1454b280c216f54da834cb4 (patch)
treedb8104bede664c7020be6e715d234c8e77f8d268 /drivers
parent1bee0184f6ffba1263a4b1e5732cde2c5292d843 (diff)
V4L/DVB (9755): em28xx: cleanup: We need just one tuner callback
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/em28xx/em28xx-cards.c29
-rw-r--r--drivers/media/video/em28xx/em28xx.h2
2 files changed, 8 insertions, 23 deletions
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c
index 3013abd00e05..1ade8c427c56 100644
--- a/drivers/media/video/em28xx/em28xx-cards.c
+++ b/drivers/media/video/em28xx/em28xx-cards.c
@@ -1206,15 +1206,6 @@ static struct em28xx_reg_seq default_callback[] = {
1206 { -1, -1, -1, -1}, 1206 { -1, -1, -1, -1},
1207}; 1207};
1208 1208
1209/* Callback for EM2882 TERRATEC HYBRID XS */
1210static struct em28xx_reg_seq em2882_terratec_hybrid_xs_digital[] = {
1211 {EM28XX_R08_GPIO, 0x2e, 0xff, 6},
1212 {EM28XX_R08_GPIO, 0x3e, ~EM_GPIO_4, 6},
1213 {EM2880_R04_GPO, 0x04, 0xff, 10},
1214 {EM2880_R04_GPO, 0x0c, 0xff, 10},
1215 { -1, -1, -1, -1},
1216};
1217
1218/* Pinnacle PCTV HD Mini (80e) GPIOs 1209/* Pinnacle PCTV HD Mini (80e) GPIOs
1219 0-5: not used 1210 0-5: not used
1220 6: demod reset, active low 1211 6: demod reset, active low
@@ -1253,10 +1244,7 @@ int em28xx_tuner_callback(void *ptr, int component, int command, int arg)
1253 if (command != XC2028_TUNER_RESET) 1244 if (command != XC2028_TUNER_RESET)
1254 return 0; 1245 return 0;
1255 1246
1256 if (dev->mode == EM28XX_ANALOG_MODE) 1247 rc = em28xx_gpio_set(dev, dev->tuner_gpio);
1257 rc = em28xx_gpio_set(dev, dev->tun_analog_gpio);
1258 else
1259 rc = em28xx_gpio_set(dev, dev->tun_digital_gpio);
1260 1248
1261 return rc; 1249 return rc;
1262} 1250}
@@ -1350,16 +1338,12 @@ void em28xx_pre_card_setup(struct em28xx *dev)
1350 /* Sets GPO/GPIO sequences for this device */ 1338 /* Sets GPO/GPIO sequences for this device */
1351 dev->analog_gpio = hauppauge_wintv_hvr_900_analog; 1339 dev->analog_gpio = hauppauge_wintv_hvr_900_analog;
1352 dev->digital_gpio = hauppauge_wintv_hvr_900_digital; 1340 dev->digital_gpio = hauppauge_wintv_hvr_900_digital;
1353 dev->tun_analog_gpio = default_callback;
1354 dev->tun_digital_gpio = default_callback;
1355 break; 1341 break;
1356 1342
1357 case EM2882_BOARD_TERRATEC_HYBRID_XS: 1343 case EM2882_BOARD_TERRATEC_HYBRID_XS:
1358 /* Sets GPO/GPIO sequences for this device */ 1344 /* Sets GPO/GPIO sequences for this device */
1359 dev->analog_gpio = hauppauge_wintv_hvr_900_analog; 1345 dev->analog_gpio = hauppauge_wintv_hvr_900_analog;
1360 dev->digital_gpio = hauppauge_wintv_hvr_900_digital; 1346 dev->digital_gpio = hauppauge_wintv_hvr_900_digital;
1361 dev->tun_analog_gpio = default_callback;
1362 dev->tun_digital_gpio = em2882_terratec_hybrid_xs_digital;
1363 break; 1347 break;
1364 1348
1365 case EM2880_BOARD_TERRATEC_HYBRID_XS_FR: 1349 case EM2880_BOARD_TERRATEC_HYBRID_XS_FR:
@@ -1376,8 +1360,6 @@ void em28xx_pre_card_setup(struct em28xx *dev)
1376 /* Sets GPO/GPIO sequences for this device */ 1360 /* Sets GPO/GPIO sequences for this device */
1377 dev->analog_gpio = default_analog; 1361 dev->analog_gpio = default_analog;
1378 dev->digital_gpio = default_digital; 1362 dev->digital_gpio = default_digital;
1379 dev->tun_analog_gpio = default_callback;
1380 dev->tun_digital_gpio = default_callback;
1381 break; 1363 break;
1382 1364
1383 case EM2880_BOARD_MSI_DIGIVOX_AD: 1365 case EM2880_BOARD_MSI_DIGIVOX_AD:
@@ -1385,8 +1367,6 @@ void em28xx_pre_card_setup(struct em28xx *dev)
1385 /* Sets GPO/GPIO sequences for this device */ 1367 /* Sets GPO/GPIO sequences for this device */
1386 dev->analog_gpio = em2880_msi_digivox_ad_analog; 1368 dev->analog_gpio = em2880_msi_digivox_ad_analog;
1387 dev->digital_gpio = em2880_msi_digivox_ad_digital; 1369 dev->digital_gpio = em2880_msi_digivox_ad_digital;
1388 dev->tun_analog_gpio = default_callback;
1389 dev->tun_digital_gpio = default_callback;
1390 break; 1370 break;
1391 1371
1392 case EM2861_BOARD_PLEXTOR_PX_TV100U: 1372 case EM2861_BOARD_PLEXTOR_PX_TV100U:
@@ -1458,7 +1438,11 @@ void em28xx_pre_card_setup(struct em28xx *dev)
1458 break; 1438 break;
1459 } 1439 }
1460 1440
1461 em28xx_gpio_set(dev, dev->tun_analog_gpio); 1441 /* Sets the default callback. Used only for certain tuners */
1442 if (!dev->tuner_gpio)
1443 dev->tuner_gpio = default_callback;
1444
1445 em28xx_gpio_set(dev, dev->tuner_gpio);
1462 em28xx_set_mode(dev, EM28XX_ANALOG_MODE); 1446 em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
1463 1447
1464 /* Unlock device */ 1448 /* Unlock device */
@@ -1752,3 +1736,4 @@ void em28xx_card_setup(struct em28xx *dev)
1752 1736
1753 em28xx_ir_init(dev); 1737 em28xx_ir_init(dev);
1754} 1738}
1739
diff --git a/drivers/media/video/em28xx/em28xx.h b/drivers/media/video/em28xx/em28xx.h
index a7cece91cc0d..3e9ca7899beb 100644
--- a/drivers/media/video/em28xx/em28xx.h
+++ b/drivers/media/video/em28xx/em28xx.h
@@ -432,7 +432,7 @@ struct em28xx {
432 struct em28xx_reg_seq *analog_gpio, *digital_gpio; 432 struct em28xx_reg_seq *analog_gpio, *digital_gpio;
433 433
434 /* GPIO sequences for tuner callbacks */ 434 /* GPIO sequences for tuner callbacks */
435 struct em28xx_reg_seq *tun_analog_gpio, *tun_digital_gpio; 435 struct em28xx_reg_seq *tuner_gpio;
436 436
437 struct list_head devlist; 437 struct list_head devlist;
438 438