Lines Matching full:decoder
3 * bt819 - BT819A VideoStream Decoder (Rockwell Part)
29 MODULE_DESCRIPTION("Brooktree-819 video decoder driver");
77 static inline int bt819_write(struct bt819 *decoder, u8 reg, u8 value) in bt819_write() argument
79 struct i2c_client *client = v4l2_get_subdevdata(&decoder->sd); in bt819_write()
81 decoder->reg[reg] = value; in bt819_write()
85 static inline int bt819_setbit(struct bt819 *decoder, u8 reg, u8 bit, u8 value) in bt819_setbit() argument
87 return bt819_write(decoder, reg, in bt819_setbit()
88 (decoder->reg[reg] & ~(1 << bit)) | (value ? (1 << bit) : 0)); in bt819_setbit()
91 static int bt819_write_block(struct bt819 *decoder, const u8 *data, unsigned int len) in bt819_write_block() argument
93 struct i2c_client *client = v4l2_get_subdevdata(&decoder->sd); in bt819_write_block()
109 decoder->reg[reg++] = data[1]; in bt819_write_block()
121 ret = bt819_write(decoder, reg, *data++); in bt819_write_block()
131 static inline int bt819_read(struct bt819 *decoder, u8 reg) in bt819_read() argument
133 struct i2c_client *client = v4l2_get_subdevdata(&decoder->sd); in bt819_read()
174 struct bt819 *decoder = to_bt819(sd); in bt819_init() local
175 struct timing *timing = &timing_data[(decoder->norm & V4L2_STD_525_60) ? 1 : 0]; in bt819_init()
189 init[0x15 * 2 - 1] = (decoder->norm & V4L2_STD_625_50) ? 115 : 93; /* Chroma burst delay */ in bt819_init()
191 bt819_write(decoder, 0x1f, 0x00); in bt819_init()
195 return bt819_write_block(decoder, init, sizeof(init)); in bt819_init()
202 struct bt819 *decoder = to_bt819(sd); in bt819_status() local
203 int status = bt819_read(decoder, 0x00); in bt819_status()
237 struct bt819 *decoder = to_bt819(sd); in bt819_s_std() local
247 bt819_setbit(decoder, 0x01, 0, 1); in bt819_s_std()
248 bt819_setbit(decoder, 0x01, 1, 0); in bt819_s_std()
249 bt819_setbit(decoder, 0x01, 5, 0); in bt819_s_std()
250 bt819_write(decoder, 0x18, 0x68); in bt819_s_std()
251 bt819_write(decoder, 0x19, 0x5d); in bt819_s_std()
252 /* bt819_setbit(decoder, 0x1a, 5, 1); */ in bt819_s_std()
256 bt819_setbit(decoder, 0x01, 0, 1); in bt819_s_std()
257 bt819_setbit(decoder, 0x01, 1, 1); in bt819_s_std()
258 bt819_setbit(decoder, 0x01, 5, 1); in bt819_s_std()
259 bt819_write(decoder, 0x18, 0x7f); in bt819_s_std()
260 bt819_write(decoder, 0x19, 0x72); in bt819_s_std()
261 /* bt819_setbit(decoder, 0x1a, 5, 0); */ in bt819_s_std()
268 bt819_write(decoder, 0x03, in bt819_s_std()
273 bt819_write(decoder, 0x04, timing->vdelay & 0xff); in bt819_s_std()
274 bt819_write(decoder, 0x05, timing->vactive & 0xff); in bt819_s_std()
275 bt819_write(decoder, 0x06, timing->hdelay & 0xff); in bt819_s_std()
276 bt819_write(decoder, 0x07, timing->hactive & 0xff); in bt819_s_std()
277 bt819_write(decoder, 0x08, (timing->hscale >> 8) & 0xff); in bt819_s_std()
278 bt819_write(decoder, 0x09, timing->hscale & 0xff); in bt819_s_std()
279 decoder->norm = std; in bt819_s_std()
287 struct bt819 *decoder = to_bt819(sd); in bt819_s_routing() local
297 if (decoder->input != input) { in bt819_s_routing()
299 decoder->input = input; in bt819_s_routing()
301 if (decoder->input == 0) { in bt819_s_routing()
302 bt819_setbit(decoder, 0x0b, 6, 0); in bt819_s_routing()
303 bt819_setbit(decoder, 0x1a, 1, 1); in bt819_s_routing()
305 bt819_setbit(decoder, 0x0b, 6, 1); in bt819_s_routing()
306 bt819_setbit(decoder, 0x1a, 1, 0); in bt819_s_routing()
315 struct bt819 *decoder = to_bt819(sd); in bt819_s_stream() local
319 if (decoder->enable != enable) { in bt819_s_stream()
320 decoder->enable = enable; in bt819_s_stream()
321 bt819_setbit(decoder, 0x16, 7, !enable); in bt819_s_stream()
329 struct bt819 *decoder = to_bt819(sd); in bt819_s_ctrl() local
334 bt819_write(decoder, 0x0a, ctrl->val); in bt819_s_ctrl()
338 bt819_write(decoder, 0x0c, ctrl->val & 0xff); in bt819_s_ctrl()
339 bt819_setbit(decoder, 0x0b, 2, ((ctrl->val >> 8) & 0x01)); in bt819_s_ctrl()
343 bt819_write(decoder, 0x0d, (ctrl->val >> 7) & 0xff); in bt819_s_ctrl()
344 bt819_setbit(decoder, 0x0b, 1, ((ctrl->val >> 15) & 0x01)); in bt819_s_ctrl()
349 bt819_write(decoder, 0x0e, (temp >> 7) & 0xff); in bt819_s_ctrl()
350 bt819_setbit(decoder, 0x0b, 0, (temp >> 15) & 0x01); in bt819_s_ctrl()
354 bt819_write(decoder, 0x0f, ctrl->val); in bt819_s_ctrl()
386 struct bt819 *decoder; in bt819_probe() local
394 decoder = devm_kzalloc(&client->dev, sizeof(*decoder), GFP_KERNEL); in bt819_probe()
395 if (decoder == NULL) in bt819_probe()
397 sd = &decoder->sd; in bt819_probe()
400 ver = bt819_read(decoder, 0x17); in bt819_probe()
420 decoder->norm = V4L2_STD_NTSC; in bt819_probe()
421 decoder->input = 0; in bt819_probe()
422 decoder->enable = 1; in bt819_probe()
428 v4l2_ctrl_handler_init(&decoder->hdl, 4); in bt819_probe()
429 v4l2_ctrl_new_std(&decoder->hdl, &bt819_ctrl_ops, in bt819_probe()
431 v4l2_ctrl_new_std(&decoder->hdl, &bt819_ctrl_ops, in bt819_probe()
433 v4l2_ctrl_new_std(&decoder->hdl, &bt819_ctrl_ops, in bt819_probe()
435 v4l2_ctrl_new_std(&decoder->hdl, &bt819_ctrl_ops, in bt819_probe()
437 sd->ctrl_handler = &decoder->hdl; in bt819_probe()
438 if (decoder->hdl.error) { in bt819_probe()
439 int err = decoder->hdl.error; in bt819_probe()
441 v4l2_ctrl_handler_free(&decoder->hdl); in bt819_probe()
444 v4l2_ctrl_handler_setup(&decoder->hdl); in bt819_probe()
451 struct bt819 *decoder = to_bt819(sd); in bt819_remove() local
454 v4l2_ctrl_handler_free(&decoder->hdl); in bt819_remove()