diff options
author | Gerd Knorr <devnull@localhost> | 2004-10-06 13:45:14 +0000 |
---|---|---|
committer | Gerd Knorr <devnull@localhost> | 2004-10-06 13:45:14 +0000 |
commit | a1ae31f75dbc6e51f7ae1a986d81e18f8425194d (patch) | |
tree | 756e008594467ce7765fe1c63368b1fe429ad15b /linux/drivers/media/video | |
parent | f9588488a6f3d240f037a3b94ca36e2ad7ff2b3f (diff) | |
download | mediapointer-dvb-s2-a1ae31f75dbc6e51f7ae1a986d81e18f8425194d.tar.gz mediapointer-dvb-s2-a1ae31f75dbc6e51f7ae1a986d81e18f8425194d.tar.bz2 |
- cx88: AverTV Studio 303 (M126) fixes.
Diffstat (limited to 'linux/drivers/media/video')
-rw-r--r-- | linux/drivers/media/video/bttv-cards.c | 214 | ||||
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-cards.c | 11 | ||||
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-video.c | 4 | ||||
-rw-r--r-- | linux/drivers/media/video/tda9887.c | 2 |
4 files changed, 116 insertions, 115 deletions
diff --git a/linux/drivers/media/video/bttv-cards.c b/linux/drivers/media/video/bttv-cards.c index 3a897ccf4..fe7220584 100644 --- a/linux/drivers/media/video/bttv-cards.c +++ b/linux/drivers/media/video/bttv-cards.c @@ -1,5 +1,5 @@ /* - $Id: bttv-cards.c,v 1.27 2004/09/16 15:38:41 kraxel Exp $ + $Id: bttv-cards.c,v 1.28 2004/10/06 13:45:14 kraxel Exp $ bttv-cards.c @@ -2569,6 +2569,7 @@ void __devinit bttv_init_card1(struct bttv *btv) /* initialization part two -- after registering i2c bus */ void __devinit bttv_init_card2(struct bttv *btv) { + int tda9887; btv->tuner_type = -1; if (BTTV_UNKNOWN == btv->c.type) { @@ -2736,45 +2737,40 @@ void __devinit bttv_init_card2(struct bttv *btv) boot_bt832(btv); } + if (!autoload) + return; + /* try to detect audio/fader chips */ if (!bttv_tvcards[btv->c.type].no_msp34xx && - bttv_I2CRead(btv, I2C_MSP3400, "MSP34xx") >=0) { - if (autoload) - request_module("msp3400"); - } + bttv_I2CRead(btv, I2C_MSP3400, "MSP34xx") >=0) + request_module("msp3400"); if (bttv_tvcards[btv->c.type].msp34xx_alt && - bttv_I2CRead(btv, I2C_MSP3400_ALT, "MSP34xx (alternate address)") >=0) { - if (autoload) - request_module("msp3400"); - } + bttv_I2CRead(btv, I2C_MSP3400_ALT, "MSP34xx (alternate address)") >=0) + request_module("msp3400"); if (!bttv_tvcards[btv->c.type].no_tda9875 && - bttv_I2CRead(btv, I2C_TDA9875, "TDA9875") >=0) { - if (autoload) - request_module("tda9875"); - } + bttv_I2CRead(btv, I2C_TDA9875, "TDA9875") >=0) + request_module("tda9875"); if (!bttv_tvcards[btv->c.type].no_tda7432 && - bttv_I2CRead(btv, I2C_TDA7432, "TDA7432") >=0) { - if (autoload) - request_module("tda7432"); - } + bttv_I2CRead(btv, I2C_TDA7432, "TDA7432") >=0) + request_module("tda7432"); - if (bttv_tvcards[btv->c.type].needs_tvaudio) { - if (autoload) - request_module("tvaudio"); - } + if (bttv_tvcards[btv->c.type].needs_tvaudio) + request_module("tvaudio"); /* tuner modules */ - if (btv->pinnacle_id != UNSET) { - if (autoload) - request_module("tda9887"); - } - if (btv->tuner_type != UNSET) { - if (autoload) - request_module("tuner"); - } + tda9887 = 0; + if (btv->pinnacle_id != UNSET) + tda9887 = 1; + if (0 == tda9887 && 0 == bttv_tvcards[btv->c.type].has_dvb && + bttv_I2CRead(btv, I2C_TDA9887, "TDA9887") >=0) + tda9887 = 1; + if (tda9887) + request_module("tda9887"); + if (btv->tuner_type != UNSET) + request_module("tuner"); } @@ -4060,6 +4056,86 @@ static void ivc120_muxsel(struct bttv *btv, unsigned int input) } +/* PXC200 muxsel helper + * luke@syseng.anu.edu.au + * another transplant + * from Alessandro Rubini (rubini@linux.it) + * + * There are 4 kinds of cards: + * PXC200L which is bt848 + * PXC200F which is bt848 with PIC controlling mux + * PXC200AL which is bt878 + * PXC200AF which is bt878 with PIC controlling mux + */ +#define PX_CFG_PXC200F 0x01 +#define PX_FLAG_PXC200A 0x00001000 /* a pxc200A is bt-878 based */ +#define PX_I2C_PIC 0x0f +#define PX_PXC200A_CARDID 0x200a1295 +#define PX_I2C_CMD_CFG 0x00 + +static void PXC200_muxsel(struct bttv *btv, unsigned int input) +{ + int rc; + long mux; + int bitmask; + unsigned char buf[2]; + + /* Read PIC config to determine if this is a PXC200F */ + /* PX_I2C_CMD_CFG*/ + buf[0]=0; + buf[1]=0; + rc=bttv_I2CWrite(btv,(PX_I2C_PIC<<1),buf[0],buf[1],1); + if (rc) { + printk(KERN_DEBUG "bttv%d: PXC200_muxsel: pic cfg write failed:%d\n", btv->c.nr,rc); + /* not PXC ? do nothing */ + return; + } + + rc=bttv_I2CRead(btv,(PX_I2C_PIC<<1),NULL); + if (!(rc & PX_CFG_PXC200F)) { + printk(KERN_DEBUG "bttv%d: PXC200_muxsel: not PXC200F rc:%d \n", btv->c.nr,rc); + return; + } + + + /* The multiplexer in the 200F is handled by the GPIO port */ + /* get correct mapping between inputs */ + /* mux = bttv_tvcards[btv->type].muxsel[input] & 3; */ + /* ** not needed!? */ + mux = input; + + /* make sure output pins are enabled */ + /* bitmask=0x30f; */ + bitmask=0x302; + /* check whether we have a PXC200A */ + if (btv->cardid == PX_PXC200A_CARDID) { + bitmask ^= 0x180; /* use 7 and 9, not 8 and 9 */ + bitmask |= 7<<4; /* the DAC */ + } + btwrite(bitmask, BT848_GPIO_OUT_EN); + + bitmask = btread(BT848_GPIO_DATA); + if (btv->cardid == PX_PXC200A_CARDID) + bitmask = (bitmask & ~0x280) | ((mux & 2) << 8) | ((mux & 1) << 7); + else /* older device */ + bitmask = (bitmask & ~0x300) | ((mux & 3) << 8); + btwrite(bitmask,BT848_GPIO_DATA); + + /* + * Was "to be safe, set the bt848 to input 0" + * Actually, since it's ok at load time, better not messing + * with these bits (on PXC200AF you need to set mux 2 here) + * + * needed because bttv-driver sets mux before calling this function + */ + if (btv->cardid == PX_PXC200A_CARDID) + btaor(2<<5, ~BT848_IFORM_MUXSEL, BT848_IFORM); + else /* older device */ + btand(~BT848_IFORM_MUXSEL,BT848_IFORM); + + printk(KERN_DEBUG "bttv%d: setting input channel to:%d\n", btv->c.nr,(int)mux); +} + /* ----------------------------------------------------------------------- */ /* motherboard chipset specific stuff */ @@ -4146,86 +4222,6 @@ int __devinit bttv_handle_chipset(struct bttv *btv) } -/* PXC200 muxsel helper - * luke@syseng.anu.edu.au - * another transplant - * from Alessandro Rubini (rubini@linux.it) - * - * There are 4 kinds of cards: - * PXC200L which is bt848 - * PXC200F which is bt848 with PIC controlling mux - * PXC200AL which is bt878 - * PXC200AF which is bt878 with PIC controlling mux - */ -#define PX_CFG_PXC200F 0x01 -#define PX_FLAG_PXC200A 0x00001000 /* a pxc200A is bt-878 based */ -#define PX_I2C_PIC 0x0f -#define PX_PXC200A_CARDID 0x200a1295 -#define PX_I2C_CMD_CFG 0x00 - -static void PXC200_muxsel(struct bttv *btv, unsigned int input) -{ - int rc; - long mux; - int bitmask; - unsigned char buf[2]; - - /* Read PIC config to determine if this is a PXC200F */ - /* PX_I2C_CMD_CFG*/ - buf[0]=0; - buf[1]=0; - rc=bttv_I2CWrite(btv,(PX_I2C_PIC<<1),buf[0],buf[1],1); - if (rc) { - printk(KERN_DEBUG "bttv%d: PXC200_muxsel: pic cfg write failed:%d\n", btv->c.nr,rc); - /* not PXC ? do nothing */ - return; - } - - rc=bttv_I2CRead(btv,(PX_I2C_PIC<<1),NULL); - if (!(rc & PX_CFG_PXC200F)) { - printk(KERN_DEBUG "bttv%d: PXC200_muxsel: not PXC200F rc:%d \n", btv->c.nr,rc); - return; - } - - - /* The multiplexer in the 200F is handled by the GPIO port */ - /* get correct mapping between inputs */ - /* mux = bttv_tvcards[btv->type].muxsel[input] & 3; */ - /* ** not needed!? */ - mux = input; - - /* make sure output pins are enabled */ - /* bitmask=0x30f; */ - bitmask=0x302; - /* check whether we have a PXC200A */ - if (btv->cardid == PX_PXC200A_CARDID) { - bitmask ^= 0x180; /* use 7 and 9, not 8 and 9 */ - bitmask |= 7<<4; /* the DAC */ - } - btwrite(bitmask, BT848_GPIO_OUT_EN); - - bitmask = btread(BT848_GPIO_DATA); - if (btv->cardid == PX_PXC200A_CARDID) - bitmask = (bitmask & ~0x280) | ((mux & 2) << 8) | ((mux & 1) << 7); - else /* older device */ - bitmask = (bitmask & ~0x300) | ((mux & 3) << 8); - btwrite(bitmask,BT848_GPIO_DATA); - - /* - * Was "to be safe, set the bt848 to input 0" - * Actually, since it's ok at load time, better not messing - * with these bits (on PXC200AF you need to set mux 2 here) - * - * needed because bttv-driver sets mux before calling this function - */ - if (btv->cardid == PX_PXC200A_CARDID) - btaor(2<<5, ~BT848_IFORM_MUXSEL, BT848_IFORM); - else /* older device */ - btand(~BT848_IFORM_MUXSEL,BT848_IFORM); - - printk(KERN_DEBUG "bttv%d: setting input channel to:%d\n", btv->c.nr,(int)mux); -} - /* * Local variables: * c-basic-offset: 8 diff --git a/linux/drivers/media/video/cx88/cx88-cards.c b/linux/drivers/media/video/cx88/cx88-cards.c index 2caf7155b..fb87022de 100644 --- a/linux/drivers/media/video/cx88/cx88-cards.c +++ b/linux/drivers/media/video/cx88/cx88-cards.c @@ -1,5 +1,5 @@ /* - * $Id: cx88-cards.c,v 1.41 2004/09/23 13:58:19 kraxel Exp $ + * $Id: cx88-cards.c,v 1.42 2004/10/06 13:45:15 kraxel Exp $ * * device driver for Conexant 2388x based TV cards * card-specific stuff. @@ -156,10 +156,15 @@ struct cx88_board cx88_boards[] = { .input = {{ .type = CX88_VMUX_TELEVISION, .vmux = 0, - .gpio1 = 0x3004, + .gpio1 = 0x309f, },{ - .type = CX88_VMUX_COMPOSITE2, + .type = CX88_VMUX_COMPOSITE1, + .vmux = 1, + .gpio1 = 0x305f, + },{ + .type = CX88_VMUX_SVIDEO, .vmux = 2, + .gpio1 = 0x305f, }}, .radio = { .type = CX88_RADIO, diff --git a/linux/drivers/media/video/cx88/cx88-video.c b/linux/drivers/media/video/cx88/cx88-video.c index e775965f9..0f9f87492 100644 --- a/linux/drivers/media/video/cx88/cx88-video.c +++ b/linux/drivers/media/video/cx88/cx88-video.c @@ -1,5 +1,5 @@ /* - * $Id: cx88-video.c,v 1.35 2004/09/23 13:58:19 kraxel Exp $ + * $Id: cx88-video.c,v 1.36 2004/10/06 13:45:15 kraxel Exp $ * * device driver for Conexant 2388x based TV cards * video4linux video interface @@ -387,10 +387,10 @@ static int video_mux(struct cx8800_dev *dev, unsigned int input) INPUT(input)->gpio2,INPUT(input)->gpio3); dev->core->input = input; cx_andor(MO_INPUT_FORMAT, 0x03 << 14, INPUT(input)->vmux << 14); + cx_write(MO_GP3_IO, INPUT(input)->gpio3); cx_write(MO_GP0_IO, INPUT(input)->gpio0); cx_write(MO_GP1_IO, INPUT(input)->gpio1); cx_write(MO_GP2_IO, INPUT(input)->gpio2); - cx_write(MO_GP3_IO, INPUT(input)->gpio3); switch (INPUT(input)->type) { case CX88_VMUX_SVIDEO: diff --git a/linux/drivers/media/video/tda9887.c b/linux/drivers/media/video/tda9887.c index 779a98a4a..5c7c9b17a 100644 --- a/linux/drivers/media/video/tda9887.c +++ b/linux/drivers/media/video/tda9887.c @@ -582,7 +582,7 @@ static int tda9887_attach(struct i2c_adapter *adap, int addr, return -ENOMEM; memset(t,0,sizeof(*t)); t->client = client_template; - t->std = 0;; + t->std = 0; t->pinnacle_id = UNSET; i2c_set_clientdata(&t->client, t); i2c_attach_client(&t->client); |