Lines Matching refs:decoder

86 static inline int bt819_write(struct bt819 *decoder, u8 reg, u8 value)  in bt819_write()  argument
88 struct i2c_client *client = v4l2_get_subdevdata(&decoder->sd); in bt819_write()
90 decoder->reg[reg] = value; in bt819_write()
94 static inline int bt819_setbit(struct bt819 *decoder, u8 reg, u8 bit, u8 value) in bt819_setbit() argument
96 return bt819_write(decoder, reg, in bt819_setbit()
97 (decoder->reg[reg] & ~(1 << bit)) | (value ? (1 << bit) : 0)); in bt819_setbit()
100 static int bt819_write_block(struct bt819 *decoder, const u8 *data, unsigned int len) in bt819_write_block() argument
102 struct i2c_client *client = v4l2_get_subdevdata(&decoder->sd); in bt819_write_block()
118 decoder->reg[reg++] = data[1]; in bt819_write_block()
130 ret = bt819_write(decoder, reg, *data++); in bt819_write_block()
140 static inline int bt819_read(struct bt819 *decoder, u8 reg) in bt819_read() argument
142 struct i2c_client *client = v4l2_get_subdevdata(&decoder->sd); in bt819_read()
183 struct bt819 *decoder = to_bt819(sd); in bt819_init() local
184 struct timing *timing = &timing_data[(decoder->norm & V4L2_STD_525_60) ? 1 : 0]; in bt819_init()
198 init[0x15 * 2 - 1] = (decoder->norm & V4L2_STD_625_50) ? 115 : 93; /* Chroma burst delay */ in bt819_init()
200 bt819_write(decoder, 0x1f, 0x00); in bt819_init()
204 return bt819_write_block(decoder, init, sizeof(init)); in bt819_init()
211 struct bt819 *decoder = to_bt819(sd); in bt819_status() local
212 int status = bt819_read(decoder, 0x00); in bt819_status()
246 struct bt819 *decoder = to_bt819(sd); in bt819_s_std() local
256 bt819_setbit(decoder, 0x01, 0, 1); in bt819_s_std()
257 bt819_setbit(decoder, 0x01, 1, 0); in bt819_s_std()
258 bt819_setbit(decoder, 0x01, 5, 0); in bt819_s_std()
259 bt819_write(decoder, 0x18, 0x68); in bt819_s_std()
260 bt819_write(decoder, 0x19, 0x5d); in bt819_s_std()
265 bt819_setbit(decoder, 0x01, 0, 1); in bt819_s_std()
266 bt819_setbit(decoder, 0x01, 1, 1); in bt819_s_std()
267 bt819_setbit(decoder, 0x01, 5, 1); in bt819_s_std()
268 bt819_write(decoder, 0x18, 0x7f); in bt819_s_std()
269 bt819_write(decoder, 0x19, 0x72); in bt819_s_std()
277 bt819_write(decoder, 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()
296 struct bt819 *decoder = to_bt819(sd); in bt819_s_routing() local
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()
311 bt819_setbit(decoder, 0x0b, 6, 0); in bt819_s_routing()
312 bt819_setbit(decoder, 0x1a, 1, 1); in bt819_s_routing()
314 bt819_setbit(decoder, 0x0b, 6, 1); in bt819_s_routing()
315 bt819_setbit(decoder, 0x1a, 1, 0); in bt819_s_routing()
324 struct bt819 *decoder = to_bt819(sd); in bt819_s_stream() local
328 if (decoder->enable != enable) { in bt819_s_stream()
329 decoder->enable = enable; in bt819_s_stream()
330 bt819_setbit(decoder, 0x16, 7, !enable); in bt819_s_stream()
338 struct bt819 *decoder = to_bt819(sd); in bt819_s_ctrl() local
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()
358 bt819_write(decoder, 0x0e, (temp >> 7) & 0xff); in bt819_s_ctrl()
359 bt819_setbit(decoder, 0x0b, 0, (temp >> 15) & 0x01); in bt819_s_ctrl()
363 bt819_write(decoder, 0x0f, ctrl->val); in bt819_s_ctrl()
396 struct bt819 *decoder; in bt819_probe() local
404 decoder = devm_kzalloc(&client->dev, sizeof(*decoder), GFP_KERNEL); in bt819_probe()
405 if (decoder == NULL) in bt819_probe()
407 sd = &decoder->sd; in bt819_probe()
410 ver = bt819_read(decoder, 0x17); 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()
438 v4l2_ctrl_handler_init(&decoder->hdl, 4); in bt819_probe()
439 v4l2_ctrl_new_std(&decoder->hdl, &bt819_ctrl_ops, 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()
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()
461 struct bt819 *decoder = to_bt819(sd); in bt819_remove() local
464 v4l2_ctrl_handler_free(&decoder->hdl); in bt819_remove()