Lines Matching defs:decoder
44 MODULE_DESCRIPTION("Brooktree-819 video decoder driver");
91 static inline int bt819_write(struct bt819 *decoder, u8 reg, u8 value)
93 struct i2c_client *client = v4l2_get_subdevdata(&decoder->sd);
95 decoder->reg[reg] = value;
99 static inline int bt819_setbit(struct bt819 *decoder, u8 reg, u8 bit, u8 value)
101 return bt819_write(decoder, reg,
102 (decoder->reg[reg] & ~(1 << bit)) | (value ? (1 << bit) : 0));
105 static int bt819_write_block(struct bt819 *decoder, const u8 *data, unsigned int len)
107 struct i2c_client *client = v4l2_get_subdevdata(&decoder->sd);
123 decoder->reg[reg++] = data[1];
135 ret = bt819_write(decoder, reg, *data++);
145 static inline int bt819_read(struct bt819 *decoder, u8 reg)
147 struct i2c_client *client = v4l2_get_subdevdata(&decoder->sd);
188 struct bt819 *decoder = to_bt819(sd);
189 struct timing *timing = &timing_data[(decoder->norm & V4L2_STD_525_60) ? 1 : 0];
203 init[0x15 * 2 - 1] = (decoder->norm & V4L2_STD_625_50) ? 115 : 93; /* Chroma burst delay */
205 bt819_write(decoder, 0x1f, 0x00);
209 return bt819_write_block(decoder, init, sizeof(init));
216 struct bt819 *decoder = to_bt819(sd);
217 int status = bt819_read(decoder, 0x00);
249 struct bt819 *decoder = to_bt819(sd);
259 bt819_setbit(decoder, 0x01, 0, 1);
260 bt819_setbit(decoder, 0x01, 1, 0);
261 bt819_setbit(decoder, 0x01, 5, 0);
262 bt819_write(decoder, 0x18, 0x68);
263 bt819_write(decoder, 0x19, 0x5d);
264 /* bt819_setbit(decoder, 0x1a, 5, 1); */
268 bt819_setbit(decoder, 0x01, 0, 1);
269 bt819_setbit(decoder, 0x01, 1, 1);
270 bt819_setbit(decoder, 0x01, 5, 1);
271 bt819_write(decoder, 0x18, 0x7f);
272 bt819_write(decoder, 0x19, 0x72);
273 /* bt819_setbit(decoder, 0x1a, 5, 0); */
280 bt819_write(decoder, 0x03,
285 bt819_write(decoder, 0x04, timing->vdelay & 0xff);
286 bt819_write(decoder, 0x05, timing->vactive & 0xff);
287 bt819_write(decoder, 0x06, timing->hdelay & 0xff);
288 bt819_write(decoder, 0x07, timing->hactive & 0xff);
289 bt819_write(decoder, 0x08, (timing->hscale >> 8) & 0xff);
290 bt819_write(decoder, 0x09, timing->hscale & 0xff);
291 decoder->norm = std;
299 struct bt819 *decoder = to_bt819(sd);
309 if (decoder->input != input) {
311 decoder->input = input;
313 if (decoder->input == 0) {
314 bt819_setbit(decoder, 0x0b, 6, 0);
315 bt819_setbit(decoder, 0x1a, 1, 1);
317 bt819_setbit(decoder, 0x0b, 6, 1);
318 bt819_setbit(decoder, 0x1a, 1, 0);
327 struct bt819 *decoder = to_bt819(sd);
331 if (decoder->enable != enable) {
332 decoder->enable = enable;
333 bt819_setbit(decoder, 0x16, 7, !enable);
365 struct bt819 *decoder = to_bt819(sd);
370 if (decoder->bright == ctrl->value)
372 decoder->bright = ctrl->value;
373 bt819_write(decoder, 0x0a, decoder->bright);
377 if (decoder->contrast == ctrl->value)
379 decoder->contrast = ctrl->value;
380 bt819_write(decoder, 0x0c, decoder->contrast & 0xff);
381 bt819_setbit(decoder, 0x0b, 2, ((decoder->contrast >> 8) & 0x01));
385 if (decoder->sat == ctrl->value)
387 decoder->sat = ctrl->value;
388 bt819_write(decoder, 0x0d, (decoder->sat >> 7) & 0xff);
389 bt819_setbit(decoder, 0x0b, 1, ((decoder->sat >> 15) & 0x01));
393 temp = (decoder->sat * 180) / 254;
394 bt819_write(decoder, 0x0e, (temp >> 7) & 0xff);
395 bt819_setbit(decoder, 0x0b, 0, (temp >> 15) & 0x01);
399 if (decoder->hue == ctrl->value)
401 decoder->hue = ctrl->value;
402 bt819_write(decoder, 0x0f, decoder->hue);
413 struct bt819 *decoder = to_bt819(sd);
417 ctrl->value = decoder->bright;
420 ctrl->value = decoder->contrast;
423 ctrl->value = decoder->sat;
426 ctrl->value = decoder->hue;
436 struct bt819 *decoder = to_bt819(sd);
439 return v4l2_chip_ident_i2c_client(client, chip, decoder->ident, 0);
470 struct bt819 *decoder;
478 decoder = kzalloc(sizeof(struct bt819), GFP_KERNEL);
479 if (decoder == NULL)
481 sd = &decoder->sd;
484 ver = bt819_read(decoder, 0x17);
488 decoder->ident = V4L2_IDENT_BT819A;
492 decoder->ident = V4L2_IDENT_BT817A;
496 decoder->ident = V4L2_IDENT_BT815A;
507 decoder->norm = V4L2_STD_NTSC;
508 decoder->input = 0;
509 decoder->enable = 1;
510 decoder->bright = 0;
511 decoder->contrast = 0xd8; /* 100% of original signal */
512 decoder->hue = 0;
513 decoder->sat = 0xfe; /* 100% of original signal */