Lines Matching full:decoder

2  *  bt819 - BT819A VideoStream Decoder (Rockwell Part)
43 MODULE_DESCRIPTION("Brooktree-819 video decoder driver");
92 static inline int bt819_write(struct bt819 *decoder, u8 reg, u8 value) in bt819_write() argument
94 struct i2c_client *client = v4l2_get_subdevdata(&decoder->sd); in bt819_write()
96 decoder->reg[reg] = value; in bt819_write()
100 static inline int bt819_setbit(struct bt819 *decoder, u8 reg, u8 bit, u8 value) in bt819_setbit() argument
102 return bt819_write(decoder, reg, in bt819_setbit()
103 (decoder->reg[reg] & ~(1 << bit)) | (value ? (1 << bit) : 0)); in bt819_setbit()
106 static int bt819_write_block(struct bt819 *decoder, const u8 *data, unsigned int len) in bt819_write_block() argument
108 struct i2c_client *client = v4l2_get_subdevdata(&decoder->sd); in bt819_write_block()
124 decoder->reg[reg++] = data[1]; in bt819_write_block()
136 ret = bt819_write(decoder, reg, *data++); in bt819_write_block()
146 static inline int bt819_read(struct bt819 *decoder, u8 reg) in bt819_read() argument
148 struct i2c_client *client = v4l2_get_subdevdata(&decoder->sd); in bt819_read()
189 struct bt819 *decoder = to_bt819(sd); in bt819_init() local
190 struct timing *timing = &timing_data[(decoder->norm & V4L2_STD_525_60) ? 1 : 0]; in bt819_init()
204 init[0x15 * 2 - 1] = (decoder->norm & V4L2_STD_625_50) ? 115 : 93; /* Chroma burst delay */ in bt819_init()
206 bt819_write(decoder, 0x1f, 0x00); in bt819_init()
210 return bt819_write_block(decoder, init, sizeof(init)); in bt819_init()
217 struct bt819 *decoder = to_bt819(sd); in bt819_status() local
218 int status = bt819_read(decoder, 0x00); in bt819_status()
250 struct bt819 *decoder = to_bt819(sd); in bt819_s_std() local
260 bt819_setbit(decoder, 0x01, 0, 1); in bt819_s_std()
261 bt819_setbit(decoder, 0x01, 1, 0); in bt819_s_std()
262 bt819_setbit(decoder, 0x01, 5, 0); in bt819_s_std()
263 bt819_write(decoder, 0x18, 0x68); in bt819_s_std()
264 bt819_write(decoder, 0x19, 0x5d); in bt819_s_std()
265 /* bt819_setbit(decoder, 0x1a, 5, 1); */ in bt819_s_std()
269 bt819_setbit(decoder, 0x01, 0, 1); in bt819_s_std()
270 bt819_setbit(decoder, 0x01, 1, 1); in bt819_s_std()
271 bt819_setbit(decoder, 0x01, 5, 1); in bt819_s_std()
272 bt819_write(decoder, 0x18, 0x7f); in bt819_s_std()
273 bt819_write(decoder, 0x19, 0x72); in bt819_s_std()
274 /* bt819_setbit(decoder, 0x1a, 5, 0); */ in bt819_s_std()
281 bt819_write(decoder, 0x03, in bt819_s_std()
286 bt819_write(decoder, 0x04, timing->vdelay & 0xff); in bt819_s_std()
287 bt819_write(decoder, 0x05, timing->vactive & 0xff); in bt819_s_std()
288 bt819_write(decoder, 0x06, timing->hdelay & 0xff); in bt819_s_std()
289 bt819_write(decoder, 0x07, timing->hactive & 0xff); in bt819_s_std()
290 bt819_write(decoder, 0x08, (timing->hscale >> 8) & 0xff); in bt819_s_std()
291 bt819_write(decoder, 0x09, timing->hscale & 0xff); in bt819_s_std()
292 decoder->norm = std; in bt819_s_std()
300 struct bt819 *decoder = to_bt819(sd); in bt819_s_routing() local
310 if (decoder->input != input) { in bt819_s_routing()
312 decoder->input = input; in bt819_s_routing()
314 if (decoder->input == 0) { in bt819_s_routing()
315 bt819_setbit(decoder, 0x0b, 6, 0); in bt819_s_routing()
316 bt819_setbit(decoder, 0x1a, 1, 1); in bt819_s_routing()
318 bt819_setbit(decoder, 0x0b, 6, 1); in bt819_s_routing()
319 bt819_setbit(decoder, 0x1a, 1, 0); in bt819_s_routing()
328 struct bt819 *decoder = to_bt819(sd); in bt819_s_stream() local
332 if (decoder->enable != enable) { in bt819_s_stream()
333 decoder->enable = enable; in bt819_s_stream()
334 bt819_setbit(decoder, 0x16, 7, !enable); in bt819_s_stream()
342 struct bt819 *decoder = to_bt819(sd); in bt819_s_ctrl() local
347 bt819_write(decoder, 0x0a, ctrl->val); in bt819_s_ctrl()
351 bt819_write(decoder, 0x0c, ctrl->val & 0xff); in bt819_s_ctrl()
352 bt819_setbit(decoder, 0x0b, 2, ((ctrl->val >> 8) & 0x01)); in bt819_s_ctrl()
356 bt819_write(decoder, 0x0d, (ctrl->val >> 7) & 0xff); in bt819_s_ctrl()
357 bt819_setbit(decoder, 0x0b, 1, ((ctrl->val >> 15) & 0x01)); in bt819_s_ctrl()
362 bt819_write(decoder, 0x0e, (temp >> 7) & 0xff); in bt819_s_ctrl()
363 bt819_setbit(decoder, 0x0b, 0, (temp >> 15) & 0x01); in bt819_s_ctrl()
367 bt819_write(decoder, 0x0f, ctrl->val); in bt819_s_ctrl()
378 struct bt819 *decoder = to_bt819(sd); in bt819_g_chip_ident() local
381 return v4l2_chip_ident_i2c_client(client, chip, decoder->ident, 0); in bt819_g_chip_ident()
420 struct bt819 *decoder; in bt819_probe() local
428 decoder = kzalloc(sizeof(struct bt819), GFP_KERNEL); in bt819_probe()
429 if (decoder == NULL) in bt819_probe()
431 sd = &decoder->sd; in bt819_probe()
434 ver = bt819_read(decoder, 0x17); in bt819_probe()
438 decoder->ident = V4L2_IDENT_BT819A; in bt819_probe()
442 decoder->ident = V4L2_IDENT_BT817A; in bt819_probe()
446 decoder->ident = V4L2_IDENT_BT815A; in bt819_probe()
457 decoder->norm = V4L2_STD_NTSC; in bt819_probe()
458 decoder->input = 0; in bt819_probe()
459 decoder->enable = 1; in bt819_probe()
465 v4l2_ctrl_handler_init(&decoder->hdl, 4); in bt819_probe()
466 v4l2_ctrl_new_std(&decoder->hdl, &bt819_ctrl_ops, in bt819_probe()
468 v4l2_ctrl_new_std(&decoder->hdl, &bt819_ctrl_ops, in bt819_probe()
470 v4l2_ctrl_new_std(&decoder->hdl, &bt819_ctrl_ops, in bt819_probe()
472 v4l2_ctrl_new_std(&decoder->hdl, &bt819_ctrl_ops, in bt819_probe()
474 sd->ctrl_handler = &decoder->hdl; in bt819_probe()
475 if (decoder->hdl.error) { in bt819_probe()
476 int err = decoder->hdl.error; in bt819_probe()
478 v4l2_ctrl_handler_free(&decoder->hdl); in bt819_probe()
479 kfree(decoder); in bt819_probe()
482 v4l2_ctrl_handler_setup(&decoder->hdl); in bt819_probe()
489 struct bt819 *decoder = to_bt819(sd); in bt819_remove() local
492 v4l2_ctrl_handler_free(&decoder->hdl); in bt819_remove()
493 kfree(decoder); in bt819_remove()