• Home
  • Raw
  • Download

Lines Matching +full:init +full:- +full:delay

2  *  bt819 - BT819A VideoStream Decoder (Rockwell Part)
11 * - moved over to linux>=2.4.x i2c protocol (9/9/2002)
30 #include <linux/delay.h>
34 #include <media/v4l2-device.h>
35 #include <media/v4l2-ctrls.h>
38 MODULE_DESCRIPTION("Brooktree-819 video decoder driver");
44 MODULE_PARM_DESC(debug, "Debug level (0-1)");
47 /* ----------------------------------------------------------------------- */
66 return &container_of(ctrl->handler, struct bt819, hdl)->sd; in to_sd()
80 {864 - 24, 20, 625 - 2, 1, 0x0504, 0x0000},
81 {858 - 24, 20, 525 - 2, 1, 0x00f8, 0x0000},
84 /* ----------------------------------------------------------------------- */
88 struct i2c_client *client = v4l2_get_subdevdata(&decoder->sd); in bt819_write()
90 decoder->reg[reg] = value; in bt819_write()
97 (decoder->reg[reg] & ~(1 << bit)) | (value ? (1 << bit) : 0)); in bt819_setbit()
102 struct i2c_client *client = v4l2_get_subdevdata(&decoder->sd); in bt819_write_block()
103 int ret = -1; in bt819_write_block()
108 if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { in bt819_write_block()
118 decoder->reg[reg++] = data[1]; in bt819_write_block()
119 len -= 2; in bt819_write_block()
133 len -= 2; in bt819_write_block()
142 struct i2c_client *client = v4l2_get_subdevdata(&decoder->sd); in bt819_read()
149 static unsigned char init[] = { in bt819_init() local
154 0x04, 0x16, /* 0x04 Vertical Delay, lsb */ in bt819_init()
156 0x06, 0x80, /* 0x06 Horizontal Delay lsb */ in bt819_init()
178 0x18, 0x68, /* 0x18 AGC Delay */ in bt819_init()
179 0x19, 0x5d, /* 0x19 Burst Gate Delay */ in bt819_init()
184 struct timing *timing = &timing_data[(decoder->norm & V4L2_STD_525_60) ? 1 : 0]; in bt819_init()
186 init[0x03 * 2 - 1] = in bt819_init()
187 (((timing->vdelay >> 8) & 0x03) << 6) | in bt819_init()
188 (((timing->vactive >> 8) & 0x03) << 4) | in bt819_init()
189 (((timing->hdelay >> 8) & 0x03) << 2) | in bt819_init()
190 ((timing->hactive >> 8) & 0x03); in bt819_init()
191 init[0x04 * 2 - 1] = timing->vdelay & 0xff; in bt819_init()
192 init[0x05 * 2 - 1] = timing->vactive & 0xff; in bt819_init()
193 init[0x06 * 2 - 1] = timing->hdelay & 0xff; in bt819_init()
194 init[0x07 * 2 - 1] = timing->hactive & 0xff; in bt819_init()
195 init[0x08 * 2 - 1] = timing->hscale >> 8; in bt819_init()
196 init[0x09 * 2 - 1] = timing->hscale & 0xff; in bt819_init()
198 init[0x15 * 2 - 1] = (decoder->norm & V4L2_STD_625_50) ? 115 : 93; /* Chroma burst delay */ in bt819_init()
203 /* init */ in bt819_init()
204 return bt819_write_block(decoder, init, sizeof(init)); in bt819_init()
207 /* ----------------------------------------------------------------------- */
251 if (sd->v4l2_dev == NULL || sd->v4l2_dev->notify == NULL) in bt819_s_std()
275 return -EINVAL; in bt819_s_std()
278 (((timing->vdelay >> 8) & 0x03) << 6) | in bt819_s_std()
279 (((timing->vactive >> 8) & 0x03) << 4) | in bt819_s_std()
280 (((timing->hdelay >> 8) & 0x03) << 2) | in bt819_s_std()
281 ((timing->hactive >> 8) & 0x03)); in bt819_s_std()
282 bt819_write(decoder, 0x04, timing->vdelay & 0xff); in bt819_s_std()
283 bt819_write(decoder, 0x05, timing->vactive & 0xff); in bt819_s_std()
284 bt819_write(decoder, 0x06, timing->hdelay & 0xff); in bt819_s_std()
285 bt819_write(decoder, 0x07, timing->hactive & 0xff); in bt819_s_std()
286 bt819_write(decoder, 0x08, (timing->hscale >> 8) & 0xff); in bt819_s_std()
287 bt819_write(decoder, 0x09, timing->hscale & 0xff); in bt819_s_std()
288 decoder->norm = std; in bt819_s_std()
301 return -EINVAL; in bt819_s_routing()
303 if (sd->v4l2_dev == NULL || sd->v4l2_dev->notify == NULL) in bt819_s_routing()
306 if (decoder->input != input) { in bt819_s_routing()
308 decoder->input = input; in bt819_s_routing()
310 if (decoder->input == 0) { in bt819_s_routing()
328 if (decoder->enable != enable) { in bt819_s_stream()
329 decoder->enable = enable; in bt819_s_stream()
341 switch (ctrl->id) { in bt819_s_ctrl()
343 bt819_write(decoder, 0x0a, ctrl->val); in bt819_s_ctrl()
347 bt819_write(decoder, 0x0c, ctrl->val & 0xff); in bt819_s_ctrl()
348 bt819_setbit(decoder, 0x0b, 2, ((ctrl->val >> 8) & 0x01)); in bt819_s_ctrl()
352 bt819_write(decoder, 0x0d, (ctrl->val >> 7) & 0xff); in bt819_s_ctrl()
353 bt819_setbit(decoder, 0x0b, 1, ((ctrl->val >> 15) & 0x01)); in bt819_s_ctrl()
357 temp = (ctrl->val * 180) / 254; in bt819_s_ctrl()
363 bt819_write(decoder, 0x0f, ctrl->val); in bt819_s_ctrl()
367 return -EINVAL; in bt819_s_ctrl()
372 /* ----------------------------------------------------------------------- */
390 /* ----------------------------------------------------------------------- */
401 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) in bt819_probe()
402 return -ENODEV; in bt819_probe()
404 decoder = devm_kzalloc(&client->dev, sizeof(*decoder), GFP_KERNEL); in bt819_probe()
406 return -ENOMEM; in bt819_probe()
407 sd = &decoder->sd; in bt819_probe()
424 return -ENODEV; in bt819_probe()
428 client->addr << 1, client->adapter->name); in bt819_probe()
430 decoder->norm = V4L2_STD_NTSC; in bt819_probe()
431 decoder->input = 0; in bt819_probe()
432 decoder->enable = 1; in bt819_probe()
436 v4l2_dbg(1, debug, sd, "init status %d\n", i); in bt819_probe()
438 v4l2_ctrl_handler_init(&decoder->hdl, 4); in bt819_probe()
439 v4l2_ctrl_new_std(&decoder->hdl, &bt819_ctrl_ops, in bt819_probe()
440 V4L2_CID_BRIGHTNESS, -128, 127, 1, 0); in bt819_probe()
441 v4l2_ctrl_new_std(&decoder->hdl, &bt819_ctrl_ops, in bt819_probe()
443 v4l2_ctrl_new_std(&decoder->hdl, &bt819_ctrl_ops, in bt819_probe()
445 v4l2_ctrl_new_std(&decoder->hdl, &bt819_ctrl_ops, in bt819_probe()
446 V4L2_CID_HUE, -128, 127, 1, 0); in bt819_probe()
447 sd->ctrl_handler = &decoder->hdl; in bt819_probe()
448 if (decoder->hdl.error) { in bt819_probe()
449 int err = decoder->hdl.error; in bt819_probe()
451 v4l2_ctrl_handler_free(&decoder->hdl); in bt819_probe()
454 v4l2_ctrl_handler_setup(&decoder->hdl); in bt819_probe()
464 v4l2_ctrl_handler_free(&decoder->hdl); in bt819_remove()
468 /* ----------------------------------------------------------------------- */