Commit 15f8eeb2 authored by Trent Piepho's avatar Trent Piepho Committed by Mauro Carvalho Chehab

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: default avatarTrent Piepho <xyzzy@speakeasy.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent fb5deb1b
...@@ -73,6 +73,8 @@ static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input); ...@@ -73,6 +73,8 @@ static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input);
static void geovision_muxsel(struct bttv *btv, unsigned int input); static void geovision_muxsel(struct bttv *btv, unsigned int input);
static void phytec_muxsel(struct bttv *btv, unsigned int input);
static int terratec_active_radio_upgrade(struct bttv *btv); static int terratec_active_radio_upgrade(struct bttv *btv);
static int tea5757_read(struct bttv *btv); static int tea5757_read(struct bttv *btv);
static int tea5757_write(struct bttv *btv, int value); static int tea5757_write(struct bttv *btv, int value);
...@@ -2054,10 +2056,9 @@ struct tvcard bttv_tvcards[] = { ...@@ -2054,10 +2056,9 @@ struct tvcard bttv_tvcards[] = {
/* .audio_inputs= 0, */ /* .audio_inputs= 0, */
.svhs = 9, .svhs = 9,
.gpiomask = 0x00, .gpiomask = 0x00,
.gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio .gpiomask2 = 0x03, /* used for external vodeo mux */
via the upper nibble of muxsel. here: used for .muxsel = { 2, 2, 2, 2, 3, 3, 3, 3, 1, 0 },
xternal video-mux */ .muxsel_hook = phytec_muxsel,
.muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x00 },
.gpiomux = { 0, 0, 0, 0 }, /* card has no audio */ .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
.needs_tvaudio = 1, .needs_tvaudio = 1,
.pll = PLL_28, .pll = PLL_28,
...@@ -2070,10 +2071,9 @@ struct tvcard bttv_tvcards[] = { ...@@ -2070,10 +2071,9 @@ struct tvcard bttv_tvcards[] = {
/* .audio_inputs= 0, */ /* .audio_inputs= 0, */
.svhs = 9, .svhs = 9,
.gpiomask = 0x00, .gpiomask = 0x00,
.gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio .gpiomask2 = 0x03, /* used for external vodeo mux */
via the upper nibble of muxsel. here: used for .muxsel = { 2, 2, 2, 2, 3, 3, 3, 3, 1, 1 },
xternal video-mux */ .muxsel_hook = phytec_muxsel,
.muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x01 },
.gpiomux = { 0, 0, 0, 0 }, /* card has no audio */ .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
.needs_tvaudio = 1, .needs_tvaudio = 1,
.pll = PLL_28, .pll = PLL_28,
...@@ -4528,6 +4528,16 @@ static void PXC200_muxsel(struct bttv *btv, unsigned int input) ...@@ -4528,6 +4528,16 @@ static void PXC200_muxsel(struct bttv *btv, unsigned int input)
printk(KERN_DEBUG "bttv%d: setting input channel to:%d\n", btv->c.nr,(int)mux); printk(KERN_DEBUG "bttv%d: setting input channel to:%d\n", btv->c.nr,(int)mux);
} }
static void phytec_muxsel(struct bttv *btv, unsigned int input)
{
unsigned int mux = input % 4;
if (input == btv->svhs)
mux = 0;
gpio_bits(0x3, mux);
}
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
/* motherboard chipset specific stuff */ /* motherboard chipset specific stuff */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment