diff options
Diffstat (limited to 'drivers/media/common/saa7146_video.c')
-rw-r--r-- | drivers/media/common/saa7146_video.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/drivers/media/common/saa7146_video.c b/drivers/media/common/saa7146_video.c index 91b7a4def46c..a2a8847e6789 100644 --- a/drivers/media/common/saa7146_video.c +++ b/drivers/media/common/saa7146_video.c | |||
@@ -1,4 +1,5 @@ | |||
1 | #include <media/saa7146_vv.h> | 1 | #include <media/saa7146_vv.h> |
2 | #include <media/v4l2-chip-ident.h> | ||
2 | 3 | ||
3 | static int max_memory = 32; | 4 | static int max_memory = 32; |
4 | 5 | ||
@@ -209,6 +210,7 @@ static struct v4l2_queryctrl controls[] = { | |||
209 | .step = 1, | 210 | .step = 1, |
210 | .default_value = 128, | 211 | .default_value = 128, |
211 | .type = V4L2_CTRL_TYPE_INTEGER, | 212 | .type = V4L2_CTRL_TYPE_INTEGER, |
213 | .flags = V4L2_CTRL_FLAG_SLIDER, | ||
212 | },{ | 214 | },{ |
213 | .id = V4L2_CID_CONTRAST, | 215 | .id = V4L2_CID_CONTRAST, |
214 | .name = "Contrast", | 216 | .name = "Contrast", |
@@ -217,6 +219,7 @@ static struct v4l2_queryctrl controls[] = { | |||
217 | .step = 1, | 219 | .step = 1, |
218 | .default_value = 64, | 220 | .default_value = 64, |
219 | .type = V4L2_CTRL_TYPE_INTEGER, | 221 | .type = V4L2_CTRL_TYPE_INTEGER, |
222 | .flags = V4L2_CTRL_FLAG_SLIDER, | ||
220 | },{ | 223 | },{ |
221 | .id = V4L2_CID_SATURATION, | 224 | .id = V4L2_CID_SATURATION, |
222 | .name = "Saturation", | 225 | .name = "Saturation", |
@@ -225,15 +228,16 @@ static struct v4l2_queryctrl controls[] = { | |||
225 | .step = 1, | 228 | .step = 1, |
226 | .default_value = 64, | 229 | .default_value = 64, |
227 | .type = V4L2_CTRL_TYPE_INTEGER, | 230 | .type = V4L2_CTRL_TYPE_INTEGER, |
231 | .flags = V4L2_CTRL_FLAG_SLIDER, | ||
228 | },{ | 232 | },{ |
229 | .id = V4L2_CID_VFLIP, | 233 | .id = V4L2_CID_VFLIP, |
230 | .name = "Vertical flip", | 234 | .name = "Vertical Flip", |
231 | .minimum = 0, | 235 | .minimum = 0, |
232 | .maximum = 1, | 236 | .maximum = 1, |
233 | .type = V4L2_CTRL_TYPE_BOOLEAN, | 237 | .type = V4L2_CTRL_TYPE_BOOLEAN, |
234 | },{ | 238 | },{ |
235 | .id = V4L2_CID_HFLIP, | 239 | .id = V4L2_CID_HFLIP, |
236 | .name = "Horizontal flip", | 240 | .name = "Horizontal Flip", |
237 | .minimum = 0, | 241 | .minimum = 0, |
238 | .maximum = 1, | 242 | .maximum = 1, |
239 | .type = V4L2_CTRL_TYPE_BOOLEAN, | 243 | .type = V4L2_CTRL_TYPE_BOOLEAN, |
@@ -1112,6 +1116,22 @@ static int vidioc_streamoff(struct file *file, void *__fh, enum v4l2_buf_type ty | |||
1112 | return err; | 1116 | return err; |
1113 | } | 1117 | } |
1114 | 1118 | ||
1119 | static int vidioc_g_chip_ident(struct file *file, void *__fh, | ||
1120 | struct v4l2_dbg_chip_ident *chip) | ||
1121 | { | ||
1122 | struct saa7146_fh *fh = __fh; | ||
1123 | struct saa7146_dev *dev = fh->dev; | ||
1124 | |||
1125 | chip->ident = V4L2_IDENT_NONE; | ||
1126 | chip->revision = 0; | ||
1127 | if (v4l2_chip_match_host(&chip->match)) { | ||
1128 | chip->ident = V4L2_IDENT_SAA7146; | ||
1129 | return 0; | ||
1130 | } | ||
1131 | return v4l2_device_call_until_err(&dev->v4l2_dev, 0, | ||
1132 | core, g_chip_ident, chip); | ||
1133 | } | ||
1134 | |||
1115 | #ifdef CONFIG_VIDEO_V4L1_COMPAT | 1135 | #ifdef CONFIG_VIDEO_V4L1_COMPAT |
1116 | static int vidiocgmbuf(struct file *file, void *__fh, struct video_mbuf *mbuf) | 1136 | static int vidiocgmbuf(struct file *file, void *__fh, struct video_mbuf *mbuf) |
1117 | { | 1137 | { |
@@ -1152,6 +1172,7 @@ const struct v4l2_ioctl_ops saa7146_video_ioctl_ops = { | |||
1152 | .vidioc_try_fmt_vid_overlay = vidioc_try_fmt_vid_overlay, | 1172 | .vidioc_try_fmt_vid_overlay = vidioc_try_fmt_vid_overlay, |
1153 | .vidioc_s_fmt_vid_overlay = vidioc_s_fmt_vid_overlay, | 1173 | .vidioc_s_fmt_vid_overlay = vidioc_s_fmt_vid_overlay, |
1154 | .vidioc_g_fmt_vbi_cap = vidioc_g_fmt_vbi_cap, | 1174 | .vidioc_g_fmt_vbi_cap = vidioc_g_fmt_vbi_cap, |
1175 | .vidioc_g_chip_ident = vidioc_g_chip_ident, | ||
1155 | 1176 | ||
1156 | .vidioc_overlay = vidioc_overlay, | 1177 | .vidioc_overlay = vidioc_overlay, |
1157 | .vidioc_g_fbuf = vidioc_g_fbuf, | 1178 | .vidioc_g_fbuf = vidioc_g_fbuf, |