aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/stk-webcam.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/stk-webcam.c')
-rw-r--r--drivers/media/video/stk-webcam.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/drivers/media/video/stk-webcam.c b/drivers/media/video/stk-webcam.c
index e9eb6d754d5c..f9516d0f3c11 100644
--- a/drivers/media/video/stk-webcam.c
+++ b/drivers/media/video/stk-webcam.c
@@ -1262,6 +1262,25 @@ static int stk_vidioc_g_parm(struct file *filp,
1262 return 0; 1262 return 0;
1263} 1263}
1264 1264
1265static int stk_vidioc_enum_framesizes(struct file *filp,
1266 void *priv, struct v4l2_frmsizeenum *frms)
1267{
1268 if (frms->index >= ARRAY_SIZE(stk_sizes))
1269 return -EINVAL;
1270 switch (frms->pixel_format) {
1271 case V4L2_PIX_FMT_RGB565:
1272 case V4L2_PIX_FMT_RGB565X:
1273 case V4L2_PIX_FMT_UYVY:
1274 case V4L2_PIX_FMT_YUYV:
1275 case V4L2_PIX_FMT_SBGGR8:
1276 frms->type = V4L2_FRMSIZE_TYPE_DISCRETE;
1277 frms->discrete.width = stk_sizes[frms->index].w;
1278 frms->discrete.height = stk_sizes[frms->index].h;
1279 return 0;
1280 default: return -EINVAL;
1281 }
1282}
1283
1265static struct file_operations v4l_stk_fops = { 1284static struct file_operations v4l_stk_fops = {
1266 .owner = THIS_MODULE, 1285 .owner = THIS_MODULE,
1267 .open = v4l_stk_open, 1286 .open = v4l_stk_open,
@@ -1296,6 +1315,7 @@ static const struct v4l2_ioctl_ops v4l_stk_ioctl_ops = {
1296 .vidioc_g_ctrl = stk_vidioc_g_ctrl, 1315 .vidioc_g_ctrl = stk_vidioc_g_ctrl,
1297 .vidioc_s_ctrl = stk_vidioc_s_ctrl, 1316 .vidioc_s_ctrl = stk_vidioc_s_ctrl,
1298 .vidioc_g_parm = stk_vidioc_g_parm, 1317 .vidioc_g_parm = stk_vidioc_g_parm,
1318 .vidioc_enum_framesizes = stk_vidioc_enum_framesizes,
1299}; 1319};
1300 1320
1301static void stk_v4l_dev_release(struct video_device *vd) 1321static void stk_v4l_dev_release(struct video_device *vd)
@@ -1376,12 +1396,9 @@ static int stk_camera_probe(struct usb_interface *interface,
1376 endpoint = &iface_desc->endpoint[i].desc; 1396 endpoint = &iface_desc->endpoint[i].desc;
1377 1397
1378 if (!dev->isoc_ep 1398 if (!dev->isoc_ep
1379 && ((endpoint->bEndpointAddress 1399 && usb_endpoint_is_isoc_in(endpoint)) {
1380 & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN)
1381 && ((endpoint->bmAttributes
1382 & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_ISOC)) {
1383 /* we found an isoc in endpoint */ 1400 /* we found an isoc in endpoint */
1384 dev->isoc_ep = (endpoint->bEndpointAddress & 0xF); 1401 dev->isoc_ep = usb_endpoint_num(endpoint);
1385 break; 1402 break;
1386 } 1403 }
1387 } 1404 }