Lines Matching full:if
20 * along with this program; if not, write to the Free Software Foundation,
44 #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE)
51 #if DEF_NURBS > MAX_NURBS
66 if ((pixfmt >> 24) >= '0' && (pixfmt >> 24) <= 'z') { in PDEBUG_MODE()
106 if (--frame->vma_use_count <= 0) in gspca_vm_close()
118 #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE)
127 if (gspca_dev->sd_desc->int_pkt_scan(gspca_dev, in int_irq()
148 if (ret == 0) { in int_irq()
150 if (ret < 0) in int_irq()
161 if (dev->sd_desc->int_pkt_scan || dev->sd_desc->other_input) { in gspca_input_connect()
163 if (!input_dev) in gspca_input_connect()
179 if (err) { in gspca_input_connect()
211 if (!urb) { in alloc_and_submit_int_urb()
218 if (!buffer) { in alloc_and_submit_int_urb()
228 if (ret < 0) { in alloc_and_submit_int_urb()
253 if (gspca_dev->sd_desc->int_pkt_scan) { in gspca_input_create_urb()
258 if (usb_endpoint_dir_in(ep) && in gspca_input_create_urb()
273 if (urb) { in gspca_input_destroy_urb()
308 if (urb->status != 0) { in fill_frame()
309 if (urb->status == -ESHUTDOWN) in fill_frame()
312 if (gspca_dev->frozen) in fill_frame()
325 if (st) { in fill_frame()
331 if (len == 0) { in fill_frame()
332 if (gspca_dev->empty_packet == 0) in fill_frame()
348 if (st < 0) in fill_frame()
362 if (!gspca_dev->streaming) in isoc_irq()
376 if (!gspca_dev->streaming) in bulk_irq()
385 if (gspca_dev->frozen) in bulk_irq()
400 if (gspca_dev->cam.bulk_nurbs != 0) { in bulk_irq()
402 if (st < 0) in bulk_irq()
428 if (packet_type == FIRST_PACKET) { in gspca_frame_add()
431 /* if there are no queued buffer, discard the whole frame */ in gspca_frame_add()
432 if (i == atomic_read(&gspca_dev->fr_q)) { in gspca_frame_add()
446 if (packet_type == LAST_PACKET) { in gspca_frame_add()
458 if (len > 0) { in gspca_frame_add()
459 if (gspca_dev->image_len + len > gspca_dev->frsz) { in gspca_frame_add()
466 if (gspca_dev->image == NULL) { in gspca_frame_add()
478 /* if last packet, invalidate packet concatenation until in gspca_frame_add()
481 if (packet_type == LAST_PACKET) { in gspca_frame_add()
511 if (count >= GSPCA_MAX_FRAMES) in frame_alloc()
514 if (!gspca_dev->frbuf) { in frame_alloc()
545 if (gspca_dev->frbuf != NULL) { in frame_free()
565 if (urb == NULL) in destroy_urbs()
570 if (urb->transfer_buffer != NULL) in destroy_urbs()
583 if (gspca_dev->alt == 0) in gspca_set_alt0()
586 if (ret < 0) in gspca_set_alt0()
595 if (gspca_dev->present) { in gspca_stream_off()
596 if (gspca_dev->sd_desc->stopN) in gspca_stream_off()
605 if (gspca_dev->sd_desc->stop0) in gspca_stream_off()
622 if (attr == xfer in alt_xfer()
640 /* if the image is compressed, estimate its mean size */ in which_bandwidth()
641 if (!gspca_dev->cam.needs_full_bandwidth && in which_bandwidth()
647 if (gspca_dev->sd_desc->get_streamparm) { in which_bandwidth()
657 if (gspca_dev->width >= 640 in which_bandwidth()
688 if (nbalt > MAX_ALT) in build_isoc_ep_tb()
700 if (ep == NULL) in build_isoc_ep_tb()
702 if (ep->desc.bInterval == 0) { in build_isoc_ep_tb()
709 if (gspca_dev->dev->speed == USB_SPEED_HIGH in build_isoc_ep_tb()
713 if (bandwidth <= last_bw) in build_isoc_ep_tb()
715 if (bandwidth < ep_tb->bandwidth) { in build_isoc_ep_tb()
721 if (!found) in build_isoc_ep_tb()
731 * If the camera: in build_isoc_ep_tb()
738 if (gspca_dev->audio && in build_isoc_ep_tb()
752 if (ep_tb->bandwidth < bandwidth) in build_isoc_ep_tb()
771 if (!gspca_dev->cam.bulk) { /* isoc */ in create_urbs()
774 if (gspca_dev->pkt_size == 0) in create_urbs()
779 if (npkt == 0) in create_urbs()
789 if (bsize == 0) in create_urbs()
792 if (gspca_dev->cam.bulk_nurbs != 0) in create_urbs()
800 if (!urb) { in create_urbs()
810 if (urb->transfer_buffer == NULL) { in create_urbs()
817 if (npkt != 0) { /* ISOC */ in create_urbs()
850 if (mutex_lock_interruptible(&gspca_dev->usb_lock)) in gspca_init_transfer()
853 if (!gspca_dev->present) { in gspca_init_transfer()
869 if (gspca_dev->sd_desc->isoc_init) { in gspca_init_transfer()
871 if (ret < 0) in gspca_init_transfer()
877 /* if bulk or the subdriver forced an altsetting, get the endpoint */ in gspca_init_transfer()
878 if (gspca_dev->alt != 0) { in gspca_init_transfer()
881 if (ep == NULL) { in gspca_init_transfer()
893 if (alt_idx <= 0) { in gspca_init_transfer()
907 if (alt != gspca_dev->alt) { in gspca_init_transfer()
909 if (intf->num_altsetting > 1) { in gspca_init_transfer()
913 if (ret < 0) { in gspca_init_transfer()
914 if (ret == -ENOSPC) in gspca_init_transfer()
921 if (!gspca_dev->cam.no_urb_create) { in gspca_init_transfer()
925 if (ret < 0) { in gspca_init_transfer()
932 if (gspca_dev->cam.bulk) in gspca_init_transfer()
938 if (ret < 0) { in gspca_init_transfer()
945 if (gspca_dev->cam.bulk && gspca_dev->cam.bulk_nurbs == 0) in gspca_init_transfer()
951 if (urb == NULL) in gspca_init_transfer()
954 if (ret < 0) in gspca_init_transfer()
957 if (ret >= 0) in gspca_init_transfer()
963 if (ret != -ENOSPC) { in gspca_init_transfer()
976 if (gspca_dev->sd_desc->isoc_nego) { in gspca_init_transfer()
978 if (ret < 0) in gspca_init_transfer()
981 if (alt_idx <= 0) { in gspca_init_transfer()
1010 if (ctrl != NULL) { in gspca_set_default_mode()
1024 if (width >= gspca_dev->cam.cam_mode[i].width in wxh_to_mode()
1042 if (--modeD >= 0) { in gspca_get_mode()
1043 if (gspca_dev->cam.cam_mode[modeD].pixelformat in gspca_get_mode()
1047 if (++modeU < gspca_dev->cam.nmodes) { in gspca_get_mode()
1048 if (gspca_dev->cam.cam_mode[modeU].pixelformat in gspca_get_mode()
1063 if (!gspca_dev->sd_desc->get_chip_ident) in vidioc_g_register()
1066 if (!gspca_dev->sd_desc->get_register) in vidioc_g_register()
1069 if (mutex_lock_interruptible(&gspca_dev->usb_lock)) in vidioc_g_register()
1072 if (gspca_dev->present) in vidioc_g_register()
1087 if (!gspca_dev->sd_desc->get_chip_ident) in vidioc_s_register()
1090 if (!gspca_dev->sd_desc->set_register) in vidioc_s_register()
1093 if (mutex_lock_interruptible(&gspca_dev->usb_lock)) in vidioc_s_register()
1096 if (gspca_dev->present) in vidioc_s_register()
1112 if (!gspca_dev->sd_desc->get_chip_ident) in vidioc_g_chip_ident()
1115 if (mutex_lock_interruptible(&gspca_dev->usb_lock)) in vidioc_g_chip_ident()
1118 if (gspca_dev->present) in vidioc_g_chip_ident()
1141 if (fmt_tb[j] == fmt_tb[index]) in vidioc_enum_fmt_vid_cap()
1145 if (j == index) { in vidioc_enum_fmt_vid_cap()
1146 if (fmtdesc->index == index) in vidioc_enum_fmt_vid_cap()
1149 if (index >= ARRAY_SIZE(fmt_tb)) in vidioc_enum_fmt_vid_cap()
1153 if (i < 0) in vidioc_enum_fmt_vid_cap()
1157 if (gspca_dev->cam.cam_mode[i].sizeimage < in vidioc_enum_fmt_vid_cap()
1190 if (gspca_debug & D_CONF) in try_fmt_vid_cap()
1196 /* OK if right palette */ in try_fmt_vid_cap()
1197 if (gspca_dev->cam.cam_mode[mode].pixelformat in try_fmt_vid_cap()
1203 if (mode2 >= 0) in try_fmt_vid_cap()
1221 if (ret < 0) in vidioc_try_fmt_vid_cap()
1232 if (mutex_lock_interruptible(&gspca_dev->queue_lock)) in vidioc_s_fmt_vid_cap()
1236 if (ret < 0) in vidioc_s_fmt_vid_cap()
1239 if (gspca_dev->nframes != 0 in vidioc_s_fmt_vid_cap()
1245 if (ret == gspca_dev->curr_mode) { in vidioc_s_fmt_vid_cap()
1250 if (gspca_dev->streaming) { in vidioc_s_fmt_vid_cap()
1273 if (fsize->pixel_format != in vidioc_enum_framesizes()
1277 if (fsize->index == index) { in vidioc_enum_framesizes()
1298 if (gspca_dev->cam.mode_framerates == NULL || in vidioc_enum_frameintervals()
1302 if (fival->pixel_format != in vidioc_enum_frameintervals()
1307 if (fival->index == i) { in vidioc_enum_frameintervals()
1336 if (!gspca_dev->present) in dev_open()
1340 if (!try_module_get(gspca_dev->module)) in dev_open()
1346 if (gspca_debug & D_V4L2) in dev_open()
1361 if (mutex_lock_interruptible(&gspca_dev->queue_lock)) in dev_close()
1364 /* if the file did the capture, free the streaming resources */ in dev_close()
1365 if (gspca_dev->capt_file == file) { in dev_close()
1366 if (gspca_dev->streaming) { in dev_close()
1390 if (mutex_lock_interruptible(&gspca_dev->usb_lock)) in vidioc_querycap()
1392 if (!gspca_dev->present) { in vidioc_querycap()
1398 if (gspca_dev->dev->product != NULL) { in vidioc_querycap()
1427 if (gspca_dev->ctrl_dis & (1 << i)) in get_ctrl()
1429 if (id == ctrls->qctrl.id) in get_ctrl()
1445 if (id & V4L2_CTRL_FLAG_NEXT_CTRL) { in vidioc_queryctrl()
1450 if (gspca_dev->ctrl_dis & (1 << i)) in vidioc_queryctrl()
1452 if (gspca_dev->sd_desc->ctrls[i].qctrl.id < id) in vidioc_queryctrl()
1454 if (idx >= 0 in vidioc_queryctrl()
1463 if (idx < 0) in vidioc_queryctrl()
1467 if (gspca_dev->cam.ctrls != NULL) { in vidioc_queryctrl()
1473 if (gspca_dev->ctrl_inac & (1 << idx)) in vidioc_queryctrl()
1487 if (idx < 0) in vidioc_s_ctrl()
1489 if (gspca_dev->ctrl_inac & (1 << idx)) in vidioc_s_ctrl()
1492 if (gspca_dev->cam.ctrls != NULL) { in vidioc_s_ctrl()
1494 if (ctrl->value < gspca_ctrl->min in vidioc_s_ctrl()
1499 if (ctrl->value < ctrls->qctrl.minimum in vidioc_s_ctrl()
1504 if (mutex_lock_interruptible(&gspca_dev->usb_lock)) in vidioc_s_ctrl()
1506 if (!gspca_dev->present) { in vidioc_s_ctrl()
1511 if (ctrls->set != NULL) { in vidioc_s_ctrl()
1515 if (gspca_ctrl != NULL) { in vidioc_s_ctrl()
1517 if (ctrls->set_control != NULL in vidioc_s_ctrl()
1535 if (idx < 0) in vidioc_g_ctrl()
1539 if (mutex_lock_interruptible(&gspca_dev->usb_lock)) in vidioc_g_ctrl()
1541 if (!gspca_dev->present) { in vidioc_g_ctrl()
1546 if (ctrls->get != NULL) { in vidioc_g_ctrl()
1550 if (gspca_dev->cam.ctrls != NULL) in vidioc_g_ctrl()
1563 if (!gspca_dev->sd_desc->querymenu) in vidioc_querymenu()
1573 if (input->index != 0) in vidioc_enum_input()
1590 if (i > 0) in vidioc_s_input()
1610 if (mutex_lock_interruptible(&gspca_dev->queue_lock)) in vidioc_reqbufs()
1613 if (gspca_dev->memory != GSPCA_MEMORY_NO in vidioc_reqbufs()
1621 if (gspca_dev->capt_file != NULL in vidioc_reqbufs()
1627 /* if allocated, the buffers must not be mapped */ in vidioc_reqbufs()
1629 if (gspca_dev->frame[i].vma_use_count) { in vidioc_reqbufs()
1637 if (streaming) { in vidioc_reqbufs()
1645 if (gspca_dev->memory == GSPCA_MEMORY_READ) in vidioc_reqbufs()
1649 /* free the previous allocated buffers, if any */ in vidioc_reqbufs()
1650 if (gspca_dev->nframes != 0) in vidioc_reqbufs()
1652 if (rb->count == 0) /* unrequest */ in vidioc_reqbufs()
1655 if (ret == 0) { in vidioc_reqbufs()
1657 if (streaming) in vidioc_reqbufs()
1672 if (v4l2_buf->index < 0 in vidioc_querybuf()
1687 if (buf_type != V4L2_BUF_TYPE_VIDEO_CAPTURE) in vidioc_streamon()
1689 if (mutex_lock_interruptible(&gspca_dev->queue_lock)) in vidioc_streamon()
1693 if (gspca_dev->capt_file != file) { in vidioc_streamon()
1698 if (gspca_dev->nframes == 0 in vidioc_streamon()
1703 if (!gspca_dev->streaming) { in vidioc_streamon()
1705 if (ret < 0) in vidioc_streamon()
1709 if (gspca_debug & D_STREAM) { in vidioc_streamon()
1728 if (buf_type != V4L2_BUF_TYPE_VIDEO_CAPTURE) in vidioc_streamoff()
1731 if (mutex_lock_interruptible(&gspca_dev->queue_lock)) in vidioc_streamoff()
1734 if (!gspca_dev->streaming) { in vidioc_streamoff()
1740 if (gspca_dev->capt_file != file) { in vidioc_streamoff()
1746 if (mutex_lock_interruptible(&gspca_dev->usb_lock)) { in vidioc_streamoff()
1772 if (!gspca_dev->sd_desc->get_jcomp) in vidioc_g_jpegcomp()
1774 if (mutex_lock_interruptible(&gspca_dev->usb_lock)) in vidioc_g_jpegcomp()
1777 if (gspca_dev->present) in vidioc_g_jpegcomp()
1791 if (!gspca_dev->sd_desc->set_jcomp) in vidioc_s_jpegcomp()
1793 if (mutex_lock_interruptible(&gspca_dev->usb_lock)) in vidioc_s_jpegcomp()
1796 if (gspca_dev->present) in vidioc_s_jpegcomp()
1811 if (gspca_dev->sd_desc->get_streamparm) { in vidioc_g_parm()
1814 if (mutex_lock_interruptible(&gspca_dev->usb_lock)) in vidioc_g_parm()
1816 if (gspca_dev->present) { in vidioc_g_parm()
1837 if (n == 0 || n >= GSPCA_MAX_FRAMES) in vidioc_s_parm()
1842 if (gspca_dev->sd_desc->set_streamparm) { in vidioc_s_parm()
1845 if (mutex_lock_interruptible(&gspca_dev->usb_lock)) in vidioc_s_parm()
1847 if (gspca_dev->present) { in vidioc_s_parm()
1873 if (mutex_lock_interruptible(&gspca_dev->queue_lock)) in dev_mmap()
1875 if (!gspca_dev->present) { in dev_mmap()
1879 if (gspca_dev->capt_file != file) { in dev_mmap()
1886 if (gspca_dev->frame[i].v4l2_buf.memory != V4L2_MEMORY_MMAP) { in dev_mmap()
1890 if ((gspca_dev->frame[i].v4l2_buf.m.offset >> PAGE_SHIFT) in dev_mmap()
1896 if (frame == NULL) { in dev_mmap()
1901 if (size != frame->v4l2_buf.length) { in dev_mmap()
1917 if (ret < 0) in dev_mmap()
1936 if (!gspca_dev->present) in frame_ready_nolock()
1938 if (gspca_dev->capt_file != file || gspca_dev->memory != memory || in frame_ready_nolock()
1942 /* check if a frame is ready */ in frame_ready_nolock()
1951 if (mutex_lock_interruptible(&gspca_dev->queue_lock)) in frame_ready()
1961 * If nonblock_ing is false, block until a buffer is available.
1972 if (mutex_lock_interruptible(&gspca_dev->queue_lock)) in vidioc_dqbuf()
1977 if (ret < 0) in vidioc_dqbuf()
1979 if (ret > 0) in vidioc_dqbuf()
1984 if (file->f_flags & O_NONBLOCK) in vidioc_dqbuf()
1991 if (ret < 0) in vidioc_dqbuf()
1993 if (ret == 0) in vidioc_dqbuf()
1996 if (mutex_lock_interruptible(&gspca_dev->queue_lock)) in vidioc_dqbuf()
2006 if (gspca_dev->sd_desc->dq_callback) { in vidioc_dqbuf()
2009 if (gspca_dev->present) in vidioc_dqbuf()
2019 if (gspca_dev->memory == V4L2_MEMORY_USERPTR) { in vidioc_dqbuf()
2020 if (copy_to_user((__u8 __user *) frame->v4l2_buf.m.userptr, in vidioc_dqbuf()
2048 if (mutex_lock_interruptible(&gspca_dev->queue_lock)) in vidioc_qbuf()
2052 if ((unsigned) index >= gspca_dev->nframes) { in vidioc_qbuf()
2058 if (v4l2_buf->memory != gspca_dev->memory) { in vidioc_qbuf()
2065 if (frame->v4l2_buf.flags & BUF_ALL_FLAGS) { in vidioc_qbuf()
2073 if (frame->v4l2_buf.memory == V4L2_MEMORY_USERPTR) { in vidioc_qbuf()
2101 if (gspca_dev->nframes == 0) { in read_alloc()
2109 if (ret != 0) { in read_alloc()
2119 if (ret != 0) { in read_alloc()
2129 if (ret != 0) in read_alloc()
2143 /* if reqbufs is not done, the user would use read() */ in dev_poll()
2144 if (gspca_dev->memory == GSPCA_MEMORY_NO) { in dev_poll()
2146 if (ret != 0) in dev_poll()
2150 if (mutex_lock_interruptible(&gspca_dev->queue_lock) != 0) in dev_poll()
2153 /* check if an image has been received */ in dev_poll()
2154 if (gspca_dev->fr_o != atomic_read(&gspca_dev->fr_i)) in dev_poll()
2159 if (!gspca_dev->present) in dev_poll()
2174 if (!gspca_dev->present) in dev_read()
2176 if (gspca_dev->memory == GSPCA_MEMORY_NO) { /* first time ? */ in dev_read()
2178 if (ret != 0) in dev_read()
2191 if (ret != 0) { in dev_read()
2196 /* if the process slept for more than 1 second, in dev_read()
2199 if (--n < 0) in dev_read()
2201 if (frame->v4l2_buf.timestamp.tv_sec >= timestamp.tv_sec) in dev_read()
2204 if (ret != 0) { in dev_read()
2211 if (count > frame->v4l2_buf.bytesused) in dev_read()
2214 if (ret != 0) { in dev_read()
2224 if (ret2 != 0) in dev_read()
2314 if (dev_size < sizeof *gspca_dev) in gspca_dev_probe2()
2317 if (!gspca_dev) { in gspca_dev_probe2()
2322 if (!gspca_dev->usb_buf) { in gspca_dev_probe2()
2330 /* check if any audio device */ in gspca_dev_probe2()
2331 if (dev->actconfig->desc.bNumInterfaces != 1) { in gspca_dev_probe2()
2337 if (intf2 != NULL in gspca_dev_probe2()
2353 if (ret < 0) in gspca_dev_probe2()
2355 if (gspca_dev->cam.ctrls != NULL) in gspca_dev_probe2()
2358 if (ret < 0) in gspca_dev_probe2()
2363 if (ret) in gspca_dev_probe2()
2378 if (ret < 0) { in gspca_dev_probe2()
2390 #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE) in gspca_dev_probe2()
2391 if (gspca_dev->input_dev) in gspca_dev_probe2()
2410 if (dev->descriptor.bNumConfigurations != 1) { in gspca_dev_probe()
2417 if (dev->actconfig->desc.bNumInterfaces != 1 in gspca_dev_probe()
2434 #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE) in gspca_disconnect()
2447 #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE) in gspca_disconnect()
2450 if (input_dev) { in gspca_disconnect()
2475 if (!gspca_dev->streaming) in gspca_suspend()
2478 if (gspca_dev->sd_desc->stopN) in gspca_suspend()
2483 if (gspca_dev->sd_desc->stop0) in gspca_suspend()
2496 if (gspca_dev->streaming) in gspca_resume()
2507 Returns 0 if no changes were made, 1 if the gain and or exposure settings
2519 if (gspca_dev->ctrl_dis & (1 << i)) in gspca_auto_gain_n_exposure()
2521 if (gspca_dev->sd_desc->ctrls[i].qctrl.id == V4L2_CID_GAIN) in gspca_auto_gain_n_exposure()
2523 if (gspca_dev->sd_desc->ctrls[i].qctrl.id == V4L2_CID_EXPOSURE) in gspca_auto_gain_n_exposure()
2525 if (gspca_dev->sd_desc->ctrls[i].qctrl.id == V4L2_CID_AUTOGAIN) in gspca_auto_gain_n_exposure()
2528 if (!gain_ctrl || !exposure_ctrl || !autogain_ctrl) { in gspca_auto_gain_n_exposure()
2534 if (gain_ctrl->get(gspca_dev, &gain) || in gspca_auto_gain_n_exposure()
2542 /* If we are of a multiple of deadzone, do multiple steps to reach the in gspca_auto_gain_n_exposure()
2550 if (avg_lum > desired_avg_lum) { in gspca_auto_gain_n_exposure()
2551 if (gain > gain_knee) in gspca_auto_gain_n_exposure()
2553 else if (exposure > exposure_knee) in gspca_auto_gain_n_exposure()
2555 else if (gain > gain_ctrl->qctrl.default_value) in gspca_auto_gain_n_exposure()
2557 else if (exposure > exposure_ctrl->qctrl.minimum) in gspca_auto_gain_n_exposure()
2559 else if (gain > gain_ctrl->qctrl.minimum) in gspca_auto_gain_n_exposure()
2564 if (gain < gain_ctrl->qctrl.default_value) in gspca_auto_gain_n_exposure()
2566 else if (exposure < exposure_knee) in gspca_auto_gain_n_exposure()
2568 else if (gain < gain_knee) in gspca_auto_gain_n_exposure()
2570 else if (exposure < exposure_ctrl->qctrl.maximum) in gspca_auto_gain_n_exposure()
2572 else if (gain < gain_ctrl->qctrl.maximum) in gspca_auto_gain_n_exposure()
2579 if (gain != orig_gain) { in gspca_auto_gain_n_exposure()
2583 if (exposure != orig_exposure) { in gspca_auto_gain_n_exposure()