aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/usbvideo/usbvideo.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/usbvideo/usbvideo.c')
-rw-r--r--drivers/media/video/usbvideo/usbvideo.c170
1 files changed, 111 insertions, 59 deletions
diff --git a/drivers/media/video/usbvideo/usbvideo.c b/drivers/media/video/usbvideo/usbvideo.c
index 4128ee20b64e..7c575bb8184f 100644
--- a/drivers/media/video/usbvideo/usbvideo.c
+++ b/drivers/media/video/usbvideo/usbvideo.c
@@ -468,8 +468,9 @@ static void usbvideo_ReportStatistics(const struct uvd *uvd)
468 percent = (100 * goodPackets) / allPackets; 468 percent = (100 * goodPackets) / allPackets;
469 else 469 else
470 percent = goodPackets / (allPackets / 100); 470 percent = goodPackets / (allPackets / 100);
471 info("Packet Statistics: Total=%lu. Empty=%lu. Usage=%lu%%", 471 dev_info(&uvd->dev->dev,
472 allPackets, badPackets, percent); 472 "Packet Statistics: Total=%lu. Empty=%lu. Usage=%lu%%\n",
473 allPackets, badPackets, percent);
473 if (uvd->iso_packet_len > 0) { 474 if (uvd->iso_packet_len > 0) {
474 unsigned long allBytes, xferBytes; 475 unsigned long allBytes, xferBytes;
475 char multiplier = ' '; 476 char multiplier = ' ';
@@ -497,8 +498,9 @@ static void usbvideo_ReportStatistics(const struct uvd *uvd)
497 } 498 }
498 } 499 }
499 } 500 }
500 info("Transfer Statistics: Transferred=%lu%cB Usage=%lu%%", 501 dev_info(&uvd->dev->dev,
501 xferBytes, multiplier, percent); 502 "Transfer Statistics: Transferred=%lu%cB Usage=%lu%%\n",
503 xferBytes, multiplier, percent);
502 } 504 }
503 } 505 }
504} 506}
@@ -545,7 +547,7 @@ void usbvideo_TestPattern(struct uvd *uvd, int fullframe, int pmode)
545 { /* For debugging purposes only */ 547 { /* For debugging purposes only */
546 char tmp[20]; 548 char tmp[20];
547 usbvideo_VideosizeToString(tmp, sizeof(tmp), frame->request); 549 usbvideo_VideosizeToString(tmp, sizeof(tmp), frame->request);
548 info("testpattern: frame=%s", tmp); 550 dev_info(&uvd->dev->dev, "testpattern: frame=%s\n", tmp);
549 } 551 }
550#endif 552#endif
551 /* Form every scan line */ 553 /* Form every scan line */
@@ -854,7 +856,7 @@ static void usbvideo_Disconnect(struct usb_interface *intf)
854 856
855 usbvideo_ClientIncModCount(uvd); 857 usbvideo_ClientIncModCount(uvd);
856 if (uvd->debug > 0) 858 if (uvd->debug > 0)
857 info("%s(%p.)", __func__, intf); 859 dev_info(&intf->dev, "%s(%p.)\n", __func__, intf);
858 860
859 mutex_lock(&uvd->lock); 861 mutex_lock(&uvd->lock);
860 uvd->remove_pending = 1; /* Now all ISO data will be ignored */ 862 uvd->remove_pending = 1; /* Now all ISO data will be ignored */
@@ -870,14 +872,15 @@ static void usbvideo_Disconnect(struct usb_interface *intf)
870 872
871 video_unregister_device(&uvd->vdev); 873 video_unregister_device(&uvd->vdev);
872 if (uvd->debug > 0) 874 if (uvd->debug > 0)
873 info("%s: Video unregistered.", __func__); 875 dev_info(&intf->dev, "%s: Video unregistered.\n", __func__);
874 876
875 if (uvd->user) 877 if (uvd->user)
876 info("%s: In use, disconnect pending.", __func__); 878 dev_info(&intf->dev, "%s: In use, disconnect pending.\n",
879 __func__);
877 else 880 else
878 usbvideo_CameraRelease(uvd); 881 usbvideo_CameraRelease(uvd);
879 mutex_unlock(&uvd->lock); 882 mutex_unlock(&uvd->lock);
880 info("USB camera disconnected."); 883 dev_info(&intf->dev, "USB camera disconnected.\n");
881 884
882 usbvideo_ClientDecModCount(uvd); 885 usbvideo_ClientDecModCount(uvd);
883} 886}
@@ -952,8 +955,6 @@ static const struct file_operations usbvideo_fops = {
952 .llseek = no_llseek, 955 .llseek = no_llseek,
953}; 956};
954static const struct video_device usbvideo_template = { 957static const struct video_device usbvideo_template = {
955 .owner = THIS_MODULE,
956 .type = VID_TYPE_CAPTURE,
957 .fops = &usbvideo_fops, 958 .fops = &usbvideo_fops,
958}; 959};
959 960
@@ -1017,14 +1018,17 @@ int usbvideo_RegisterVideoDevice(struct uvd *uvd)
1017 return -EINVAL; 1018 return -EINVAL;
1018 } 1019 }
1019 if (uvd->video_endp == 0) { 1020 if (uvd->video_endp == 0) {
1020 info("%s: No video endpoint specified; data pump disabled.", __func__); 1021 dev_info(&uvd->dev->dev,
1022 "%s: No video endpoint specified; data pump disabled.\n",
1023 __func__);
1021 } 1024 }
1022 if (uvd->paletteBits == 0) { 1025 if (uvd->paletteBits == 0) {
1023 err("%s: No palettes specified!", __func__); 1026 err("%s: No palettes specified!", __func__);
1024 return -EINVAL; 1027 return -EINVAL;
1025 } 1028 }
1026 if (uvd->defaultPalette == 0) { 1029 if (uvd->defaultPalette == 0) {
1027 info("%s: No default palette!", __func__); 1030 dev_info(&uvd->dev->dev, "%s: No default palette!\n",
1031 __func__);
1028 } 1032 }
1029 1033
1030 uvd->max_frame_size = VIDEOSIZE_X(uvd->canvas) * 1034 uvd->max_frame_size = VIDEOSIZE_X(uvd->canvas) *
@@ -1033,25 +1037,29 @@ int usbvideo_RegisterVideoDevice(struct uvd *uvd)
1033 usbvideo_VideosizeToString(tmp2, sizeof(tmp2), uvd->canvas); 1037 usbvideo_VideosizeToString(tmp2, sizeof(tmp2), uvd->canvas);
1034 1038
1035 if (uvd->debug > 0) { 1039 if (uvd->debug > 0) {
1036 info("%s: iface=%d. endpoint=$%02x paletteBits=$%08lx", 1040 dev_info(&uvd->dev->dev,
1037 __func__, uvd->iface, uvd->video_endp, uvd->paletteBits); 1041 "%s: iface=%d. endpoint=$%02x paletteBits=$%08lx\n",
1042 __func__, uvd->iface, uvd->video_endp,
1043 uvd->paletteBits);
1038 } 1044 }
1039 if (uvd->dev == NULL) { 1045 if (uvd->dev == NULL) {
1040 err("%s: uvd->dev == NULL", __func__); 1046 err("%s: uvd->dev == NULL", __func__);
1041 return -EINVAL; 1047 return -EINVAL;
1042 } 1048 }
1043 uvd->vdev.dev = &uvd->dev->dev; 1049 uvd->vdev.parent = &uvd->dev->dev;
1044 if (video_register_device(&uvd->vdev, VFL_TYPE_GRABBER, video_nr) == -1) { 1050 uvd->vdev.release = video_device_release_empty;
1051 if (video_register_device(&uvd->vdev, VFL_TYPE_GRABBER, video_nr) < 0) {
1045 err("%s: video_register_device failed", __func__); 1052 err("%s: video_register_device failed", __func__);
1046 return -EPIPE; 1053 return -EPIPE;
1047 } 1054 }
1048 if (uvd->debug > 1) { 1055 if (uvd->debug > 1) {
1049 info("%s: video_register_device() successful", __func__); 1056 dev_info(&uvd->dev->dev,
1057 "%s: video_register_device() successful\n", __func__);
1050 } 1058 }
1051 1059
1052 info("%s on /dev/video%d: canvas=%s videosize=%s", 1060 dev_info(&uvd->dev->dev, "%s on /dev/video%d: canvas=%s videosize=%s\n",
1053 (uvd->handle != NULL) ? uvd->handle->drvName : "???", 1061 (uvd->handle != NULL) ? uvd->handle->drvName : "???",
1054 uvd->vdev.minor, tmp2, tmp1); 1062 uvd->vdev.num, tmp2, tmp1);
1055 1063
1056 usb_get_dev(uvd->dev); 1064 usb_get_dev(uvd->dev);
1057 return 0; 1065 return 0;
@@ -1113,7 +1121,7 @@ static int usbvideo_v4l_open(struct inode *inode, struct file *file)
1113 int i, errCode = 0; 1121 int i, errCode = 0;
1114 1122
1115 if (uvd->debug > 1) 1123 if (uvd->debug > 1)
1116 info("%s($%p)", __func__, dev); 1124 dev_info(&uvd->dev->dev, "%s($%p)\n", __func__, dev);
1117 1125
1118 if (0 < usbvideo_ClientIncModCount(uvd)) 1126 if (0 < usbvideo_ClientIncModCount(uvd))
1119 return -ENODEV; 1127 return -ENODEV;
@@ -1180,19 +1188,25 @@ static int usbvideo_v4l_open(struct inode *inode, struct file *file)
1180 if (errCode == 0) { 1188 if (errCode == 0) {
1181 if (VALID_CALLBACK(uvd, setupOnOpen)) { 1189 if (VALID_CALLBACK(uvd, setupOnOpen)) {
1182 if (uvd->debug > 1) 1190 if (uvd->debug > 1)
1183 info("%s: setupOnOpen callback", __func__); 1191 dev_info(&uvd->dev->dev,
1192 "%s: setupOnOpen callback\n",
1193 __func__);
1184 errCode = GET_CALLBACK(uvd, setupOnOpen)(uvd); 1194 errCode = GET_CALLBACK(uvd, setupOnOpen)(uvd);
1185 if (errCode < 0) { 1195 if (errCode < 0) {
1186 err("%s: setupOnOpen callback failed (%d.).", 1196 err("%s: setupOnOpen callback failed (%d.).",
1187 __func__, errCode); 1197 __func__, errCode);
1188 } else if (uvd->debug > 1) { 1198 } else if (uvd->debug > 1) {
1189 info("%s: setupOnOpen callback successful", __func__); 1199 dev_info(&uvd->dev->dev,
1200 "%s: setupOnOpen callback successful\n",
1201 __func__);
1190 } 1202 }
1191 } 1203 }
1192 if (errCode == 0) { 1204 if (errCode == 0) {
1193 uvd->settingsAdjusted = 0; 1205 uvd->settingsAdjusted = 0;
1194 if (uvd->debug > 1) 1206 if (uvd->debug > 1)
1195 info("%s: Open succeeded.", __func__); 1207 dev_info(&uvd->dev->dev,
1208 "%s: Open succeeded.\n",
1209 __func__);
1196 uvd->user++; 1210 uvd->user++;
1197 file->private_data = uvd; 1211 file->private_data = uvd;
1198 } 1212 }
@@ -1202,7 +1216,8 @@ static int usbvideo_v4l_open(struct inode *inode, struct file *file)
1202 if (errCode != 0) 1216 if (errCode != 0)
1203 usbvideo_ClientDecModCount(uvd); 1217 usbvideo_ClientDecModCount(uvd);
1204 if (uvd->debug > 0) 1218 if (uvd->debug > 0)
1205 info("%s: Returning %d.", __func__, errCode); 1219 dev_info(&uvd->dev->dev, "%s: Returning %d.\n", __func__,
1220 errCode);
1206 return errCode; 1221 return errCode;
1207} 1222}
1208 1223
@@ -1225,7 +1240,7 @@ static int usbvideo_v4l_close(struct inode *inode, struct file *file)
1225 int i; 1240 int i;
1226 1241
1227 if (uvd->debug > 1) 1242 if (uvd->debug > 1)
1228 info("%s($%p)", __func__, dev); 1243 dev_info(&uvd->dev->dev, "%s($%p)\n", __func__, dev);
1229 1244
1230 mutex_lock(&uvd->lock); 1245 mutex_lock(&uvd->lock);
1231 GET_CALLBACK(uvd, stopDataPump)(uvd); 1246 GET_CALLBACK(uvd, stopDataPump)(uvd);
@@ -1245,14 +1260,15 @@ static int usbvideo_v4l_close(struct inode *inode, struct file *file)
1245 uvd->user--; 1260 uvd->user--;
1246 if (uvd->remove_pending) { 1261 if (uvd->remove_pending) {
1247 if (uvd->debug > 0) 1262 if (uvd->debug > 0)
1248 info("usbvideo_v4l_close: Final disconnect."); 1263 dev_info(&uvd->dev->dev, "%s: Final disconnect.\n",
1264 __func__);
1249 usbvideo_CameraRelease(uvd); 1265 usbvideo_CameraRelease(uvd);
1250 } 1266 }
1251 mutex_unlock(&uvd->lock); 1267 mutex_unlock(&uvd->lock);
1252 usbvideo_ClientDecModCount(uvd); 1268 usbvideo_ClientDecModCount(uvd);
1253 1269
1254 if (uvd->debug > 1) 1270 if (uvd->debug > 1)
1255 info("%s: Completed.", __func__); 1271 dev_info(&uvd->dev->dev, "%s: Completed.\n", __func__);
1256 file->private_data = NULL; 1272 file->private_data = NULL;
1257 return 0; 1273 return 0;
1258} 1274}
@@ -1366,8 +1382,9 @@ static int usbvideo_v4l_do_ioctl(struct inode *inode, struct file *file,
1366 struct video_mmap *vm = arg; 1382 struct video_mmap *vm = arg;
1367 1383
1368 if (uvd->debug >= 1) { 1384 if (uvd->debug >= 1) {
1369 info("VIDIOCMCAPTURE: frame=%d. size=%dx%d, format=%d.", 1385 dev_info(&uvd->dev->dev,
1370 vm->frame, vm->width, vm->height, vm->format); 1386 "VIDIOCMCAPTURE: frame=%d. size=%dx%d, format=%d.\n",
1387 vm->frame, vm->width, vm->height, vm->format);
1371 } 1388 }
1372 /* 1389 /*
1373 * Check if the requested size is supported. If the requestor 1390 * Check if the requested size is supported. If the requestor
@@ -1385,18 +1402,24 @@ static int usbvideo_v4l_do_ioctl(struct inode *inode, struct file *file,
1385 if ((vm->width > VIDEOSIZE_X(uvd->canvas)) || 1402 if ((vm->width > VIDEOSIZE_X(uvd->canvas)) ||
1386 (vm->height > VIDEOSIZE_Y(uvd->canvas))) { 1403 (vm->height > VIDEOSIZE_Y(uvd->canvas))) {
1387 if (uvd->debug > 0) { 1404 if (uvd->debug > 0) {
1388 info("VIDIOCMCAPTURE: Size=%dx%d too large; " 1405 dev_info(&uvd->dev->dev,
1389 "allowed only up to %ldx%ld", vm->width, vm->height, 1406 "VIDIOCMCAPTURE: Size=%dx%d "
1390 VIDEOSIZE_X(uvd->canvas), VIDEOSIZE_Y(uvd->canvas)); 1407 "too large; allowed only up "
1408 "to %ldx%ld\n", vm->width,
1409 vm->height,
1410 VIDEOSIZE_X(uvd->canvas),
1411 VIDEOSIZE_Y(uvd->canvas));
1391 } 1412 }
1392 return -EINVAL; 1413 return -EINVAL;
1393 } 1414 }
1394 /* Check if the palette is supported */ 1415 /* Check if the palette is supported */
1395 if (((1L << vm->format) & uvd->paletteBits) == 0) { 1416 if (((1L << vm->format) & uvd->paletteBits) == 0) {
1396 if (uvd->debug > 0) { 1417 if (uvd->debug > 0) {
1397 info("VIDIOCMCAPTURE: format=%d. not supported" 1418 dev_info(&uvd->dev->dev,
1398 " (paletteBits=$%08lx)", 1419 "VIDIOCMCAPTURE: format=%d. "
1399 vm->format, uvd->paletteBits); 1420 "not supported "
1421 "(paletteBits=$%08lx)\n",
1422 vm->format, uvd->paletteBits);
1400 } 1423 }
1401 return -EINVAL; 1424 return -EINVAL;
1402 } 1425 }
@@ -1424,7 +1447,9 @@ static int usbvideo_v4l_do_ioctl(struct inode *inode, struct file *file,
1424 return -EINVAL; 1447 return -EINVAL;
1425 1448
1426 if (uvd->debug >= 1) 1449 if (uvd->debug >= 1)
1427 info("VIDIOCSYNC: syncing to frame %d.", *frameNum); 1450 dev_info(&uvd->dev->dev,
1451 "VIDIOCSYNC: syncing to frame %d.\n",
1452 *frameNum);
1428 if (uvd->flags & FLAGS_NO_DECODING) 1453 if (uvd->flags & FLAGS_NO_DECODING)
1429 ret = usbvideo_GetFrame(uvd, *frameNum); 1454 ret = usbvideo_GetFrame(uvd, *frameNum);
1430 else if (VALID_CALLBACK(uvd, getFrame)) { 1455 else if (VALID_CALLBACK(uvd, getFrame)) {
@@ -1506,7 +1531,9 @@ static ssize_t usbvideo_v4l_read(struct file *file, char __user *buf,
1506 return -EFAULT; 1531 return -EFAULT;
1507 1532
1508 if (uvd->debug >= 1) 1533 if (uvd->debug >= 1)
1509 info("%s: %Zd. bytes, noblock=%d.", __func__, count, noblock); 1534 dev_info(&uvd->dev->dev,
1535 "%s: %Zd. bytes, noblock=%d.\n",
1536 __func__, count, noblock);
1510 1537
1511 mutex_lock(&uvd->lock); 1538 mutex_lock(&uvd->lock);
1512 1539
@@ -1687,18 +1714,21 @@ static void usbvideo_IsocIrq(struct urb *urb)
1687 return; 1714 return;
1688#if 0 1715#if 0
1689 if (urb->actual_length > 0) { 1716 if (urb->actual_length > 0) {
1690 info("urb=$%p status=%d. errcount=%d. length=%d.", 1717 dev_info(&uvd->dev->dev,
1691 urb, urb->status, urb->error_count, urb->actual_length); 1718 "urb=$%p status=%d. errcount=%d. length=%d.\n",
1719 urb, urb->status, urb->error_count,
1720 urb->actual_length);
1692 } else { 1721 } else {
1693 static int c = 0; 1722 static int c = 0;
1694 if (c++ % 100 == 0) 1723 if (c++ % 100 == 0)
1695 info("No Isoc data"); 1724 dev_info(&uvd->dev->dev, "No Isoc data\n");
1696 } 1725 }
1697#endif 1726#endif
1698 1727
1699 if (!uvd->streaming) { 1728 if (!uvd->streaming) {
1700 if (uvd->debug >= 1) 1729 if (uvd->debug >= 1)
1701 info("Not streaming, but interrupt!"); 1730 dev_info(&uvd->dev->dev,
1731 "Not streaming, but interrupt!\n");
1702 return; 1732 return;
1703 } 1733 }
1704 1734
@@ -1743,7 +1773,7 @@ static int usbvideo_StartDataPump(struct uvd *uvd)
1743 int i, errFlag; 1773 int i, errFlag;
1744 1774
1745 if (uvd->debug > 1) 1775 if (uvd->debug > 1)
1746 info("%s($%p)", __func__, uvd); 1776 dev_info(&uvd->dev->dev, "%s($%p)\n", __func__, uvd);
1747 1777
1748 if (!CAMERA_IS_OPERATIONAL(uvd)) { 1778 if (!CAMERA_IS_OPERATIONAL(uvd)) {
1749 err("%s: Camera is not operational", __func__); 1779 err("%s: Camera is not operational", __func__);
@@ -1791,7 +1821,9 @@ static int usbvideo_StartDataPump(struct uvd *uvd)
1791 1821
1792 uvd->streaming = 1; 1822 uvd->streaming = 1;
1793 if (uvd->debug > 1) 1823 if (uvd->debug > 1)
1794 info("%s: streaming=1 video_endp=$%02x", __func__, uvd->video_endp); 1824 dev_info(&uvd->dev->dev,
1825 "%s: streaming=1 video_endp=$%02x\n", __func__,
1826 uvd->video_endp);
1795 return 0; 1827 return 0;
1796} 1828}
1797 1829
@@ -1813,14 +1845,14 @@ static void usbvideo_StopDataPump(struct uvd *uvd)
1813 return; 1845 return;
1814 1846
1815 if (uvd->debug > 1) 1847 if (uvd->debug > 1)
1816 info("%s($%p)", __func__, uvd); 1848 dev_info(&uvd->dev->dev, "%s($%p)\n", __func__, uvd);
1817 1849
1818 /* Unschedule all of the iso td's */ 1850 /* Unschedule all of the iso td's */
1819 for (i=0; i < USBVIDEO_NUMSBUF; i++) { 1851 for (i=0; i < USBVIDEO_NUMSBUF; i++) {
1820 usb_kill_urb(uvd->sbuf[i].urb); 1852 usb_kill_urb(uvd->sbuf[i].urb);
1821 } 1853 }
1822 if (uvd->debug > 1) 1854 if (uvd->debug > 1)
1823 info("%s: streaming=0", __func__); 1855 dev_info(&uvd->dev->dev, "%s: streaming=0\n", __func__);
1824 uvd->streaming = 0; 1856 uvd->streaming = 0;
1825 1857
1826 if (!uvd->remove_pending) { 1858 if (!uvd->remove_pending) {
@@ -1852,7 +1884,8 @@ static int usbvideo_NewFrame(struct uvd *uvd, int framenum)
1852 int n; 1884 int n;
1853 1885
1854 if (uvd->debug > 1) 1886 if (uvd->debug > 1)
1855 info("usbvideo_NewFrame($%p,%d.)", uvd, framenum); 1887 dev_info(&uvd->dev->dev, "usbvideo_NewFrame($%p,%d.)\n", uvd,
1888 framenum);
1856 1889
1857 /* If we're not grabbing a frame right now and the other frame is */ 1890 /* If we're not grabbing a frame right now and the other frame is */
1858 /* ready to be grabbed into, then use it instead */ 1891 /* ready to be grabbed into, then use it instead */
@@ -1957,12 +1990,14 @@ static int usbvideo_GetFrame(struct uvd *uvd, int frameNum)
1957 struct usbvideo_frame *frame = &uvd->frame[frameNum]; 1990 struct usbvideo_frame *frame = &uvd->frame[frameNum];
1958 1991
1959 if (uvd->debug >= 2) 1992 if (uvd->debug >= 2)
1960 info("%s($%p,%d.)", __func__, uvd, frameNum); 1993 dev_info(&uvd->dev->dev, "%s($%p,%d.)\n", __func__, uvd,
1994 frameNum);
1961 1995
1962 switch (frame->frameState) { 1996 switch (frame->frameState) {
1963 case FrameState_Unused: 1997 case FrameState_Unused:
1964 if (uvd->debug >= 2) 1998 if (uvd->debug >= 2)
1965 info("%s: FrameState_Unused", __func__); 1999 dev_info(&uvd->dev->dev, "%s: FrameState_Unused\n",
2000 __func__);
1966 return -EINVAL; 2001 return -EINVAL;
1967 case FrameState_Ready: 2002 case FrameState_Ready:
1968 case FrameState_Grabbing: 2003 case FrameState_Grabbing:
@@ -1972,7 +2007,9 @@ static int usbvideo_GetFrame(struct uvd *uvd, int frameNum)
1972 redo: 2007 redo:
1973 if (!CAMERA_IS_OPERATIONAL(uvd)) { 2008 if (!CAMERA_IS_OPERATIONAL(uvd)) {
1974 if (uvd->debug >= 2) 2009 if (uvd->debug >= 2)
1975 info("%s: Camera is not operational (1)", __func__); 2010 dev_info(&uvd->dev->dev,
2011 "%s: Camera is not operational (1)\n",
2012 __func__);
1976 return -EIO; 2013 return -EIO;
1977 } 2014 }
1978 ntries = 0; 2015 ntries = 0;
@@ -1981,24 +2018,33 @@ static int usbvideo_GetFrame(struct uvd *uvd, int frameNum)
1981 signalPending = signal_pending(current); 2018 signalPending = signal_pending(current);
1982 if (!CAMERA_IS_OPERATIONAL(uvd)) { 2019 if (!CAMERA_IS_OPERATIONAL(uvd)) {
1983 if (uvd->debug >= 2) 2020 if (uvd->debug >= 2)
1984 info("%s: Camera is not operational (2)", __func__); 2021 dev_info(&uvd->dev->dev,
2022 "%s: Camera is not "
2023 "operational (2)\n", __func__);
1985 return -EIO; 2024 return -EIO;
1986 } 2025 }
1987 assert(uvd->fbuf != NULL); 2026 assert(uvd->fbuf != NULL);
1988 if (signalPending) { 2027 if (signalPending) {
1989 if (uvd->debug >= 2) 2028 if (uvd->debug >= 2)
1990 info("%s: Signal=$%08x", __func__, signalPending); 2029 dev_info(&uvd->dev->dev,
2030 "%s: Signal=$%08x\n", __func__,
2031 signalPending);
1991 if (uvd->flags & FLAGS_RETRY_VIDIOCSYNC) { 2032 if (uvd->flags & FLAGS_RETRY_VIDIOCSYNC) {
1992 usbvideo_TestPattern(uvd, 1, 0); 2033 usbvideo_TestPattern(uvd, 1, 0);
1993 uvd->curframe = -1; 2034 uvd->curframe = -1;
1994 uvd->stats.frame_num++; 2035 uvd->stats.frame_num++;
1995 if (uvd->debug >= 2) 2036 if (uvd->debug >= 2)
1996 info("%s: Forced test pattern screen", __func__); 2037 dev_info(&uvd->dev->dev,
2038 "%s: Forced test "
2039 "pattern screen\n",
2040 __func__);
1997 return 0; 2041 return 0;
1998 } else { 2042 } else {
1999 /* Standard answer: Interrupted! */ 2043 /* Standard answer: Interrupted! */
2000 if (uvd->debug >= 2) 2044 if (uvd->debug >= 2)
2001 info("%s: Interrupted!", __func__); 2045 dev_info(&uvd->dev->dev,
2046 "%s: Interrupted!\n",
2047 __func__);
2002 return -EINTR; 2048 return -EINTR;
2003 } 2049 }
2004 } else { 2050 } else {
@@ -2012,8 +2058,10 @@ static int usbvideo_GetFrame(struct uvd *uvd, int frameNum)
2012 } 2058 }
2013 } while (frame->frameState == FrameState_Grabbing); 2059 } while (frame->frameState == FrameState_Grabbing);
2014 if (uvd->debug >= 2) { 2060 if (uvd->debug >= 2) {
2015 info("%s: Grabbing done; state=%d. (%lu. bytes)", 2061 dev_info(&uvd->dev->dev,
2016 __func__, frame->frameState, frame->seqRead_Length); 2062 "%s: Grabbing done; state=%d. (%lu. bytes)\n",
2063 __func__, frame->frameState,
2064 frame->seqRead_Length);
2017 } 2065 }
2018 if (frame->frameState == FrameState_Error) { 2066 if (frame->frameState == FrameState_Error) {
2019 int ret = usbvideo_NewFrame(uvd, frameNum); 2067 int ret = usbvideo_NewFrame(uvd, frameNum);
@@ -2050,7 +2098,9 @@ static int usbvideo_GetFrame(struct uvd *uvd, int frameNum)
2050 } 2098 }
2051 frame->frameState = FrameState_Done_Hold; 2099 frame->frameState = FrameState_Done_Hold;
2052 if (uvd->debug >= 2) 2100 if (uvd->debug >= 2)
2053 info("%s: Entered FrameState_Done_Hold state.", __func__); 2101 dev_info(&uvd->dev->dev,
2102 "%s: Entered FrameState_Done_Hold state.\n",
2103 __func__);
2054 return 0; 2104 return 0;
2055 2105
2056 case FrameState_Done_Hold: 2106 case FrameState_Done_Hold:
@@ -2061,7 +2111,9 @@ static int usbvideo_GetFrame(struct uvd *uvd, int frameNum)
2061 * it will be released back into the wild to roam freely. 2111 * it will be released back into the wild to roam freely.
2062 */ 2112 */
2063 if (uvd->debug >= 2) 2113 if (uvd->debug >= 2)
2064 info("%s: FrameState_Done_Hold state.", __func__); 2114 dev_info(&uvd->dev->dev,
2115 "%s: FrameState_Done_Hold state.\n",
2116 __func__);
2065 return 0; 2117 return 0;
2066 } 2118 }
2067 2119