Lines Matching refs:gspca_dev
41 struct gspca_dev *gspca_dev = (struct gspca_dev *)sd; in stv06xx_write_bridge() local
42 struct usb_device *udev = sd->gspca_dev.dev; in stv06xx_write_bridge()
43 __u8 *buf = sd->gspca_dev.usb_buf; in stv06xx_write_bridge()
54 gspca_dbg(gspca_dev, D_CONF, "Written 0x%x to address 0x%x, status: %d\n", in stv06xx_write_bridge()
63 struct gspca_dev *gspca_dev = (struct gspca_dev *)sd; in stv06xx_read_bridge() local
64 struct usb_device *udev = sd->gspca_dev.dev; in stv06xx_read_bridge()
65 __u8 *buf = sd->gspca_dev.usb_buf; in stv06xx_read_bridge()
73 gspca_dbg(gspca_dev, D_CONF, "Reading 0x%x from address 0x%x, status %d\n", in stv06xx_read_bridge()
97 struct usb_device *udev = sd->gspca_dev.dev; in stv06xx_write_sensor_finish()
98 __u8 *buf = sd->gspca_dev.usb_buf; in stv06xx_write_sensor_finish()
112 struct gspca_dev *gspca_dev = (struct gspca_dev *)sd; in stv06xx_write_sensor_bytes() local
113 struct usb_device *udev = sd->gspca_dev.dev; in stv06xx_write_sensor_bytes()
114 __u8 *buf = sd->gspca_dev.usb_buf; in stv06xx_write_sensor_bytes()
116 gspca_dbg(gspca_dev, D_CONF, "I2C: Command buffer contains %d entries\n", in stv06xx_write_sensor_bytes()
124 gspca_dbg(gspca_dev, D_CONF, "I2C: Writing 0x%02x to reg 0x%02x\n", in stv06xx_write_sensor_bytes()
143 struct gspca_dev *gspca_dev = (struct gspca_dev *)sd; in stv06xx_write_sensor_words() local
144 struct usb_device *udev = sd->gspca_dev.dev; in stv06xx_write_sensor_words()
145 __u8 *buf = sd->gspca_dev.usb_buf; in stv06xx_write_sensor_words()
147 gspca_dbg(gspca_dev, D_CONF, "I2C: Command buffer contains %d entries\n", in stv06xx_write_sensor_words()
157 gspca_dbg(gspca_dev, D_CONF, "I2C: Writing 0x%04x to reg 0x%02x\n", in stv06xx_write_sensor_words()
176 struct gspca_dev *gspca_dev = (struct gspca_dev *)sd; in stv06xx_read_sensor() local
177 struct usb_device *udev = sd->gspca_dev.dev; in stv06xx_read_sensor()
178 __u8 *buf = sd->gspca_dev.usb_buf; in stv06xx_read_sensor()
210 gspca_dbg(gspca_dev, D_CONF, "I2C: Read 0x%x from address 0x%x, status: %d\n", in stv06xx_read_sensor()
249 static int stv06xx_init(struct gspca_dev *gspca_dev) in stv06xx_init() argument
251 struct sd *sd = (struct sd *) gspca_dev; in stv06xx_init()
254 gspca_dbg(gspca_dev, D_PROBE, "Initializing camera\n"); in stv06xx_init()
269 static int stv06xx_init_controls(struct gspca_dev *gspca_dev) in stv06xx_init_controls() argument
271 struct sd *sd = (struct sd *) gspca_dev; in stv06xx_init_controls()
273 gspca_dbg(gspca_dev, D_PROBE, "Initializing controls\n"); in stv06xx_init_controls()
275 gspca_dev->vdev.ctrl_handler = &gspca_dev->ctrl_handler; in stv06xx_init_controls()
280 static int stv06xx_start(struct gspca_dev *gspca_dev) in stv06xx_start() argument
282 struct sd *sd = (struct sd *) gspca_dev; in stv06xx_start()
287 intf = usb_ifnum_to_if(sd->gspca_dev.dev, sd->gspca_dev.iface); in stv06xx_start()
288 alt = usb_altnum_to_altsetting(intf, sd->gspca_dev.alt); in stv06xx_start()
290 gspca_err(gspca_dev, "Couldn't get altsetting\n"); in stv06xx_start()
312 gspca_dbg(gspca_dev, D_STREAM, "Starting stream failed\n"); in stv06xx_start()
314 gspca_dbg(gspca_dev, D_STREAM, "Started streaming\n"); in stv06xx_start()
319 static int stv06xx_isoc_init(struct gspca_dev *gspca_dev) in stv06xx_isoc_init() argument
323 struct sd *sd = (struct sd *) gspca_dev; in stv06xx_isoc_init()
325 intfc = gspca_dev->dev->actconfig->intf_cache[0]; in stv06xx_isoc_init()
337 cpu_to_le16(sd->sensor->max_packet_size[gspca_dev->curr_mode]); in stv06xx_isoc_init()
342 static int stv06xx_isoc_nego(struct gspca_dev *gspca_dev) in stv06xx_isoc_nego() argument
346 struct sd *sd = (struct sd *) gspca_dev; in stv06xx_isoc_nego()
352 alt = &gspca_dev->dev->actconfig->intf_cache[0]->altsetting[1]; in stv06xx_isoc_nego()
354 min_packet_size = sd->sensor->min_packet_size[gspca_dev->curr_mode]; in stv06xx_isoc_nego()
363 ret = usb_set_interface(gspca_dev->dev, gspca_dev->iface, 1); in stv06xx_isoc_nego()
365 gspca_err(gspca_dev, "set alt 1 err %d\n", ret); in stv06xx_isoc_nego()
370 static void stv06xx_stopN(struct gspca_dev *gspca_dev) in stv06xx_stopN() argument
373 struct sd *sd = (struct sd *) gspca_dev; in stv06xx_stopN()
384 gspca_dbg(gspca_dev, D_STREAM, "Failed to stop stream\n"); in stv06xx_stopN()
386 gspca_dbg(gspca_dev, D_STREAM, "Stopped streaming\n"); in stv06xx_stopN()
401 static void stv06xx_pkt_scan(struct gspca_dev *gspca_dev, in stv06xx_pkt_scan() argument
405 struct sd *sd = (struct sd *) gspca_dev; in stv06xx_pkt_scan()
407 gspca_dbg(gspca_dev, D_PACK, "Packet of length %d arrived\n", len); in stv06xx_pkt_scan()
415 gspca_dbg(gspca_dev, D_PACK, "Packet is smaller than 4 bytes\n"); in stv06xx_pkt_scan()
424 gspca_dbg(gspca_dev, D_PACK, "Chunk id: %x, length: %d\n", in stv06xx_pkt_scan()
431 gspca_err(gspca_dev, "URB packet length is smaller than the specified chunk length\n"); in stv06xx_pkt_scan()
432 gspca_dev->last_packet_type = DISCARD_PACKET; in stv06xx_pkt_scan()
444 gspca_dbg(gspca_dev, D_PACK, "Frame data packet detected\n"); in stv06xx_pkt_scan()
455 gspca_frame_add(gspca_dev, INTER_PACKET, in stv06xx_pkt_scan()
463 gspca_dbg(gspca_dev, D_PACK, "Starting new frame\n"); in stv06xx_pkt_scan()
466 gspca_frame_add(gspca_dev, FIRST_PACKET, in stv06xx_pkt_scan()
470 sd->to_skip = gspca_dev->pixfmt.width * 4; in stv06xx_pkt_scan()
473 gspca_err(gspca_dev, "Chunk length is non-zero on a SOF\n"); in stv06xx_pkt_scan()
479 gspca_dbg(gspca_dev, D_PACK, "End of frame detected\n"); in stv06xx_pkt_scan()
482 gspca_frame_add(gspca_dev, LAST_PACKET, in stv06xx_pkt_scan()
486 gspca_err(gspca_dev, "Chunk length is non-zero on a EOF\n"); in stv06xx_pkt_scan()
490 gspca_dbg(gspca_dev, D_PACK, "Chunk 0x005 detected\n"); in stv06xx_pkt_scan()
497 gspca_dbg(gspca_dev, D_PACK, "Chunk 0x0100 detected\n"); in stv06xx_pkt_scan()
502 gspca_dbg(gspca_dev, D_PACK, "Chunk 0x42ff detected\n"); in stv06xx_pkt_scan()
506 gspca_dbg(gspca_dev, D_PACK, "Unknown chunk 0x%04x detected\n", in stv06xx_pkt_scan()
516 static int sd_int_pkt_scan(struct gspca_dev *gspca_dev, in sd_int_pkt_scan() argument
523 input_report_key(gspca_dev->input_dev, KEY_CAMERA, 1); in sd_int_pkt_scan()
524 input_sync(gspca_dev->input_dev); in sd_int_pkt_scan()
529 input_report_key(gspca_dev->input_dev, KEY_CAMERA, 0); in sd_int_pkt_scan()
530 input_sync(gspca_dev->input_dev); in sd_int_pkt_scan()
538 static int stv06xx_config(struct gspca_dev *gspca_dev,
541 static void stv06xx_probe_error(struct gspca_dev *gspca_dev) in stv06xx_probe_error() argument
543 struct sd *sd = (struct sd *)gspca_dev; in stv06xx_probe_error()
567 static int stv06xx_config(struct gspca_dev *gspca_dev, in stv06xx_config() argument
570 struct sd *sd = (struct sd *) gspca_dev; in stv06xx_config()
572 gspca_dbg(gspca_dev, D_PROBE, "Configuring camera\n"); in stv06xx_config()
575 gspca_dev->sd_desc = &sd_desc; in stv06xx_config()
628 struct gspca_dev *gspca_dev = usb_get_intfdata(intf); in sd_disconnect() local
629 struct sd *sd = (struct sd *) gspca_dev; in sd_disconnect()
631 gspca_dbg(gspca_dev, D_PROBE, "Disconnecting the stv06xx device\n"); in sd_disconnect()