aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/pt1/va1j5jf8007t.c
diff options
context:
space:
mode:
authorHIRANO Takahito <hiranotaka@zng.info>2010-04-07 10:48:48 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-19 11:57:32 -0400
commit4d1f413e820c7e1402475eea254e2bc82d98de35 (patch)
tree206e8f18587cb7bdd0cc5713df4c612a0a437363 /drivers/media/dvb/pt1/va1j5jf8007t.c
parent2f7908848642c177b16b71a2ed52b57d614637ef (diff)
V4L/DVB: pt1: Support Earthsoft PT2
Support Earthsoft PT2. Signed-off-by: HIRANO Takahito <hiranotaka@zng.info> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/pt1/va1j5jf8007t.c')
-rw-r--r--drivers/media/dvb/pt1/va1j5jf8007t.c31
1 files changed, 26 insertions, 5 deletions
diff --git a/drivers/media/dvb/pt1/va1j5jf8007t.c b/drivers/media/dvb/pt1/va1j5jf8007t.c
index 3db4f3e34e8f..0f085c3e571b 100644
--- a/drivers/media/dvb/pt1/va1j5jf8007t.c
+++ b/drivers/media/dvb/pt1/va1j5jf8007t.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * ISDB-T driver for VA1J5JF8007 2 * ISDB-T driver for VA1J5JF8007/VA1J5JF8011
3 * 3 *
4 * Copyright (C) 2009 HIRANO Takahito <hiranotaka@zng.info> 4 * Copyright (C) 2009 HIRANO Takahito <hiranotaka@zng.info>
5 * 5 *
@@ -429,7 +429,7 @@ static void va1j5jf8007t_release(struct dvb_frontend *fe)
429 429
430static struct dvb_frontend_ops va1j5jf8007t_ops = { 430static struct dvb_frontend_ops va1j5jf8007t_ops = {
431 .info = { 431 .info = {
432 .name = "VA1J5JF8007 ISDB-T", 432 .name = "VA1J5JF8007/VA1J5JF8011 ISDB-T",
433 .type = FE_OFDM, 433 .type = FE_OFDM,
434 .frequency_min = 90000000, 434 .frequency_min = 90000000,
435 .frequency_max = 770000000, 435 .frequency_max = 770000000,
@@ -448,29 +448,50 @@ static struct dvb_frontend_ops va1j5jf8007t_ops = {
448 .release = va1j5jf8007t_release, 448 .release = va1j5jf8007t_release,
449}; 449};
450 450
451static const u8 va1j5jf8007t_prepare_bufs[][2] = { 451static const u8 va1j5jf8007t_20mhz_prepare_bufs[][2] = {
452 {0x03, 0x90}, {0x14, 0x8f}, {0x1c, 0x2a}, {0x1d, 0xa8}, {0x1e, 0xa2}, 452 {0x03, 0x90}, {0x14, 0x8f}, {0x1c, 0x2a}, {0x1d, 0xa8}, {0x1e, 0xa2},
453 {0x22, 0x83}, {0x31, 0x0d}, {0x32, 0xe0}, {0x39, 0xd3}, {0x3a, 0x00}, 453 {0x22, 0x83}, {0x31, 0x0d}, {0x32, 0xe0}, {0x39, 0xd3}, {0x3a, 0x00},
454 {0x5c, 0x40}, {0x5f, 0x80}, {0x75, 0x02}, {0x76, 0x4e}, {0x77, 0x03}, 454 {0x5c, 0x40}, {0x5f, 0x80}, {0x75, 0x02}, {0x76, 0x4e}, {0x77, 0x03},
455 {0xef, 0x01} 455 {0xef, 0x01}
456}; 456};
457 457
458static const u8 va1j5jf8007t_25mhz_prepare_bufs[][2] = {
459 {0x03, 0x90}, {0x1c, 0x2a}, {0x1d, 0xa8}, {0x1e, 0xa2}, {0x22, 0x83},
460 {0x3a, 0x00}, {0x5c, 0x40}, {0x5f, 0x80}, {0x75, 0x0a}, {0x76, 0x4c},
461 {0x77, 0x03}, {0xef, 0x01}
462};
463
458int va1j5jf8007t_prepare(struct dvb_frontend *fe) 464int va1j5jf8007t_prepare(struct dvb_frontend *fe)
459{ 465{
460 struct va1j5jf8007t_state *state; 466 struct va1j5jf8007t_state *state;
467 const u8 (*bufs)[2];
468 int size;
461 u8 buf[2]; 469 u8 buf[2];
462 struct i2c_msg msg; 470 struct i2c_msg msg;
463 int i; 471 int i;
464 472
465 state = fe->demodulator_priv; 473 state = fe->demodulator_priv;
466 474
475 switch (state->config->frequency) {
476 case VA1J5JF8007T_20MHZ:
477 bufs = va1j5jf8007t_20mhz_prepare_bufs;
478 size = ARRAY_SIZE(va1j5jf8007t_20mhz_prepare_bufs);
479 break;
480 case VA1J5JF8007T_25MHZ:
481 bufs = va1j5jf8007t_25mhz_prepare_bufs;
482 size = ARRAY_SIZE(va1j5jf8007t_25mhz_prepare_bufs);
483 break;
484 default:
485 return -EINVAL;
486 }
487
467 msg.addr = state->config->demod_address; 488 msg.addr = state->config->demod_address;
468 msg.flags = 0; 489 msg.flags = 0;
469 msg.len = sizeof(buf); 490 msg.len = sizeof(buf);
470 msg.buf = buf; 491 msg.buf = buf;
471 492
472 for (i = 0; i < ARRAY_SIZE(va1j5jf8007t_prepare_bufs); i++) { 493 for (i = 0; i < size; i++) {
473 memcpy(buf, va1j5jf8007t_prepare_bufs[i], sizeof(buf)); 494 memcpy(buf, bufs[i], sizeof(buf));
474 if (i2c_transfer(state->adap, &msg, 1) != 1) 495 if (i2c_transfer(state->adap, &msg, 1) != 1)
475 return -EREMOTEIO; 496 return -EREMOTEIO;
476 } 497 }