• Home
  • Raw
  • Download

Lines Matching refs:sd

42 int stv06xx_write_bridge(struct sd *sd, u16 address, u16 i2c_data)  in stv06xx_write_bridge()  argument
45 struct gspca_dev *gspca_dev = (struct gspca_dev *)sd; in stv06xx_write_bridge()
46 struct usb_device *udev = sd->gspca_dev.dev; in stv06xx_write_bridge()
47 __u8 *buf = sd->gspca_dev.usb_buf; in stv06xx_write_bridge()
64 int stv06xx_read_bridge(struct sd *sd, u16 address, u8 *i2c_data) in stv06xx_read_bridge() argument
67 struct gspca_dev *gspca_dev = (struct gspca_dev *)sd; in stv06xx_read_bridge()
68 struct usb_device *udev = sd->gspca_dev.dev; in stv06xx_read_bridge()
69 __u8 *buf = sd->gspca_dev.usb_buf; in stv06xx_read_bridge()
85 int stv06xx_write_sensor(struct sd *sd, u8 address, u16 value) in stv06xx_write_sensor() argument
87 if (sd->sensor->i2c_len == 2) { in stv06xx_write_sensor()
89 return stv06xx_write_sensor_words(sd, data, 1); in stv06xx_write_sensor()
92 return stv06xx_write_sensor_bytes(sd, data, 1); in stv06xx_write_sensor()
96 static int stv06xx_write_sensor_finish(struct sd *sd) in stv06xx_write_sensor_finish() argument
100 if (sd->bridge == BRIDGE_STV610) { in stv06xx_write_sensor_finish()
101 struct usb_device *udev = sd->gspca_dev.dev; in stv06xx_write_sensor_finish()
102 __u8 *buf = sd->gspca_dev.usb_buf; in stv06xx_write_sensor_finish()
113 int stv06xx_write_sensor_bytes(struct sd *sd, const u8 *data, u8 len) in stv06xx_write_sensor_bytes() argument
116 struct gspca_dev *gspca_dev = (struct gspca_dev *)sd; in stv06xx_write_sensor_bytes()
117 struct usb_device *udev = sd->gspca_dev.dev; in stv06xx_write_sensor_bytes()
118 __u8 *buf = sd->gspca_dev.usb_buf; in stv06xx_write_sensor_bytes()
130 buf[0x20] = sd->sensor->i2c_addr; in stv06xx_write_sensor_bytes()
140 return stv06xx_write_sensor_finish(sd); in stv06xx_write_sensor_bytes()
143 int stv06xx_write_sensor_words(struct sd *sd, const u16 *data, u8 len) in stv06xx_write_sensor_words() argument
146 struct gspca_dev *gspca_dev = (struct gspca_dev *)sd; in stv06xx_write_sensor_words()
147 struct usb_device *udev = sd->gspca_dev.dev; in stv06xx_write_sensor_words()
148 __u8 *buf = sd->gspca_dev.usb_buf; in stv06xx_write_sensor_words()
162 buf[0x20] = sd->sensor->i2c_addr; in stv06xx_write_sensor_words()
172 return stv06xx_write_sensor_finish(sd); in stv06xx_write_sensor_words()
175 int stv06xx_read_sensor(struct sd *sd, const u8 address, u16 *value) in stv06xx_read_sensor() argument
178 struct gspca_dev *gspca_dev = (struct gspca_dev *)sd; in stv06xx_read_sensor()
179 struct usb_device *udev = sd->gspca_dev.dev; in stv06xx_read_sensor()
180 __u8 *buf = sd->gspca_dev.usb_buf; in stv06xx_read_sensor()
182 err = stv06xx_write_bridge(sd, STV_I2C_FLUSH, sd->sensor->i2c_flush); in stv06xx_read_sensor()
190 buf[0x20] = sd->sensor->i2c_addr; in stv06xx_read_sensor()
205 0x04, 0xc0, 0x1410, 0, buf, sd->sensor->i2c_len, in stv06xx_read_sensor()
207 if (sd->sensor->i2c_len == 2) in stv06xx_read_sensor()
219 static void stv06xx_dump_bridge(struct sd *sd) in stv06xx_dump_bridge() argument
226 stv06xx_read_bridge(sd, i, &data); in stv06xx_dump_bridge()
233 stv06xx_read_bridge(sd, i, &data); in stv06xx_dump_bridge()
236 stv06xx_write_bridge(sd, i, 0xff); in stv06xx_dump_bridge()
237 stv06xx_read_bridge(sd, i, &data); in stv06xx_dump_bridge()
246 stv06xx_write_bridge(sd, i, buf); in stv06xx_dump_bridge()
253 struct sd *sd = (struct sd *) gspca_dev; in stv06xx_init() local
262 err = sd->sensor->init(sd); in stv06xx_init()
264 if (dump_sensor && sd->sensor->dump) in stv06xx_init()
265 sd->sensor->dump(sd); in stv06xx_init()
273 struct sd *sd = (struct sd *) gspca_dev; in stv06xx_init_controls() local
278 return sd->sensor->init_controls(sd); in stv06xx_init_controls()
284 struct sd *sd = (struct sd *) gspca_dev; in stv06xx_start() local
289 intf = usb_ifnum_to_if(sd->gspca_dev.dev, sd->gspca_dev.iface); in stv06xx_start()
290 alt = usb_altnum_to_altsetting(intf, sd->gspca_dev.alt); in stv06xx_start()
297 err = stv06xx_write_bridge(sd, STV_ISO_SIZE_L, packet_size); in stv06xx_start()
302 err = sd->sensor->start(sd); in stv06xx_start()
307 err = stv06xx_write_bridge(sd, STV_ISO_ENABLE, 1); in stv06xx_start()
321 struct sd *sd = (struct sd *) gspca_dev; in stv06xx_isoc_init() local
326 cpu_to_le16(sd->sensor->max_packet_size[gspca_dev->curr_mode]); in stv06xx_isoc_init()
335 struct sd *sd = (struct sd *) gspca_dev; in stv06xx_isoc_nego() local
339 min_packet_size = sd->sensor->min_packet_size[gspca_dev->curr_mode]; in stv06xx_isoc_nego()
358 struct sd *sd = (struct sd *) gspca_dev; in stv06xx_stopN() local
361 err = stv06xx_write_bridge(sd, STV_ISO_ENABLE, 0); in stv06xx_stopN()
365 err = sd->sensor->stop(sd); in stv06xx_stopN()
390 struct sd *sd = (struct sd *) gspca_dev; in stv06xx_pkt_scan() local
422 if (sd->bridge == BRIDGE_ST6422 && (id & 0xff00) == 0x0200) in stv06xx_pkt_scan()
431 if (sd->to_skip) { in stv06xx_pkt_scan()
432 int skip = (sd->to_skip < chunk_len) ? in stv06xx_pkt_scan()
433 sd->to_skip : chunk_len; in stv06xx_pkt_scan()
437 sd->to_skip -= skip; in stv06xx_pkt_scan()
454 if (sd->bridge == BRIDGE_ST6422) in stv06xx_pkt_scan()
455 sd->to_skip = gspca_dev->pixfmt.width * 4; in stv06xx_pkt_scan()
547 struct sd *sd = (struct sd *) gspca_dev; in stv06xx_config() local
551 sd->bridge = id->driver_info; in stv06xx_config()
555 stv06xx_dump_bridge(sd); in stv06xx_config()
557 sd->sensor = &stv06xx_sensor_st6422; in stv06xx_config()
558 if (!sd->sensor->probe(sd)) in stv06xx_config()
561 sd->sensor = &stv06xx_sensor_vv6410; in stv06xx_config()
562 if (!sd->sensor->probe(sd)) in stv06xx_config()
565 sd->sensor = &stv06xx_sensor_hdcs1x00; in stv06xx_config()
566 if (!sd->sensor->probe(sd)) in stv06xx_config()
569 sd->sensor = &stv06xx_sensor_hdcs1020; in stv06xx_config()
570 if (!sd->sensor->probe(sd)) in stv06xx_config()
573 sd->sensor = &stv06xx_sensor_pb0100; in stv06xx_config()
574 if (!sd->sensor->probe(sd)) in stv06xx_config()
577 sd->sensor = NULL; in stv06xx_config()
605 return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd), in sd_probe()
612 struct sd *sd = (struct sd *) gspca_dev; in sd_disconnect() local
613 void *priv = sd->sensor_priv; in sd_disconnect()
616 sd->sensor = NULL; in sd_disconnect()