Lines Matching refs:sd
95 static int hdcs_reg_write_seq(struct sd *sd, u8 reg, u8 *vals, u8 len) in hdcs_reg_write_seq() argument
112 return stv06xx_write_sensor_bytes(sd, regs, len); in hdcs_reg_write_seq()
115 static int hdcs_set_state(struct sd *sd, enum hdcs_power_state state) in hdcs_set_state() argument
117 struct hdcs *hdcs = sd->sensor_priv; in hdcs_set_state()
126 ret = stv06xx_write_sensor(sd, HDCS_REG_CONTROL(sd), 0); in hdcs_set_state()
149 ret = stv06xx_write_sensor(sd, HDCS_REG_CONTROL(sd), val); in hdcs_set_state()
158 static int hdcs_reset(struct sd *sd) in hdcs_reset() argument
160 struct hdcs *hdcs = sd->sensor_priv; in hdcs_reset()
163 err = stv06xx_write_sensor(sd, HDCS_REG_CONTROL(sd), 1); in hdcs_reset()
167 err = stv06xx_write_sensor(sd, HDCS_REG_CONTROL(sd), 0); in hdcs_reset()
176 struct sd *sd = (struct sd *) gspca_dev; in hdcs_set_exposure() local
177 struct hdcs *hdcs = sd->sensor_priv; in hdcs_set_exposure()
206 if (IS_1020(sd)) { in hdcs_set_exposure()
225 if (IS_1020(sd)) { in hdcs_set_exposure()
238 err = stv06xx_write_sensor_bytes(sd, exp, 6); in hdcs_set_exposure()
254 err = stv06xx_write_sensor_bytes(sd, exp, 7); in hdcs_set_exposure()
263 static int hdcs_set_gains(struct sd *sd, u8 g) in hdcs_set_gains() argument
277 err = hdcs_reg_write_seq(sd, HDCS_ERECPGA, gains, 4); in hdcs_set_gains()
284 return hdcs_set_gains((struct sd *) gspca_dev, in hdcs_set_gain()
288 static int hdcs_set_size(struct sd *sd, in hdcs_set_size() argument
291 struct hdcs *hdcs = sd->sensor_priv; in hdcs_set_size()
303 if (IS_1020(sd)) { in hdcs_set_size()
326 err = hdcs_reg_write_seq(sd, HDCS_FWROW, win, 4); in hdcs_set_size()
357 static int hdcs_init_controls(struct sd *sd) in hdcs_init_controls() argument
359 struct v4l2_ctrl_handler *hdl = &sd->gspca_dev.ctrl_handler; in hdcs_init_controls()
369 static int hdcs_probe_1x00(struct sd *sd) in hdcs_probe_1x00() argument
375 ret = stv06xx_read_sensor(sd, HDCS_IDENT, &sensor); in hdcs_probe_1x00()
381 sd->gspca_dev.cam.cam_mode = hdcs1x00_mode; in hdcs_probe_1x00()
382 sd->gspca_dev.cam.nmodes = ARRAY_SIZE(hdcs1x00_mode); in hdcs_probe_1x00()
419 hdcs->psmp = (sd->bridge == BRIDGE_STV602) ? 20 : 5; in hdcs_probe_1x00()
421 sd->sensor_priv = hdcs; in hdcs_probe_1x00()
426 static int hdcs_probe_1020(struct sd *sd) in hdcs_probe_1020() argument
432 ret = stv06xx_read_sensor(sd, HDCS_IDENT, &sensor); in hdcs_probe_1020()
438 sd->gspca_dev.cam.cam_mode = hdcs1020_mode; in hdcs_probe_1020()
439 sd->gspca_dev.cam.nmodes = ARRAY_SIZE(hdcs1020_mode); in hdcs_probe_1020()
463 sd->sensor_priv = hdcs; in hdcs_probe_1020()
468 static int hdcs_start(struct sd *sd) in hdcs_start() argument
470 struct gspca_dev *gspca_dev = (struct gspca_dev *)sd; in hdcs_start()
474 return hdcs_set_state(sd, HDCS_STATE_RUN); in hdcs_start()
477 static int hdcs_stop(struct sd *sd) in hdcs_stop() argument
479 struct gspca_dev *gspca_dev = (struct gspca_dev *)sd; in hdcs_stop()
483 return hdcs_set_state(sd, HDCS_STATE_SLEEP); in hdcs_stop()
486 static int hdcs_init(struct sd *sd) in hdcs_init() argument
488 struct hdcs *hdcs = sd->sensor_priv; in hdcs_init()
492 if (sd->bridge == BRIDGE_STV602) in hdcs_init()
493 stv06xx_write_bridge(sd, STV_STV0600_EMULATION, 1); in hdcs_init()
497 err = stv06xx_write_bridge(sd, stv_bridge_init[i][0], in hdcs_init()
504 hdcs_reset(sd); in hdcs_init()
508 err = stv06xx_write_sensor(sd, stv_sensor_init[i][0], in hdcs_init()
515 err = stv06xx_write_sensor(sd, HDCS_REG_CONFIG(sd), BIT(3)); in hdcs_init()
521 if (IS_1020(sd)) in hdcs_init()
522 err = stv06xx_write_sensor(sd, HDCS_TCTRL, in hdcs_init()
525 err = stv06xx_write_sensor(sd, HDCS_TCTRL, in hdcs_init()
530 return hdcs_set_size(sd, hdcs->array.width, hdcs->array.height); in hdcs_init()
533 static int hdcs_dump(struct sd *sd) in hdcs_dump() argument
540 stv06xx_read_sensor(sd, reg, &val); in hdcs_dump()