aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/em28xx/em28xx-cards.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2008-11-27 07:21:55 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-12-29 14:53:43 -0500
commit017ab4b1e2aa31dc9fe986ab6d1f5ffa2a84395b (patch)
treed57a4768ec850e19e87e21270e2681cfef61d07d /drivers/media/video/em28xx/em28xx-cards.c
parent2fe3e2ee72ef17daad1d3769321bb7dd69a003a9 (diff)
V4L/DVB (9765): em28xx: move tuner gpio's to the cards struct
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.c33
1 files changed, 26 insertions, 7 deletions
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c
index a4b61e5a7635..a8c815728a28 100644
--- a/drivers/media/video/em28xx/em28xx-cards.c
+++ b/drivers/media/video/em28xx/em28xx-cards.c
@@ -94,7 +94,7 @@ static struct em28xx_reg_seq em2880_msi_digivox_ad_analog[] = {
94 Analog - No input analog */ 94 Analog - No input analog */
95 95
96/* Callback for the most boards */ 96/* Callback for the most boards */
97static struct em28xx_reg_seq default_callback[] = { 97static struct em28xx_reg_seq default_tuner_gpio[] = {
98 {EM28XX_R08_GPIO, EM_GPIO_4, EM_GPIO_4, 10}, 98 {EM28XX_R08_GPIO, EM_GPIO_4, EM_GPIO_4, 10},
99 {EM28XX_R08_GPIO, 0, EM_GPIO_4, 10}, 99 {EM28XX_R08_GPIO, 0, EM_GPIO_4, 10},
100 {EM28XX_R08_GPIO, EM_GPIO_4, EM_GPIO_4, 10}, 100 {EM28XX_R08_GPIO, EM_GPIO_4, EM_GPIO_4, 10},
@@ -460,7 +460,9 @@ struct em28xx_board em28xx_boards[] = {
460 .name = "Terratec Cinergy A Hybrid XS", 460 .name = "Terratec Cinergy A Hybrid XS",
461 .valid = EM28XX_BOARD_NOT_VALIDATED, 461 .valid = EM28XX_BOARD_NOT_VALIDATED,
462 .tuner_type = TUNER_XC2028, 462 .tuner_type = TUNER_XC2028,
463 .tuner_gpio = default_tuner_gpio,
463 .decoder = EM28XX_TVP5150, 464 .decoder = EM28XX_TVP5150,
465
464 .input = { { 466 .input = { {
465 .type = EM28XX_VMUX_TELEVISION, 467 .type = EM28XX_VMUX_TELEVISION,
466 .vmux = TVP5150_COMPOSITE0, 468 .vmux = TVP5150_COMPOSITE0,
@@ -482,6 +484,7 @@ struct em28xx_board em28xx_boards[] = {
482 .name = "KWorld PVRTV 300U", 484 .name = "KWorld PVRTV 300U",
483 .valid = EM28XX_BOARD_NOT_VALIDATED, 485 .valid = EM28XX_BOARD_NOT_VALIDATED,
484 .tuner_type = TUNER_XC2028, 486 .tuner_type = TUNER_XC2028,
487 .tuner_gpio = default_tuner_gpio,
485 .decoder = EM28XX_TVP5150, 488 .decoder = EM28XX_TVP5150,
486 .input = { { 489 .input = { {
487 .type = EM28XX_VMUX_TELEVISION, 490 .type = EM28XX_VMUX_TELEVISION,
@@ -542,6 +545,7 @@ struct em28xx_board em28xx_boards[] = {
542 .name = "Terratec Cinergy T XS", 545 .name = "Terratec Cinergy T XS",
543 .valid = EM28XX_BOARD_NOT_VALIDATED, 546 .valid = EM28XX_BOARD_NOT_VALIDATED,
544 .tuner_type = TUNER_XC2028, 547 .tuner_type = TUNER_XC2028,
548 .tuner_gpio = default_tuner_gpio,
545 }, 549 },
546 [EM2870_BOARD_TERRATEC_XS_MT2060] = { 550 [EM2870_BOARD_TERRATEC_XS_MT2060] = {
547 .name = "Terratec Cinergy T XS (MT2060)", 551 .name = "Terratec Cinergy T XS (MT2060)",
@@ -552,6 +556,7 @@ struct em28xx_board em28xx_boards[] = {
552 .name = "Kworld 350 U DVB-T", 556 .name = "Kworld 350 U DVB-T",
553 .valid = EM28XX_BOARD_NOT_VALIDATED, 557 .valid = EM28XX_BOARD_NOT_VALIDATED,
554 .tuner_type = TUNER_XC2028, 558 .tuner_type = TUNER_XC2028,
559 .tuner_gpio = default_tuner_gpio,
555 }, 560 },
556 [EM2870_BOARD_KWORLD_355U] = { 561 [EM2870_BOARD_KWORLD_355U] = {
557 .name = "Kworld 355 U DVB-T", 562 .name = "Kworld 355 U DVB-T",
@@ -576,6 +581,7 @@ struct em28xx_board em28xx_boards[] = {
576 .valid = EM28XX_BOARD_NOT_VALIDATED, 581 .valid = EM28XX_BOARD_NOT_VALIDATED,
577 .has_msp34xx = 1, 582 .has_msp34xx = 1,
578 .tuner_type = TUNER_XC2028, 583 .tuner_type = TUNER_XC2028,
584 .tuner_gpio = default_tuner_gpio,
579 .decoder = EM28XX_TVP5150, 585 .decoder = EM28XX_TVP5150,
580 .input = { { 586 .input = { {
581 .type = EM28XX_VMUX_TELEVISION, 587 .type = EM28XX_VMUX_TELEVISION,
@@ -598,6 +604,7 @@ struct em28xx_board em28xx_boards[] = {
598 .name = "Hauppauge WinTV HVR 900", 604 .name = "Hauppauge WinTV HVR 900",
599 .tda9887_conf = TDA9887_PRESENT, 605 .tda9887_conf = TDA9887_PRESENT,
600 .tuner_type = TUNER_XC2028, 606 .tuner_type = TUNER_XC2028,
607 .tuner_gpio = default_tuner_gpio,
601 .mts_firmware = 1, 608 .mts_firmware = 1,
602 .has_dvb = 1, 609 .has_dvb = 1,
603 .dvb_gpio = hauppauge_wintv_hvr_900_digital, 610 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
@@ -623,6 +630,7 @@ struct em28xx_board em28xx_boards[] = {
623 .name = "Hauppauge WinTV HVR 900 (R2)", 630 .name = "Hauppauge WinTV HVR 900 (R2)",
624 .tda9887_conf = TDA9887_PRESENT, 631 .tda9887_conf = TDA9887_PRESENT,
625 .tuner_type = TUNER_XC2028, 632 .tuner_type = TUNER_XC2028,
633 .tuner_gpio = default_tuner_gpio,
626 .mts_firmware = 1, 634 .mts_firmware = 1,
627 .decoder = EM28XX_TVP5150, 635 .decoder = EM28XX_TVP5150,
628 .input = { { 636 .input = { {
@@ -645,6 +653,7 @@ struct em28xx_board em28xx_boards[] = {
645 [EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950] = { 653 [EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950] = {
646 .name = "Hauppauge WinTV HVR 950", 654 .name = "Hauppauge WinTV HVR 950",
647 .tuner_type = TUNER_XC2028, 655 .tuner_type = TUNER_XC2028,
656 .tuner_gpio = default_tuner_gpio,
648 .mts_firmware = 1, 657 .mts_firmware = 1,
649 .has_dvb = 1, 658 .has_dvb = 1,
650 .dvb_gpio = hauppauge_wintv_hvr_900_digital, 659 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
@@ -670,6 +679,7 @@ struct em28xx_board em28xx_boards[] = {
670 [EM2880_BOARD_PINNACLE_PCTV_HD_PRO] = { 679 [EM2880_BOARD_PINNACLE_PCTV_HD_PRO] = {
671 .name = "Pinnacle PCTV HD Pro Stick", 680 .name = "Pinnacle PCTV HD Pro Stick",
672 .tuner_type = TUNER_XC2028, 681 .tuner_type = TUNER_XC2028,
682 .tuner_gpio = default_tuner_gpio,
673 .mts_firmware = 1, 683 .mts_firmware = 1,
674 .has_dvb = 1, 684 .has_dvb = 1,
675 .dvb_gpio = hauppauge_wintv_hvr_900_digital, 685 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
@@ -695,6 +705,7 @@ struct em28xx_board em28xx_boards[] = {
695 [EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600] = { 705 [EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600] = {
696 .name = "AMD ATI TV Wonder HD 600", 706 .name = "AMD ATI TV Wonder HD 600",
697 .tuner_type = TUNER_XC2028, 707 .tuner_type = TUNER_XC2028,
708 .tuner_gpio = default_tuner_gpio,
698 .mts_firmware = 1, 709 .mts_firmware = 1,
699 .has_dvb = 1, 710 .has_dvb = 1,
700 .dvb_gpio = hauppauge_wintv_hvr_900_digital, 711 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
@@ -720,6 +731,7 @@ struct em28xx_board em28xx_boards[] = {
720 [EM2880_BOARD_TERRATEC_HYBRID_XS] = { 731 [EM2880_BOARD_TERRATEC_HYBRID_XS] = {
721 .name = "Terratec Hybrid XS", 732 .name = "Terratec Hybrid XS",
722 .tuner_type = TUNER_XC2028, 733 .tuner_type = TUNER_XC2028,
734 .tuner_gpio = default_tuner_gpio,
723 .decoder = EM28XX_TVP5150, 735 .decoder = EM28XX_TVP5150,
724 .has_dvb = 1, 736 .has_dvb = 1,
725 .dvb_gpio = default_analog, 737 .dvb_gpio = default_analog,
@@ -746,6 +758,7 @@ struct em28xx_board em28xx_boards[] = {
746 [EM2880_BOARD_TERRATEC_PRODIGY_XS] = { 758 [EM2880_BOARD_TERRATEC_PRODIGY_XS] = {
747 .name = "Terratec Prodigy XS", 759 .name = "Terratec Prodigy XS",
748 .tuner_type = TUNER_XC2028, 760 .tuner_type = TUNER_XC2028,
761 .tuner_gpio = default_tuner_gpio,
749 .decoder = EM28XX_TVP5150, 762 .decoder = EM28XX_TVP5150,
750 .input = { { 763 .input = { {
751 .type = EM28XX_VMUX_TELEVISION, 764 .type = EM28XX_VMUX_TELEVISION,
@@ -932,6 +945,7 @@ struct em28xx_board em28xx_boards[] = {
932 .name = "MSI DigiVox A/D", 945 .name = "MSI DigiVox A/D",
933 .valid = EM28XX_BOARD_NOT_VALIDATED, 946 .valid = EM28XX_BOARD_NOT_VALIDATED,
934 .tuner_type = TUNER_XC2028, 947 .tuner_type = TUNER_XC2028,
948 .tuner_gpio = default_tuner_gpio,
935 .decoder = EM28XX_TVP5150, 949 .decoder = EM28XX_TVP5150,
936 .input = { { 950 .input = { {
937 .type = EM28XX_VMUX_TELEVISION, 951 .type = EM28XX_VMUX_TELEVISION,
@@ -954,6 +968,7 @@ struct em28xx_board em28xx_boards[] = {
954 .name = "MSI DigiVox A/D II", 968 .name = "MSI DigiVox A/D II",
955 .valid = EM28XX_BOARD_NOT_VALIDATED, 969 .valid = EM28XX_BOARD_NOT_VALIDATED,
956 .tuner_type = TUNER_XC2028, 970 .tuner_type = TUNER_XC2028,
971 .tuner_gpio = default_tuner_gpio,
957 .decoder = EM28XX_TVP5150, 972 .decoder = EM28XX_TVP5150,
958 .input = { { 973 .input = { {
959 .type = EM28XX_VMUX_TELEVISION, 974 .type = EM28XX_VMUX_TELEVISION,
@@ -976,6 +991,7 @@ struct em28xx_board em28xx_boards[] = {
976 .name = "KWorld DVB-T 305U", 991 .name = "KWorld DVB-T 305U",
977 .valid = EM28XX_BOARD_NOT_VALIDATED, 992 .valid = EM28XX_BOARD_NOT_VALIDATED,
978 .tuner_type = TUNER_XC2028, 993 .tuner_type = TUNER_XC2028,
994 .tuner_gpio = default_tuner_gpio,
979 .decoder = EM28XX_TVP5150, 995 .decoder = EM28XX_TVP5150,
980 .input = { { 996 .input = { {
981 .type = EM28XX_VMUX_TELEVISION, 997 .type = EM28XX_VMUX_TELEVISION,
@@ -994,6 +1010,7 @@ struct em28xx_board em28xx_boards[] = {
994 [EM2880_BOARD_KWORLD_DVB_310U] = { 1010 [EM2880_BOARD_KWORLD_DVB_310U] = {
995 .name = "KWorld DVB-T 310U", 1011 .name = "KWorld DVB-T 310U",
996 .tuner_type = TUNER_XC2028, 1012 .tuner_type = TUNER_XC2028,
1013 .tuner_gpio = default_tuner_gpio,
997 .has_dvb = 1, 1014 .has_dvb = 1,
998 .dvb_gpio = default_digital, 1015 .dvb_gpio = default_digital,
999 .mts_firmware = 1, 1016 .mts_firmware = 1,
@@ -1019,6 +1036,7 @@ struct em28xx_board em28xx_boards[] = {
1019 .name = "DNT DA2 Hybrid", 1036 .name = "DNT DA2 Hybrid",
1020 .valid = EM28XX_BOARD_NOT_VALIDATED, 1037 .valid = EM28XX_BOARD_NOT_VALIDATED,
1021 .tuner_type = TUNER_XC2028, 1038 .tuner_type = TUNER_XC2028,
1039 .tuner_gpio = default_tuner_gpio,
1022 .decoder = EM28XX_TVP5150, 1040 .decoder = EM28XX_TVP5150,
1023 .input = { { 1041 .input = { {
1024 .type = EM28XX_VMUX_TELEVISION, 1042 .type = EM28XX_VMUX_TELEVISION,
@@ -1041,6 +1059,7 @@ struct em28xx_board em28xx_boards[] = {
1041 .name = "Pinnacle Hybrid Pro", 1059 .name = "Pinnacle Hybrid Pro",
1042 .valid = EM28XX_BOARD_NOT_VALIDATED, 1060 .valid = EM28XX_BOARD_NOT_VALIDATED,
1043 .tuner_type = TUNER_XC2028, 1061 .tuner_type = TUNER_XC2028,
1062 .tuner_gpio = default_tuner_gpio,
1044 .decoder = EM28XX_TVP5150, 1063 .decoder = EM28XX_TVP5150,
1045 .input = { { 1064 .input = { {
1046 .type = EM28XX_VMUX_TELEVISION, 1065 .type = EM28XX_VMUX_TELEVISION,
@@ -1063,6 +1082,7 @@ struct em28xx_board em28xx_boards[] = {
1063 .name = "Pinnacle Hybrid Pro (2)", 1082 .name = "Pinnacle Hybrid Pro (2)",
1064 .valid = EM28XX_BOARD_NOT_VALIDATED, 1083 .valid = EM28XX_BOARD_NOT_VALIDATED,
1065 .tuner_type = TUNER_XC2028, 1084 .tuner_type = TUNER_XC2028,
1085 .tuner_gpio = default_tuner_gpio,
1066 .mts_firmware = 1, 1086 .mts_firmware = 1,
1067 .decoder = EM28XX_TVP5150, 1087 .decoder = EM28XX_TVP5150,
1068 .input = { { 1088 .input = { {
@@ -1086,6 +1106,7 @@ struct em28xx_board em28xx_boards[] = {
1086 .name = "Kworld VS-DVB-T 323UR", 1106 .name = "Kworld VS-DVB-T 323UR",
1087 .valid = EM28XX_BOARD_NOT_VALIDATED, 1107 .valid = EM28XX_BOARD_NOT_VALIDATED,
1088 .tuner_type = TUNER_XC2028, 1108 .tuner_type = TUNER_XC2028,
1109 .tuner_gpio = default_tuner_gpio,
1089 .decoder = EM28XX_TVP5150, 1110 .decoder = EM28XX_TVP5150,
1090 .input = { { 1111 .input = { {
1091 .type = EM28XX_VMUX_TELEVISION, 1112 .type = EM28XX_VMUX_TELEVISION,
@@ -1105,6 +1126,7 @@ struct em28xx_board em28xx_boards[] = {
1105 .name = "Terratec Hybrid XS (em2882)", 1126 .name = "Terratec Hybrid XS (em2882)",
1106 .valid = EM28XX_BOARD_NOT_VALIDATED, 1127 .valid = EM28XX_BOARD_NOT_VALIDATED,
1107 .tuner_type = TUNER_XC2028, 1128 .tuner_type = TUNER_XC2028,
1129 .tuner_gpio = default_tuner_gpio,
1108 .decoder = EM28XX_TVP5150, 1130 .decoder = EM28XX_TVP5150,
1109 .input = { { 1131 .input = { {
1110 .type = EM28XX_VMUX_TELEVISION, 1132 .type = EM28XX_VMUX_TELEVISION,
@@ -1127,6 +1149,7 @@ struct em28xx_board em28xx_boards[] = {
1127 .name = "Kworld PlusTV HD Hybrid 330", 1149 .name = "Kworld PlusTV HD Hybrid 330",
1128 .valid = EM28XX_BOARD_NOT_VALIDATED, 1150 .valid = EM28XX_BOARD_NOT_VALIDATED,
1129 .tuner_type = TUNER_XC2028, 1151 .tuner_type = TUNER_XC2028,
1152 .tuner_gpio = default_tuner_gpio,
1130 .decoder = EM28XX_TVP5150, 1153 .decoder = EM28XX_TVP5150,
1131 .input = { { 1154 .input = { {
1132 .type = EM28XX_VMUX_TELEVISION, 1155 .type = EM28XX_VMUX_TELEVISION,
@@ -1311,7 +1334,7 @@ int em28xx_tuner_callback(void *ptr, int component, int command, int arg)
1311 if (command != XC2028_TUNER_RESET) 1334 if (command != XC2028_TUNER_RESET)
1312 return 0; 1335 return 0;
1313 1336
1314 rc = em28xx_gpio_set(dev, dev->tuner_gpio); 1337 rc = em28xx_gpio_set(dev, dev->board.tuner_gpio);
1315 1338
1316 return rc; 1339 return rc;
1317} 1340}
@@ -1448,11 +1471,7 @@ void em28xx_pre_card_setup(struct em28xx *dev)
1448 break; 1471 break;
1449 } 1472 }
1450 1473
1451 /* Sets the default callback. Used only for certain tuners */ 1474 em28xx_gpio_set(dev, dev->board.tuner_gpio);
1452 if (!dev->tuner_gpio)
1453 dev->tuner_gpio = default_callback;
1454
1455 em28xx_gpio_set(dev, dev->tuner_gpio);
1456 em28xx_set_mode(dev, EM28XX_ANALOG_MODE); 1475 em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
1457 1476
1458 /* Unlock device */ 1477 /* Unlock device */