Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 241840
b: refs/heads/master
c: 2f86138
h: refs/heads/master
v: v3
  • Loading branch information
Mauro Carvalho Chehab committed Mar 21, 2011
1 parent bb405e6 commit 424b9ca
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 29 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3f25ffa2cd946333d29a668993f5aa78e9b56a02
refs/heads/master: 2f86138706d3b5c85a69e72ca2959717372386dd
12 changes: 4 additions & 8 deletions trunk/drivers/media/video/cx231xx/cx231xx-avcore.c
Original file line number Diff line number Diff line change
Expand Up @@ -759,11 +759,8 @@ int cx231xx_set_decoder_video_input(struct cx231xx *dev,
case CX231XX_VMUX_TELEVISION:
case CX231XX_VMUX_CABLE:
default:
switch (dev->model) {
case CX231XX_BOARD_CNXT_CARRAERA:
case CX231XX_BOARD_CNXT_RDE_250:
case CX231XX_BOARD_CNXT_SHELBY:
case CX231XX_BOARD_CNXT_RDU_250:
/* TODO: Test if this is also needed for xc2028/xc3028 */
if (dev->board.tuner_type == TUNER_XC5000) {
/* Disable the use of DIF */

status = vid_blk_read_word(dev, AFE_CTRL, &value);
Expand Down Expand Up @@ -820,8 +817,7 @@ int cx231xx_set_decoder_video_input(struct cx231xx *dev,
MODE_CTRL, FLD_INPUT_MODE,
cx231xx_set_field(FLD_INPUT_MODE,
INPUT_MODE_CVBS_0));
break;
default:
} else {
/* Enable the DIF for the tuner */

/* Reinitialize the DIF */
Expand Down Expand Up @@ -2550,7 +2546,7 @@ int cx231xx_initialize_stream_xfer(struct cx231xx *dev, u32 media_type)
case 4: /* ts1 */
cx231xx_info("%s: set ts1 registers", __func__);

if (dev->model == CX231XX_BOARD_CNXT_VIDEO_GRABBER) {
if (dev->board.has_417) {
cx231xx_info(" MPEG\n");
value &= 0xFFFFFFFC;
value |= 0x3;
Expand Down
7 changes: 6 additions & 1 deletion trunk/drivers/media/video/cx231xx/cx231xx-cards.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,9 @@ struct cx231xx_board cx231xx_boards[] = {
.agc_analog_digital_select_gpio = 0x1c,
.gpio_pin_status_mask = 0x4001000,
.norm = V4L2_STD_PAL,
.no_alt_vanc = 1,
.external_av = 1,
.has_417 = 1,

.input = {{
.type = CX231XX_VMUX_COMPOSITE1,
Expand Down Expand Up @@ -382,6 +385,8 @@ struct cx231xx_board cx231xx_boards[] = {
.agc_analog_digital_select_gpio = 0x0c,
.gpio_pin_status_mask = 0x4001000,
.norm = V4L2_STD_NTSC,
.no_alt_vanc = 1,
.external_av = 1,
.input = {{
.type = CX231XX_VMUX_COMPOSITE1,
.vmux = CX231XX_VIN_2_1,
Expand Down Expand Up @@ -772,7 +777,7 @@ static int cx231xx_init_dev(struct cx231xx **devhandle, struct usb_device *udev,
/* Reset other chips required if they are tied up with GPIO pins */
cx231xx_add_into_devlist(dev);

if (dev->model == CX231XX_BOARD_CNXT_VIDEO_GRABBER) {
if (dev->board.has_417) {
printk(KERN_INFO "attach 417 %d\n", dev->model);
if (cx231xx_417_register(dev) < 0) {
printk(KERN_ERR
Expand Down
16 changes: 7 additions & 9 deletions trunk/drivers/media/video/cx231xx/cx231xx-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,8 @@ int cx231xx_set_alt_setting(struct cx231xx *dev, u8 index, u8 alt)
alt];
break;
case INDEX_VANC:
if (dev->board.no_alt_vanc)
return 0;
usb_interface_index =
dev->current_pcb_config.hs_config_info[0].interface_info.
vanc_index + 1;
Expand Down Expand Up @@ -600,8 +602,7 @@ int cx231xx_set_alt_setting(struct cx231xx *dev, u8 index, u8 alt)
usb_interface_index, alt);
/*To workaround error number=-71 on EP0 for videograbber,
need add following codes.*/
if (dev->model != CX231XX_BOARD_CNXT_VIDEO_GRABBER &&
dev->model != CX231XX_BOARD_HAUPPAUGE_USBLIVE2)
if (dev->board.no_alt_vanc)
return -1;
}

Expand Down Expand Up @@ -1301,8 +1302,7 @@ int cx231xx_dev_init(struct cx231xx *dev)
/* init hardware */
/* Note : with out calling set power mode function,
afe can not be set up correctly */
if (dev->model == CX231XX_BOARD_CNXT_VIDEO_GRABBER ||
dev->model == CX231XX_BOARD_HAUPPAUGE_USBLIVE2) {
if (dev->board.external_av) {
errCode = cx231xx_set_power_mode(dev,
POLARIS_AVMODE_ENXTERNAL_AV);
if (errCode < 0) {
Expand All @@ -1322,11 +1322,9 @@ int cx231xx_dev_init(struct cx231xx *dev)
}
}

/* reset the Tuner */
if ((dev->model == CX231XX_BOARD_CNXT_CARRAERA) ||
(dev->model == CX231XX_BOARD_CNXT_RDE_250) ||
(dev->model == CX231XX_BOARD_CNXT_SHELBY) ||
(dev->model == CX231XX_BOARD_CNXT_RDU_250))
/* reset the Tuner, if it is a Xceive tuner */
if ((dev->board.tuner_type == TUNER_XC5000) ||
(dev->board.tuner_type == TUNER_XC2028))
cx231xx_gpio_set(dev, dev->board.tuner_gpio);

/* initialize Colibri block */
Expand Down
20 changes: 10 additions & 10 deletions trunk/drivers/media/video/cx231xx/cx231xx-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -2190,8 +2190,7 @@ static int cx231xx_v4l2_open(struct file *filp)
dev->height = norm_maxh(dev);

/* Power up in Analog TV mode */
if (dev->model == CX231XX_BOARD_CNXT_VIDEO_GRABBER ||
dev->model == CX231XX_BOARD_HAUPPAUGE_USBLIVE2)
if (dev->board.external_av)
cx231xx_set_power_mode(dev,
POLARIS_AVMODE_ENXTERNAL_AV);
else
Expand Down Expand Up @@ -2231,9 +2230,7 @@ static int cx231xx_v4l2_open(struct file *filp)
if (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) {
/* Set the required alternate setting VBI interface works in
Bulk mode only */
if (dev->model != CX231XX_BOARD_CNXT_VIDEO_GRABBER &&
dev->model != CX231XX_BOARD_HAUPPAUGE_USBLIVE2)
cx231xx_set_alt_setting(dev, INDEX_VANC, 0);
cx231xx_set_alt_setting(dev, INDEX_VANC, 0);

videobuf_queue_vmalloc_init(&fh->vb_vidq, &cx231xx_vbi_qops,
NULL, &dev->vbi_mode.slock,
Expand Down Expand Up @@ -2275,7 +2272,7 @@ void cx231xx_release_analog_resources(struct cx231xx *dev)
cx231xx_info("V4L2 device %s deregistered\n",
video_device_node_name(dev->vdev));

if (dev->model == CX231XX_BOARD_CNXT_VIDEO_GRABBER)
if (dev->board.has_417)
cx231xx_417_unregister(dev);

if (video_is_registered(dev->vdev))
Expand All @@ -2302,10 +2299,13 @@ static int cx231xx_v4l2_close(struct file *filp)
if (res_check(fh))
res_free(fh);

/*To workaround error number=-71 on EP0 for VideoGrabber,
need exclude following.*/
if (dev->model != CX231XX_BOARD_CNXT_VIDEO_GRABBER &&
dev->model != CX231XX_BOARD_HAUPPAUGE_USBLIVE2)
/*
* To workaround error number=-71 on EP0 for VideoGrabber,
* need exclude following.
* FIXME: It is probably safe to remove most of these, as we're
* now avoiding the alternate setting for INDEX_VANC
*/
if (!dev->board.no_alt_vanc)
if (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) {
videobuf_stop(&fh->vb_vidq);
videobuf_mmap_free(&fh->vb_vidq);
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/media/video/cx231xx/cx231xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,10 @@ struct cx231xx_board {

unsigned int max_range_640_480:1;
unsigned int has_dvb:1;
unsigned int has_417:1;
unsigned int valid:1;
unsigned int no_alt_vanc:1;
unsigned int external_av:1;

unsigned char xclk, i2c_speed;

Expand Down

0 comments on commit 424b9ca

Please sign in to comment.