Lines Matching +full:cam +full:- +full:if
1 // SPDX-License-Identifier: GPL-2.0-or-later
33 /* Delay after which claim the next frame. If the delay is too small,
57 memcpy(gspca_dev->usb_buf, order_values[order], 12); in command()
58 return usb_control_msg(gspca_dev->dev, in command()
59 usb_sndctrlpipe(gspca_dev->dev, 0), in command()
62 USB_RECIP_INTERFACE, 0, 0, gspca_dev->usb_buf, in command()
70 * threads attempting to use gspca_dev->usb_buf we take the usb_lock when
77 struct gspca_dev *gspca_dev = &dev->gspca_dev; in dostream()
78 struct urb *urb = gspca_dev->urb[0]; in dostream()
79 u8 *data = urb->transfer_buffer; in dostream()
87 while (gspca_dev->present && gspca_dev->streaming) { in dostream()
89 if (gspca_dev->frozen) in dostream()
94 mutex_lock(&gspca_dev->usb_lock); in dostream()
96 mutex_unlock(&gspca_dev->usb_lock); in dostream()
97 if (ret < 0) in dostream()
100 if (gspca_dev->frozen) in dostream()
103 if (!gspca_dev->present || !gspca_dev->streaming) in dostream()
108 ret = usb_bulk_msg(gspca_dev->dev, in dostream()
109 urb->pipe, in dostream()
113 if (ret < 0) { in dostream()
119 if (gspca_dev->frozen) in dostream()
122 if (!gspca_dev->present || !gspca_dev->streaming) in dostream()
124 if (len < FPIX_MAX_TRANSFER || in dostream()
125 (data[len - 2] == 0xff && in dostream()
126 data[len - 1] == 0xd9)) { in dostream()
128 /* If the result is less than what was asked in dostream()
132 * here if the jpeg ends right at the end in dostream()
141 gspca_dev->last_packet_type in dostream()
148 * frame. If we don't, or if the delay is too short, in dostream()
162 struct cam *cam = &gspca_dev->cam; in sd_config() local
164 cam->cam_mode = fpix_mode; in sd_config()
165 cam->nmodes = 1; in sd_config()
166 cam->bulk = 1; in sd_config()
167 cam->bulk_size = FPIX_MAX_TRANSFER; in sd_config()
169 INIT_WORK(&dev->work_struct, dostream); in sd_config()
188 if (ret < 0) { in sd_start()
195 ret = usb_bulk_msg(gspca_dev->dev, in sd_start()
196 gspca_dev->urb[0]->pipe, in sd_start()
197 gspca_dev->urb[0]->transfer_buffer, in sd_start()
200 if (ret < 0) { in sd_start()
207 if (ret < 0) { in sd_start()
213 usb_clear_halt(gspca_dev->dev, gspca_dev->urb[0]->pipe); in sd_start()
215 schedule_work(&dev->work_struct); in sd_start()
221 /* the usb_lock is held at entry - restore on exit */
227 mutex_unlock(&gspca_dev->usb_lock); in sd_stop0()
228 flush_work(&dev->work_struct); in sd_stop0()
229 mutex_lock(&gspca_dev->usb_lock); in sd_stop0()
262 /* sub-driver description */
271 /* -- device connect -- */