diff options
Diffstat (limited to 'drivers/media/pci/saa7134')
-rw-r--r-- | drivers/media/pci/saa7134/saa7134-alsa.c | 2 | ||||
-rw-r--r-- | drivers/media/pci/saa7134/saa7134-dvb.c | 1 | ||||
-rw-r--r-- | drivers/media/pci/saa7134/saa7134-empress.c | 3 | ||||
-rw-r--r-- | drivers/media/pci/saa7134/saa7134-i2c.c | 2 | ||||
-rw-r--r-- | drivers/media/pci/saa7134/saa7134-input.c | 4 | ||||
-rw-r--r-- | drivers/media/pci/saa7134/saa7134-video.c | 41 |
6 files changed, 35 insertions, 18 deletions
diff --git a/drivers/media/pci/saa7134/saa7134-alsa.c b/drivers/media/pci/saa7134/saa7134-alsa.c index 94f816244407..dc0e2fc5f68b 100644 --- a/drivers/media/pci/saa7134/saa7134-alsa.c +++ b/drivers/media/pci/saa7134/saa7134-alsa.c @@ -877,7 +877,7 @@ static struct page *snd_card_saa7134_page(struct snd_pcm_substream *substream, * ALSA capture callbacks definition */ -static struct snd_pcm_ops snd_card_saa7134_capture_ops = { +static const struct snd_pcm_ops snd_card_saa7134_capture_ops = { .open = snd_card_saa7134_capture_open, .close = snd_card_saa7134_capture_close, .ioctl = snd_pcm_lib_ioctl, diff --git a/drivers/media/pci/saa7134/saa7134-dvb.c b/drivers/media/pci/saa7134/saa7134-dvb.c index db987e5b93eb..59a4b5f7724e 100644 --- a/drivers/media/pci/saa7134/saa7134-dvb.c +++ b/drivers/media/pci/saa7134/saa7134-dvb.c @@ -1238,6 +1238,7 @@ static int dvb_init(struct saa7134_dev *dev) q->buf_struct_size = sizeof(struct saa7134_buf); q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; q->lock = &dev->lock; + q->dev = &dev->pci->dev; ret = vb2_queue_init(q); if (ret) { vb2_dvb_dealloc_frontends(&dev->frontends); diff --git a/drivers/media/pci/saa7134/saa7134-empress.c b/drivers/media/pci/saa7134/saa7134-empress.c index ca417a454d67..f0fe2524259f 100644 --- a/drivers/media/pci/saa7134/saa7134-empress.c +++ b/drivers/media/pci/saa7134/saa7134-empress.c @@ -85,7 +85,7 @@ static void stop_streaming(struct vb2_queue *vq) dev->empress_started = 0; } -static struct vb2_ops saa7134_empress_qops = { +static const struct vb2_ops saa7134_empress_qops = { .queue_setup = saa7134_ts_queue_setup, .buf_init = saa7134_ts_buffer_init, .buf_prepare = saa7134_ts_buffer_prepare, @@ -295,6 +295,7 @@ static int empress_init(struct saa7134_dev *dev) q->buf_struct_size = sizeof(struct saa7134_buf); q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; q->lock = &dev->lock; + q->dev = &dev->pci->dev; err = vb2_queue_init(q); if (err) return err; diff --git a/drivers/media/pci/saa7134/saa7134-i2c.c b/drivers/media/pci/saa7134/saa7134-i2c.c index 8ef6399d794f..2dac48fa1386 100644 --- a/drivers/media/pci/saa7134/saa7134-i2c.c +++ b/drivers/media/pci/saa7134/saa7134-i2c.c @@ -338,7 +338,7 @@ static u32 functionality(struct i2c_adapter *adap) return I2C_FUNC_SMBUS_EMUL; } -static struct i2c_algorithm saa7134_algo = { +static const struct i2c_algorithm saa7134_algo = { .master_xfer = saa7134_i2c_xfer, .functionality = functionality, }; diff --git a/drivers/media/pci/saa7134/saa7134-input.c b/drivers/media/pci/saa7134/saa7134-input.c index c8042c3888cd..eff52bbbfd66 100644 --- a/drivers/media/pci/saa7134/saa7134-input.c +++ b/drivers/media/pci/saa7134/saa7134-input.c @@ -345,7 +345,7 @@ static int get_key_beholdm6xx(struct IR_i2c *ir, enum rc_type *protocol, if (data[9] != (unsigned char)(~data[8])) return 0; - *protocol = RC_TYPE_NEC; + *protocol = RC_TYPE_NECX; *scancode = RC_SCANCODE_NECX(data[11] << 8 | data[10], data[9]); *toggle = 0; return 1; @@ -1035,7 +1035,7 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev) dev->init_data.name = "BeholdTV"; dev->init_data.get_key = get_key_beholdm6xx; dev->init_data.ir_codes = RC_MAP_BEHOLD; - dev->init_data.type = RC_BIT_NEC; + dev->init_data.type = RC_BIT_NECX; info.addr = 0x2d; break; case SAA7134_BOARD_AVERMEDIA_CARDBUS_501: diff --git a/drivers/media/pci/saa7134/saa7134-video.c b/drivers/media/pci/saa7134/saa7134-video.c index 8a6ebd087889..cbb173d99085 100644 --- a/drivers/media/pci/saa7134/saa7134-video.c +++ b/drivers/media/pci/saa7134/saa7134-video.c @@ -1054,7 +1054,7 @@ void saa7134_vb2_stop_streaming(struct vb2_queue *vq) pm_qos_remove_request(&dev->qos_request); } -static struct vb2_ops vb2_qops = { +static const struct vb2_ops vb2_qops = { .queue_setup = queue_setup, .buf_init = buffer_init, .buf_prepare = buffer_prepare, @@ -1659,8 +1659,6 @@ static int saa7134_cropcap(struct file *file, void *priv, if (cap->type != V4L2_BUF_TYPE_VIDEO_CAPTURE && cap->type != V4L2_BUF_TYPE_VIDEO_OVERLAY) return -EINVAL; - cap->bounds = dev->crop_bounds; - cap->defrect = dev->crop_defrect; cap->pixelaspect.numerator = 1; cap->pixelaspect.denominator = 1; if (dev->tvnorm->id & V4L2_STD_525_60) { @@ -1674,25 +1672,41 @@ static int saa7134_cropcap(struct file *file, void *priv, return 0; } -static int saa7134_g_crop(struct file *file, void *f, struct v4l2_crop *crop) +static int saa7134_g_selection(struct file *file, void *f, struct v4l2_selection *sel) { struct saa7134_dev *dev = video_drvdata(file); - if (crop->type != V4L2_BUF_TYPE_VIDEO_CAPTURE && - crop->type != V4L2_BUF_TYPE_VIDEO_OVERLAY) + if (sel->type != V4L2_BUF_TYPE_VIDEO_CAPTURE && + sel->type != V4L2_BUF_TYPE_VIDEO_OVERLAY) return -EINVAL; - crop->c = dev->crop_current; + + switch (sel->target) { + case V4L2_SEL_TGT_CROP: + sel->r = dev->crop_current; + break; + case V4L2_SEL_TGT_CROP_DEFAULT: + sel->r = dev->crop_defrect; + break; + case V4L2_SEL_TGT_CROP_BOUNDS: + sel->r = dev->crop_bounds; + break; + default: + return -EINVAL; + } return 0; } -static int saa7134_s_crop(struct file *file, void *f, const struct v4l2_crop *crop) +static int saa7134_s_selection(struct file *file, void *f, struct v4l2_selection *sel) { struct saa7134_dev *dev = video_drvdata(file); struct v4l2_rect *b = &dev->crop_bounds; struct v4l2_rect *c = &dev->crop_current; - if (crop->type != V4L2_BUF_TYPE_VIDEO_CAPTURE && - crop->type != V4L2_BUF_TYPE_VIDEO_OVERLAY) + if (sel->type != V4L2_BUF_TYPE_VIDEO_CAPTURE && + sel->type != V4L2_BUF_TYPE_VIDEO_OVERLAY) + return -EINVAL; + + if (sel->target != V4L2_SEL_TGT_CROP) return -EINVAL; if (dev->overlay_owner) @@ -1700,7 +1714,7 @@ static int saa7134_s_crop(struct file *file, void *f, const struct v4l2_crop *cr if (vb2_is_streaming(&dev->video_vbq)) return -EBUSY; - *c = crop->c; + *c = sel->r; if (c->top < b->top) c->top = b->top; if (c->top > b->top + b->height) @@ -1714,6 +1728,7 @@ static int saa7134_s_crop(struct file *file, void *f, const struct v4l2_crop *cr c->left = b->left + b->width; if (c->width > b->left - c->left + b->width) c->width = b->left - c->left + b->width; + sel->r = *c; return 0; } @@ -1989,8 +2004,8 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = { .vidioc_streamoff = vb2_ioctl_streamoff, .vidioc_g_tuner = saa7134_g_tuner, .vidioc_s_tuner = saa7134_s_tuner, - .vidioc_g_crop = saa7134_g_crop, - .vidioc_s_crop = saa7134_s_crop, + .vidioc_g_selection = saa7134_g_selection, + .vidioc_s_selection = saa7134_s_selection, .vidioc_g_fbuf = saa7134_g_fbuf, .vidioc_s_fbuf = saa7134_s_fbuf, .vidioc_overlay = saa7134_overlay, |