diff options
Diffstat (limited to 'drivers/media/video/bt8xx')
-rw-r--r-- | drivers/media/video/bt8xx/bttv-driver.c | 14 | ||||
-rw-r--r-- | drivers/media/video/bt8xx/bttv-i2c.c | 21 |
2 files changed, 29 insertions, 6 deletions
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c index 23b7499b3185..5eb1464af670 100644 --- a/drivers/media/video/bt8xx/bttv-driver.c +++ b/drivers/media/video/bt8xx/bttv-driver.c | |||
@@ -3152,6 +3152,7 @@ static unsigned int bttv_poll(struct file *file, poll_table *wait) | |||
3152 | struct bttv_fh *fh = file->private_data; | 3152 | struct bttv_fh *fh = file->private_data; |
3153 | struct bttv_buffer *buf; | 3153 | struct bttv_buffer *buf; |
3154 | enum v4l2_field field; | 3154 | enum v4l2_field field; |
3155 | unsigned int rc = POLLERR; | ||
3155 | 3156 | ||
3156 | if (V4L2_BUF_TYPE_VBI_CAPTURE == fh->type) { | 3157 | if (V4L2_BUF_TYPE_VBI_CAPTURE == fh->type) { |
3157 | if (!check_alloc_btres(fh->btv,fh,RESOURCE_VBI)) | 3158 | if (!check_alloc_btres(fh->btv,fh,RESOURCE_VBI)) |
@@ -3160,9 +3161,10 @@ static unsigned int bttv_poll(struct file *file, poll_table *wait) | |||
3160 | } | 3161 | } |
3161 | 3162 | ||
3162 | if (check_btres(fh,RESOURCE_VIDEO_STREAM)) { | 3163 | if (check_btres(fh,RESOURCE_VIDEO_STREAM)) { |
3164 | mutex_lock(&fh->cap.vb_lock); | ||
3163 | /* streaming capture */ | 3165 | /* streaming capture */ |
3164 | if (list_empty(&fh->cap.stream)) | 3166 | if (list_empty(&fh->cap.stream)) |
3165 | return POLLERR; | 3167 | goto err; |
3166 | buf = list_entry(fh->cap.stream.next,struct bttv_buffer,vb.stream); | 3168 | buf = list_entry(fh->cap.stream.next,struct bttv_buffer,vb.stream); |
3167 | } else { | 3169 | } else { |
3168 | /* read() capture */ | 3170 | /* read() capture */ |
@@ -3191,11 +3193,12 @@ static unsigned int bttv_poll(struct file *file, poll_table *wait) | |||
3191 | poll_wait(file, &buf->vb.done, wait); | 3193 | poll_wait(file, &buf->vb.done, wait); |
3192 | if (buf->vb.state == VIDEOBUF_DONE || | 3194 | if (buf->vb.state == VIDEOBUF_DONE || |
3193 | buf->vb.state == VIDEOBUF_ERROR) | 3195 | buf->vb.state == VIDEOBUF_ERROR) |
3194 | return POLLIN|POLLRDNORM; | 3196 | rc = POLLIN|POLLRDNORM; |
3195 | return 0; | 3197 | else |
3198 | rc = 0; | ||
3196 | err: | 3199 | err: |
3197 | mutex_unlock(&fh->cap.vb_lock); | 3200 | mutex_unlock(&fh->cap.vb_lock); |
3198 | return POLLERR; | 3201 | return rc; |
3199 | } | 3202 | } |
3200 | 3203 | ||
3201 | static int bttv_open(struct file *file) | 3204 | static int bttv_open(struct file *file) |
@@ -4166,7 +4169,6 @@ static struct video_device *vdev_init(struct bttv *btv, | |||
4166 | if (NULL == vfd) | 4169 | if (NULL == vfd) |
4167 | return NULL; | 4170 | return NULL; |
4168 | *vfd = *template; | 4171 | *vfd = *template; |
4169 | vfd->minor = -1; | ||
4170 | vfd->v4l2_dev = &btv->c.v4l2_dev; | 4172 | vfd->v4l2_dev = &btv->c.v4l2_dev; |
4171 | vfd->release = video_device_release; | 4173 | vfd->release = video_device_release; |
4172 | vfd->debug = bttv_debug; | 4174 | vfd->debug = bttv_debug; |
@@ -4629,7 +4631,7 @@ static int __init bttv_init_module(void) | |||
4629 | #endif | 4631 | #endif |
4630 | if (gbuffers < 2 || gbuffers > VIDEO_MAX_FRAME) | 4632 | if (gbuffers < 2 || gbuffers > VIDEO_MAX_FRAME) |
4631 | gbuffers = 2; | 4633 | gbuffers = 2; |
4632 | if (gbufsize < 0 || gbufsize > BTTV_MAX_FBUF) | 4634 | if (gbufsize > BTTV_MAX_FBUF) |
4633 | gbufsize = BTTV_MAX_FBUF; | 4635 | gbufsize = BTTV_MAX_FBUF; |
4634 | gbufsize = (gbufsize + PAGE_SIZE - 1) & PAGE_MASK; | 4636 | gbufsize = (gbufsize + PAGE_SIZE - 1) & PAGE_MASK; |
4635 | if (bttv_verbose) | 4637 | if (bttv_verbose) |
diff --git a/drivers/media/video/bt8xx/bttv-i2c.c b/drivers/media/video/bt8xx/bttv-i2c.c index a99d92fac3dc..ebd1ee9dc871 100644 --- a/drivers/media/video/bt8xx/bttv-i2c.c +++ b/drivers/media/video/bt8xx/bttv-i2c.c | |||
@@ -389,6 +389,27 @@ int __devinit init_bttv_i2c(struct bttv *btv) | |||
389 | } | 389 | } |
390 | if (0 == btv->i2c_rc && i2c_scan) | 390 | if (0 == btv->i2c_rc && i2c_scan) |
391 | do_i2c_scan(btv->c.v4l2_dev.name, &btv->i2c_client); | 391 | do_i2c_scan(btv->c.v4l2_dev.name, &btv->i2c_client); |
392 | |||
393 | /* Instantiate the IR receiver device, if present */ | ||
394 | if (0 == btv->i2c_rc) { | ||
395 | struct i2c_board_info info; | ||
396 | /* The external IR receiver is at i2c address 0x34 (0x35 for | ||
397 | reads). Future Hauppauge cards will have an internal | ||
398 | receiver at 0x30 (0x31 for reads). In theory, both can be | ||
399 | fitted, and Hauppauge suggest an external overrides an | ||
400 | internal. | ||
401 | |||
402 | That's why we probe 0x1a (~0x34) first. CB | ||
403 | */ | ||
404 | const unsigned short addr_list[] = { | ||
405 | 0x1a, 0x18, 0x4b, 0x64, 0x30, | ||
406 | I2C_CLIENT_END | ||
407 | }; | ||
408 | |||
409 | memset(&info, 0, sizeof(struct i2c_board_info)); | ||
410 | strlcpy(info.type, "ir_video", I2C_NAME_SIZE); | ||
411 | i2c_new_probed_device(&btv->c.i2c_adap, &info, addr_list); | ||
412 | } | ||
392 | return btv->i2c_rc; | 413 | return btv->i2c_rc; |
393 | } | 414 | } |
394 | 415 | ||