Lines Matching full:sd

29 int stv06xx_write_bridge(struct sd *sd, u16 address, u16 i2c_data)  in stv06xx_write_bridge()  argument
32 struct gspca_dev *gspca_dev = (struct gspca_dev *)sd; in stv06xx_write_bridge()
33 struct usb_device *udev = sd->gspca_dev.dev; in stv06xx_write_bridge()
34 __u8 *buf = sd->gspca_dev.usb_buf; in stv06xx_write_bridge()
51 int stv06xx_read_bridge(struct sd *sd, u16 address, u8 *i2c_data) in stv06xx_read_bridge() argument
54 struct gspca_dev *gspca_dev = (struct gspca_dev *)sd; in stv06xx_read_bridge()
55 struct usb_device *udev = sd->gspca_dev.dev; in stv06xx_read_bridge()
56 __u8 *buf = sd->gspca_dev.usb_buf; in stv06xx_read_bridge()
72 int stv06xx_write_sensor(struct sd *sd, u8 address, u16 value) in stv06xx_write_sensor() argument
74 if (sd->sensor->i2c_len == 2) { in stv06xx_write_sensor()
76 return stv06xx_write_sensor_words(sd, data, 1); in stv06xx_write_sensor()
79 return stv06xx_write_sensor_bytes(sd, data, 1); in stv06xx_write_sensor()
83 static int stv06xx_write_sensor_finish(struct sd *sd) in stv06xx_write_sensor_finish() argument
87 if (sd->bridge == BRIDGE_STV610) { in stv06xx_write_sensor_finish()
88 struct usb_device *udev = sd->gspca_dev.dev; in stv06xx_write_sensor_finish()
89 __u8 *buf = sd->gspca_dev.usb_buf; in stv06xx_write_sensor_finish()
100 int stv06xx_write_sensor_bytes(struct sd *sd, const u8 *data, u8 len) in stv06xx_write_sensor_bytes() argument
103 struct gspca_dev *gspca_dev = (struct gspca_dev *)sd; in stv06xx_write_sensor_bytes()
104 struct usb_device *udev = sd->gspca_dev.dev; in stv06xx_write_sensor_bytes()
105 __u8 *buf = sd->gspca_dev.usb_buf; in stv06xx_write_sensor_bytes()
118 buf[0x20] = sd->sensor->i2c_addr; in stv06xx_write_sensor_bytes()
128 return stv06xx_write_sensor_finish(sd); in stv06xx_write_sensor_bytes()
131 int stv06xx_write_sensor_words(struct sd *sd, const u16 *data, u8 len) in stv06xx_write_sensor_words() argument
134 struct gspca_dev *gspca_dev = (struct gspca_dev *)sd; in stv06xx_write_sensor_words()
135 struct usb_device *udev = sd->gspca_dev.dev; in stv06xx_write_sensor_words()
136 __u8 *buf = sd->gspca_dev.usb_buf; in stv06xx_write_sensor_words()
151 buf[0x20] = sd->sensor->i2c_addr; in stv06xx_write_sensor_words()
161 return stv06xx_write_sensor_finish(sd); in stv06xx_write_sensor_words()
164 int stv06xx_read_sensor(struct sd *sd, const u8 address, u16 *value) in stv06xx_read_sensor() argument
167 struct gspca_dev *gspca_dev = (struct gspca_dev *)sd; in stv06xx_read_sensor()
168 struct usb_device *udev = sd->gspca_dev.dev; in stv06xx_read_sensor()
169 __u8 *buf = sd->gspca_dev.usb_buf; in stv06xx_read_sensor()
171 err = stv06xx_write_bridge(sd, STV_I2C_FLUSH, sd->sensor->i2c_flush); in stv06xx_read_sensor()
179 buf[0x20] = sd->sensor->i2c_addr; in stv06xx_read_sensor()
194 0x04, 0xc0, 0x1410, 0, buf, sd->sensor->i2c_len, in stv06xx_read_sensor()
196 if (sd->sensor->i2c_len == 2) in stv06xx_read_sensor()
208 static void stv06xx_dump_bridge(struct sd *sd) in stv06xx_dump_bridge() argument
215 stv06xx_read_bridge(sd, i, &data); in stv06xx_dump_bridge()
222 stv06xx_read_bridge(sd, i, &data); in stv06xx_dump_bridge()
225 stv06xx_write_bridge(sd, i, 0xff); in stv06xx_dump_bridge()
226 stv06xx_read_bridge(sd, i, &data); in stv06xx_dump_bridge()
235 stv06xx_write_bridge(sd, i, buf); in stv06xx_dump_bridge()
242 struct sd *sd = (struct sd *) gspca_dev; in stv06xx_init() local
251 err = sd->sensor->init(sd); in stv06xx_init()
253 if (dump_sensor && sd->sensor->dump) in stv06xx_init()
254 sd->sensor->dump(sd); in stv06xx_init()
262 struct sd *sd = (struct sd *) gspca_dev; in stv06xx_init_controls() local
267 return sd->sensor->init_controls(sd); in stv06xx_init_controls()
273 struct sd *sd = (struct sd *) gspca_dev; in stv06xx_start() local
278 intf = usb_ifnum_to_if(sd->gspca_dev.dev, sd->gspca_dev.iface); in stv06xx_start()
279 alt = usb_altnum_to_altsetting(intf, sd->gspca_dev.alt); in stv06xx_start()
289 err = stv06xx_write_bridge(sd, STV_ISO_SIZE_L, packet_size); in stv06xx_start()
294 err = sd->sensor->start(sd); in stv06xx_start()
299 err = stv06xx_write_bridge(sd, STV_ISO_ENABLE, 1); in stv06xx_start()
314 struct sd *sd = (struct sd *) gspca_dev; in stv06xx_isoc_init() local
328 cpu_to_le16(sd->sensor->max_packet_size[gspca_dev->curr_mode]); in stv06xx_isoc_init()
337 struct sd *sd = (struct sd *) gspca_dev; in stv06xx_isoc_nego() local
345 min_packet_size = sd->sensor->min_packet_size[gspca_dev->curr_mode]; in stv06xx_isoc_nego()
364 struct sd *sd = (struct sd *) gspca_dev; in stv06xx_stopN() local
367 err = stv06xx_write_bridge(sd, STV_ISO_ENABLE, 0); in stv06xx_stopN()
371 err = sd->sensor->stop(sd); in stv06xx_stopN()
396 struct sd *sd = (struct sd *) gspca_dev; in stv06xx_pkt_scan() local
428 if (sd->bridge == BRIDGE_ST6422 && (id & 0xff00) == 0x0200) in stv06xx_pkt_scan()
437 if (sd->to_skip) { in stv06xx_pkt_scan()
438 int skip = (sd->to_skip < chunk_len) ? in stv06xx_pkt_scan()
439 sd->to_skip : chunk_len; in stv06xx_pkt_scan()
443 sd->to_skip -= skip; in stv06xx_pkt_scan()
460 if (sd->bridge == BRIDGE_ST6422) in stv06xx_pkt_scan()
461 sd->to_skip = gspca_dev->pixfmt.width * 4; in stv06xx_pkt_scan()
534 struct sd *sd = (struct sd *)gspca_dev; in stv06xx_probe_error() local
536 kfree(sd->sensor_priv); in stv06xx_probe_error()
537 sd->sensor_priv = NULL; in stv06xx_probe_error()
561 struct sd *sd = (struct sd *) gspca_dev; in stv06xx_config() local
565 sd->bridge = id->driver_info; in stv06xx_config()
569 stv06xx_dump_bridge(sd); in stv06xx_config()
571 sd->sensor = &stv06xx_sensor_st6422; in stv06xx_config()
572 if (!sd->sensor->probe(sd)) in stv06xx_config()
575 sd->sensor = &stv06xx_sensor_vv6410; in stv06xx_config()
576 if (!sd->sensor->probe(sd)) in stv06xx_config()
579 sd->sensor = &stv06xx_sensor_hdcs1x00; in stv06xx_config()
580 if (!sd->sensor->probe(sd)) in stv06xx_config()
583 sd->sensor = &stv06xx_sensor_hdcs1020; in stv06xx_config()
584 if (!sd->sensor->probe(sd)) in stv06xx_config()
587 sd->sensor = &stv06xx_sensor_pb0100; in stv06xx_config()
588 if (!sd->sensor->probe(sd)) in stv06xx_config()
591 sd->sensor = NULL; in stv06xx_config()
613 return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd), in sd_probe()
620 struct sd *sd = (struct sd *) gspca_dev; in sd_disconnect() local
621 void *priv = sd->sensor_priv; in sd_disconnect()
624 sd->sensor = NULL; in sd_disconnect()