Lines Matching refs:decoder

90 static inline int bt819_write(struct bt819 *decoder, u8 reg, u8 value)  in bt819_write()  argument
92 struct i2c_client *client = v4l2_get_subdevdata(&decoder->sd); in bt819_write()
94 decoder->reg[reg] = value; in bt819_write()
98 static inline int bt819_setbit(struct bt819 *decoder, u8 reg, u8 bit, u8 value) in bt819_setbit() argument
100 return bt819_write(decoder, reg, in bt819_setbit()
101 (decoder->reg[reg] & ~(1 << bit)) | (value ? (1 << bit) : 0)); in bt819_setbit()
104 static int bt819_write_block(struct bt819 *decoder, const u8 *data, unsigned int len) in bt819_write_block() argument
106 struct i2c_client *client = v4l2_get_subdevdata(&decoder->sd); in bt819_write_block()
122 decoder->reg[reg++] = data[1]; in bt819_write_block()
134 ret = bt819_write(decoder, reg, *data++); in bt819_write_block()
144 static inline int bt819_read(struct bt819 *decoder, u8 reg) in bt819_read() argument
146 struct i2c_client *client = v4l2_get_subdevdata(&decoder->sd); in bt819_read()
187 struct bt819 *decoder = to_bt819(sd); in bt819_init() local
188 struct timing *timing = &timing_data[(decoder->norm & V4L2_STD_525_60) ? 1 : 0]; in bt819_init()
202 init[0x15 * 2 - 1] = (decoder->norm & V4L2_STD_625_50) ? 115 : 93; /* Chroma burst delay */ in bt819_init()
204 bt819_write(decoder, 0x1f, 0x00); in bt819_init()
208 return bt819_write_block(decoder, init, sizeof(init)); in bt819_init()
215 struct bt819 *decoder = to_bt819(sd); in bt819_status() local
216 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()
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()
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()
411 struct bt819 *decoder; in bt819_probe() local
419 decoder = devm_kzalloc(&client->dev, sizeof(*decoder), GFP_KERNEL); in bt819_probe()
420 if (decoder == NULL) in bt819_probe()
422 sd = &decoder->sd; in bt819_probe()
425 ver = bt819_read(decoder, 0x17); in bt819_probe()
445 decoder->norm = V4L2_STD_NTSC; in bt819_probe()
446 decoder->input = 0; in bt819_probe()
447 decoder->enable = 1; in bt819_probe()
453 v4l2_ctrl_handler_init(&decoder->hdl, 4); in bt819_probe()
454 v4l2_ctrl_new_std(&decoder->hdl, &bt819_ctrl_ops, in bt819_probe()
456 v4l2_ctrl_new_std(&decoder->hdl, &bt819_ctrl_ops, in bt819_probe()
458 v4l2_ctrl_new_std(&decoder->hdl, &bt819_ctrl_ops, in bt819_probe()
460 v4l2_ctrl_new_std(&decoder->hdl, &bt819_ctrl_ops, in bt819_probe()
462 sd->ctrl_handler = &decoder->hdl; in bt819_probe()
463 if (decoder->hdl.error) { in bt819_probe()
464 int err = decoder->hdl.error; in bt819_probe()
466 v4l2_ctrl_handler_free(&decoder->hdl); in bt819_probe()
469 v4l2_ctrl_handler_setup(&decoder->hdl); in bt819_probe()
476 struct bt819 *decoder = to_bt819(sd); in bt819_remove() local
479 v4l2_ctrl_handler_free(&decoder->hdl); in bt819_remove()