Lines Matching +full:cam +full:- +full:0
1 // SPDX-License-Identifier: GPL-2.0-or-later
22 * 0x2000 bytes, so do the same. Note: reading more seems to work
24 #define FPIX_MAX_TRANSFER 0x2000
45 .priv = 0}
50 int order) /* 0: reset, 1: frame request */ in command()
53 {0xc6, 0, 0, 0, 0, 0, 0, 0, 0x20, 0, 0, 0}, /* reset */ in command()
54 {0xd3, 0, 0, 0, 0, 0, 0, 0x01, 0, 0, 0, 0}, /* fr req */ in command()
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()
80 int ret = 0; 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()
125 (data[len - 2] == 0xff && in dostream()
126 data[len - 1] == 0xd9)) { in dostream()
141 gspca_dev->last_packet_type 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()
171 return 0; in sd_config()
177 return 0; in sd_init()
187 ret = command(gspca_dev, 0); in sd_start()
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()
217 return 0; in sd_start()
220 /* called on streamoff with alt==0 and on disconnect */
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()
234 {USB_DEVICE(0x04cb, 0x0104)},
235 {USB_DEVICE(0x04cb, 0x0109)},
236 {USB_DEVICE(0x04cb, 0x010b)},
237 {USB_DEVICE(0x04cb, 0x010f)},
238 {USB_DEVICE(0x04cb, 0x0111)},
239 {USB_DEVICE(0x04cb, 0x0113)},
240 {USB_DEVICE(0x04cb, 0x0115)},
241 {USB_DEVICE(0x04cb, 0x0117)},
242 {USB_DEVICE(0x04cb, 0x0119)},
243 {USB_DEVICE(0x04cb, 0x011b)},
244 {USB_DEVICE(0x04cb, 0x011d)},
245 {USB_DEVICE(0x04cb, 0x0121)},
246 {USB_DEVICE(0x04cb, 0x0123)},
247 {USB_DEVICE(0x04cb, 0x0125)},
248 {USB_DEVICE(0x04cb, 0x0127)},
249 {USB_DEVICE(0x04cb, 0x0129)},
250 {USB_DEVICE(0x04cb, 0x012b)},
251 {USB_DEVICE(0x04cb, 0x012d)},
252 {USB_DEVICE(0x04cb, 0x012f)},
253 {USB_DEVICE(0x04cb, 0x0131)},
254 {USB_DEVICE(0x04cb, 0x013b)},
255 {USB_DEVICE(0x04cb, 0x013d)},
256 {USB_DEVICE(0x04cb, 0x013f)},
262 /* sub-driver description */
271 /* -- device connect -- */