aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/bt8xx
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2009-01-28 19:32:59 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 11:42:47 -0400
commit15f8eeb2a86b969d82bfca5d54f1fb30c35cf243 (patch)
treeb5aa25723a986e21bb43ca854ba2ec37301e25aa /drivers/media/video/bt8xx
parentfb5deb1b9ecc3c64b713f33ec56781c01a0b11b9 (diff)
V4L/DVB (10564): bttv: fix external mux for PHYTEC VD-009
Old versions of the bttv driver would use the high nibble of an input's muxsel value to program the GPIO lines enabled via gpiomask2. Apparently this was supposed to be for switching external audio muxes. Anyway, the code that did this was removed sometime in the pre-git 2.6 series. These phytec boards used this feature to control an external video mux and I guess no one noticed when they removed the code. So add a muxsel_hook for these boards that does the necessary gpio setting. BTW, I doubt the needs_tvaudio setting for these cards is correct. Cc: Dirk Heer <d.heer@phytec.de> Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/bt8xx')
-rw-r--r--drivers/media/video/bt8xx/bttv-cards.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/drivers/media/video/bt8xx/bttv-cards.c b/drivers/media/video/bt8xx/bttv-cards.c
index d055c2770469..2832bafa3695 100644
--- a/drivers/media/video/bt8xx/bttv-cards.c
+++ b/drivers/media/video/bt8xx/bttv-cards.c
@@ -73,6 +73,8 @@ static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input);
73 73
74static void geovision_muxsel(struct bttv *btv, unsigned int input); 74static void geovision_muxsel(struct bttv *btv, unsigned int input);
75 75
76static void phytec_muxsel(struct bttv *btv, unsigned int input);
77
76static int terratec_active_radio_upgrade(struct bttv *btv); 78static int terratec_active_radio_upgrade(struct bttv *btv);
77static int tea5757_read(struct bttv *btv); 79static int tea5757_read(struct bttv *btv);
78static int tea5757_write(struct bttv *btv, int value); 80static int tea5757_write(struct bttv *btv, int value);
@@ -2054,10 +2056,9 @@ struct tvcard bttv_tvcards[] = {
2054 /* .audio_inputs= 0, */ 2056 /* .audio_inputs= 0, */
2055 .svhs = 9, 2057 .svhs = 9,
2056 .gpiomask = 0x00, 2058 .gpiomask = 0x00,
2057 .gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio 2059 .gpiomask2 = 0x03, /* used for external vodeo mux */
2058 via the upper nibble of muxsel. here: used for 2060 .muxsel = { 2, 2, 2, 2, 3, 3, 3, 3, 1, 0 },
2059 xternal video-mux */ 2061 .muxsel_hook = phytec_muxsel,
2060 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x00 },
2061 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */ 2062 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2062 .needs_tvaudio = 1, 2063 .needs_tvaudio = 1,
2063 .pll = PLL_28, 2064 .pll = PLL_28,
@@ -2070,10 +2071,9 @@ struct tvcard bttv_tvcards[] = {
2070 /* .audio_inputs= 0, */ 2071 /* .audio_inputs= 0, */
2071 .svhs = 9, 2072 .svhs = 9,
2072 .gpiomask = 0x00, 2073 .gpiomask = 0x00,
2073 .gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio 2074 .gpiomask2 = 0x03, /* used for external vodeo mux */
2074 via the upper nibble of muxsel. here: used for 2075 .muxsel = { 2, 2, 2, 2, 3, 3, 3, 3, 1, 1 },
2075 xternal video-mux */ 2076 .muxsel_hook = phytec_muxsel,
2076 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x01 },
2077 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */ 2077 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2078 .needs_tvaudio = 1, 2078 .needs_tvaudio = 1,
2079 .pll = PLL_28, 2079 .pll = PLL_28,
@@ -4528,6 +4528,16 @@ static void PXC200_muxsel(struct bttv *btv, unsigned int input)
4528 printk(KERN_DEBUG "bttv%d: setting input channel to:%d\n", btv->c.nr,(int)mux); 4528 printk(KERN_DEBUG "bttv%d: setting input channel to:%d\n", btv->c.nr,(int)mux);
4529} 4529}
4530 4530
4531static void phytec_muxsel(struct bttv *btv, unsigned int input)
4532{
4533 unsigned int mux = input % 4;
4534
4535 if (input == btv->svhs)
4536 mux = 0;
4537
4538 gpio_bits(0x3, mux);
4539}
4540
4531/* ----------------------------------------------------------------------- */ 4541/* ----------------------------------------------------------------------- */
4532/* motherboard chipset specific stuff */ 4542/* motherboard chipset specific stuff */
4533 4543