Lines Matching +full:camera +full:- +full:command +full:- +full:set
1 // SPDX-License-Identifier: GPL-2.0-or-later
5 * V4L2 by Jean-Francois Moine <http://moinejf.free.fr>
16 MODULE_DESCRIPTION("GSPCA/SPCA500 USB Camera Driver");
107 /* set interface */
240 { /* Q-table Y-components */
249 { /* Q-table C-components */
261 { /* Q-table Y-components */
270 { /* Q-table C-components */
282 { /* Q-table Y-components start registers 0x8800 */
292 { /* Q-table C-components start registers 0x8840 */
303 /* read 'len' bytes to gspca_dev->usb_buf */
308 usb_control_msg(gspca_dev->dev, in reg_r()
309 usb_rcvctrlpipe(gspca_dev->dev, 0), in reg_r()
313 index, gspca_dev->usb_buf, length, 500); in reg_r()
323 ret = usb_control_msg(gspca_dev->dev, in reg_w()
324 usb_sndctrlpipe(gspca_dev->dev, 0), in reg_w()
341 gspca_dev->usb_buf[1] = 0; in reg_r_12()
342 ret = usb_control_msg(gspca_dev->dev, in reg_r_12()
343 usb_rcvctrlpipe(gspca_dev->dev, 0), in reg_r_12()
348 gspca_dev->usb_buf, length, in reg_r_12()
354 return (gspca_dev->usb_buf[1] << 8) + gspca_dev->usb_buf[0]; in reg_r_12()
358 * Simple function to wait for a given 8-bit value to be returned from
367 while (--cnt > 0) { in reg_r_wait()
373 return -EIO; in reg_r_wait()
418 gspca_dev->usb_buf[0], gspca_dev->usb_buf[1]); in spca500_ping310()
425 gspca_dev->usb_buf[0], gspca_dev->usb_buf[1]); in spca500_clksmart310_init()
450 /* set x multiplier */ in spca500_setmode()
453 /* set y multiplier */ in spca500_setmode()
457 mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv; in spca500_setmode()
465 /* send the reset command */ in spca500_full_reset()
491 /* up-port the same feature as in 2.4.x kernel */
494 if (usb_set_interface(gspca_dev->dev, gspca_dev->iface, 0) < 0) { in spca500_synch310()
495 gspca_err(gspca_dev, "Set packet size: set interface error\n"); in spca500_synch310()
504 gspca_dev->alt); in spca500_synch310()
507 if (usb_set_interface(gspca_dev->dev, in spca500_synch310()
508 gspca_dev->iface, in spca500_synch310()
509 gspca_dev->alt) < 0) { in spca500_synch310()
510 gspca_err(gspca_dev, "Set packet size: set interface error\n"); in spca500_synch310()
515 return -EBUSY; in spca500_synch310()
523 /* some unknown command from Aiptek pocket dv and family300 */ in spca500_reinit()
537 /* set qtable index */ in spca500_reinit()
541 /* Set agc transfer: synced between frames */ in spca500_reinit()
543 /* Init SDRAM - needed for SDRAM access */ in spca500_reinit()
547 /* switch to video camera mode */ in spca500_reinit()
552 Data = gspca_dev->usb_buf[0]; in spca500_reinit()
564 cam = &gspca_dev->cam; in sd_config()
565 sd->subtype = id->driver_info; in sd_config()
566 if (sd->subtype != LogitechClickSmart310) { in sd_config()
567 cam->cam_mode = vga_mode; in sd_config()
568 cam->nmodes = ARRAY_SIZE(vga_mode); in sd_config()
570 cam->cam_mode = sif_mode; in sd_config()
571 cam->nmodes = ARRAY_SIZE(sif_mode); in sd_config()
583 if (sd->subtype == LogitechClickSmart310) in sd_init()
599 jpeg_define(sd->jpeg_hdr, gspca_dev->pixfmt.height, in sd_start()
600 gspca_dev->pixfmt.width, in sd_start()
602 jpeg_set_qual(sd->jpeg_hdr, QUALITY); in sd_start()
604 if (sd->subtype == LogitechClickSmart310) { in sd_start()
615 gspca_dev->usb_buf[0]); in sd_start()
617 gspca_dev->curr_mode, xmult, ymult); in sd_start()
620 switch (sd->subtype) { in sd_start()
632 /* Init SDRAM - needed for SDRAM access */ in sd_start()
635 /* switch to video camera mode */ in sd_start()
642 Data = gspca_dev->usb_buf[0]; in sd_start()
660 /* Init SDRAM - needed for SDRAM access */ in sd_start()
663 /* switch to video camera mode */ in sd_start()
670 Data = gspca_dev->usb_buf[0]; in sd_start()
673 case CreativePCCam300: /* Creative PC-CAM 300 640x480 CCD */ in sd_start()
675 * Intel Pocket PC Camera in sd_start()
676 * - NWG (Sat 29th March 2003) */ in sd_start()
697 /* switch to video camera mode */ in sd_start()
704 Data = gspca_dev->usb_buf[0]; in sd_start()
727 /* switch to video camera mode */ in sd_start()
734 Data = gspca_dev->usb_buf[0]; in sd_start()
762 /* Set agc transfer: synced between frames */ in sd_start()
764 /* Init SDRAM - needed for SDRAM access */ in sd_start()
768 /* switch to video camera mode */ in sd_start()
774 Data = gspca_dev->usb_buf[0]; in sd_start()
790 /* Init SDRAM - needed for SDRAM access */ in sd_start()
795 /* switch to video camera mode */ in sd_start()
800 Data = gspca_dev->usb_buf[0]; in sd_start()
812 /* switch to video camera mode */ in sd_stopN()
816 gspca_dev->usb_buf[0]); in sd_stopN()
830 /* gspca_dev->last_packet_type = DISCARD_PACKET; */ in sd_pkt_scan()
838 sd->jpeg_hdr, JPEG_HDR_SZ); in sd_pkt_scan()
841 len -= SPCA500_OFFSET_DATA; in sd_pkt_scan()
844 len -= 1; in sd_pkt_scan()
853 len -= i; in sd_pkt_scan()
866 (__u8) (val - 128)); in setbrightness()
882 container_of(ctrl->handler, struct gspca_dev, ctrl_handler); in sd_s_ctrl()
884 gspca_dev->usb_err = 0; in sd_s_ctrl()
886 if (!gspca_dev->streaming) in sd_s_ctrl()
889 switch (ctrl->id) { in sd_s_ctrl()
891 setbrightness(gspca_dev, ctrl->val); in sd_s_ctrl()
894 setcontrast(gspca_dev, ctrl->val); in sd_s_ctrl()
897 setcolors(gspca_dev, ctrl->val); in sd_s_ctrl()
900 return gspca_dev->usb_err; in sd_s_ctrl()
909 struct v4l2_ctrl_handler *hdl = &gspca_dev->ctrl_handler; in sd_init_controls()
911 gspca_dev->vdev.ctrl_handler = hdl; in sd_init_controls()
920 if (hdl->error) { in sd_init_controls()
922 return hdl->error; in sd_init_controls()
927 /* sub-driver description */
938 /* -- module initialisation -- */
959 /* -- device connect -- */