Lines Matching +full:cam +full:- +full:if

1 // SPDX-License-Identifier: GPL-2.0-or-later
124 struct usb_device *udev = gspca_dev->dev; in send_cmd()
126 uint8_t *obuf = sd->obuf; in send_cmd()
127 uint8_t *ibuf = sd->ibuf; in send_cmd()
131 if (cmd_len & 1 || cmd_len > (0x400 - sizeof(*chdr))) { in send_cmd()
133 return -1; in send_cmd()
136 chdr->magic[0] = 0x47; in send_cmd()
137 chdr->magic[1] = 0x4d; in send_cmd()
138 chdr->cmd = cpu_to_le16(cmd); in send_cmd()
139 chdr->tag = cpu_to_le16(sd->cam_tag); in send_cmd()
140 chdr->len = cpu_to_le16(cmd_len / 2); in send_cmd()
147 sd->cam_tag, cmd_len, res); in send_cmd()
148 if (res < 0) { in send_cmd()
157 if (actual_len < (int)sizeof(*rhdr)) { in send_cmd()
160 return actual_len < 0 ? actual_len : -EREMOTEIO; in send_cmd()
162 actual_len -= sizeof(*rhdr); in send_cmd()
164 if (rhdr->magic[0] != 0x52 || rhdr->magic[1] != 0x42) { in send_cmd()
166 rhdr->magic[0], rhdr->magic[1]); in send_cmd()
167 return -1; in send_cmd()
169 if (rhdr->cmd != chdr->cmd) { in send_cmd()
171 rhdr->cmd, chdr->cmd); in send_cmd()
172 return -1; in send_cmd()
174 if (rhdr->tag != chdr->tag) { in send_cmd()
176 rhdr->tag, chdr->tag); in send_cmd()
177 return -1; in send_cmd()
179 if (le16_to_cpu(rhdr->len) != (actual_len/2)) { in send_cmd()
181 le16_to_cpu(rhdr->len), (int)(actual_len/2)); in send_cmd()
182 return -1; in send_cmd()
185 if (actual_len > reply_len) { in send_cmd()
193 sd->cam_tag++; in send_cmd()
210 if (res < 0) in write_register()
212 if (res != 2) { in write_register()
224 struct cam *cam; in sd_config_video() local
226 sd->cam_tag = 0; in sd_config_video()
228 sd->stream_flag = 0x80; in sd_config_video()
230 cam = &gspca_dev->cam; in sd_config_video()
232 cam->cam_mode = video_camera_mode; in sd_config_video()
233 cam->nmodes = ARRAY_SIZE(video_camera_mode); in sd_config_video()
235 gspca_dev->xfer_ep = 0x81; in sd_config_video()
237 #if 0 in sd_config_video()
239 cam->npkt = 15; in sd_config_video()
240 gspca_dev->pkt_size = 960 * 2; in sd_config_video()
250 struct cam *cam; in sd_config_depth() local
252 sd->cam_tag = 0; in sd_config_depth()
254 sd->stream_flag = 0x70; in sd_config_depth()
256 cam = &gspca_dev->cam; in sd_config_depth()
258 cam->cam_mode = depth_camera_mode; in sd_config_depth()
259 cam->nmodes = ARRAY_SIZE(depth_camera_mode); in sd_config_depth()
261 gspca_dev->xfer_ep = 0x82; in sd_config_depth()
282 mode = gspca_dev->cam.cam_mode[gspca_dev->curr_mode].priv; in sd_start_video()
284 if (mode & FORMAT_Y10B) { in sd_start_video()
297 if (mode & FORMAT_UYVY) in sd_start_video()
302 if (mode & MODE_1280x1024) in sd_start_video()
307 if (mode & FPS_HIGH) in sd_start_video()
313 /* turn off IR-reset function */ in sd_start_video()
326 if (mode & (FORMAT_Y10B | MODE_1280x1024)) { in sd_start_video()
348 /* turn off IR-reset function */ in sd_start_depth()
385 int datalen = len - sizeof(*hdr); in sd_pkt_scan()
387 uint8_t sof = sd->stream_flag | 1; in sd_pkt_scan()
388 uint8_t mof = sd->stream_flag | 2; in sd_pkt_scan()
389 uint8_t eof = sd->stream_flag | 5; in sd_pkt_scan()
391 if (len < 12) in sd_pkt_scan()
394 if (hdr->magic[0] != 'R' || hdr->magic[1] != 'B') { in sd_pkt_scan()
396 sd->stream_flag, hdr->magic[0], hdr->magic[1]); in sd_pkt_scan()
400 if (hdr->flag == sof) in sd_pkt_scan()
403 else if (hdr->flag == mof) in sd_pkt_scan()
406 else if (hdr->flag == eof) in sd_pkt_scan()
413 /* sub-driver description */
439 /* -- module initialisation -- */
448 /* -- device connect -- */
451 if (depth_mode) in sd_probe()