diff options
author | Oliver Endriss <o.endriss@gmx.de> | 2008-04-20 20:57:34 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-24 13:09:45 -0400 |
commit | e84b133e329ddad725907844c285efcd35dae39d (patch) | |
tree | c9cda47857845b8bdd88bd5411a90301efbbad0d | |
parent | 94ad6de7051a9eb6beda096144c5b409538eab86 (diff) |
V4L/DVB (7661): stv0299: Add flag to turn off OP0 output
Add flag to turn off OP0 output.
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r-- | drivers/media/dvb/frontends/stv0299.c | 45 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/stv0299.h | 3 |
2 files changed, 33 insertions, 15 deletions
diff --git a/drivers/media/dvb/frontends/stv0299.c b/drivers/media/dvb/frontends/stv0299.c index f7c36741537d..17556183e871 100644 --- a/drivers/media/dvb/frontends/stv0299.c +++ b/drivers/media/dvb/frontends/stv0299.c | |||
@@ -366,26 +366,32 @@ static int stv0299_set_voltage (struct dvb_frontend* fe, fe_sec_voltage_t voltag | |||
366 | * H/V switching over OP0, OP1 and OP2 are LNB power enable bits | 366 | * H/V switching over OP0, OP1 and OP2 are LNB power enable bits |
367 | */ | 367 | */ |
368 | reg0x0c &= 0x0f; | 368 | reg0x0c &= 0x0f; |
369 | 369 | reg0x08 = (reg0x08 & 0x3f) | (state->config->lock_output << 6); | |
370 | if (voltage == SEC_VOLTAGE_OFF) { | ||
371 | stv0299_writeregI (state, 0x0c, 0x00); /* LNB power off! */ | ||
372 | return stv0299_writeregI (state, 0x08, 0x00); /* LNB power off! */ | ||
373 | } | ||
374 | |||
375 | stv0299_writeregI (state, 0x08, (reg0x08 & 0x3f) | (state->config->lock_output << 6)); | ||
376 | 370 | ||
377 | switch (voltage) { | 371 | switch (voltage) { |
378 | case SEC_VOLTAGE_13: | 372 | case SEC_VOLTAGE_13: |
379 | if (state->config->volt13_op0_op1 == STV0299_VOLT13_OP0) reg0x0c |= 0x10; | 373 | if (state->config->volt13_op0_op1 == STV0299_VOLT13_OP0) |
380 | else reg0x0c |= 0x40; | 374 | reg0x0c |= 0x10; /* OP1 off, OP0 on */ |
381 | 375 | else | |
382 | return stv0299_writeregI(state, 0x0c, reg0x0c); | 376 | reg0x0c |= 0x40; /* OP1 on, OP0 off */ |
383 | 377 | break; | |
384 | case SEC_VOLTAGE_18: | 378 | case SEC_VOLTAGE_18: |
385 | return stv0299_writeregI(state, 0x0c, reg0x0c | 0x50); | 379 | reg0x0c |= 0x50; /* OP1 on, OP0 on */ |
380 | break; | ||
381 | case SEC_VOLTAGE_OFF: | ||
382 | /* LNB power off! */ | ||
383 | reg0x08 = 0x00; | ||
384 | reg0x0c = 0x00; | ||
385 | break; | ||
386 | default: | 386 | default: |
387 | return -EINVAL; | 387 | return -EINVAL; |
388 | }; | 388 | }; |
389 | |||
390 | if (state->config->op0_off) | ||
391 | reg0x0c &= ~0x10; | ||
392 | |||
393 | stv0299_writeregI(state, 0x08, reg0x08); | ||
394 | return stv0299_writeregI(state, 0x0c, reg0x0c); | ||
389 | } | 395 | } |
390 | 396 | ||
391 | static int stv0299_send_legacy_dish_cmd (struct dvb_frontend* fe, unsigned long cmd) | 397 | static int stv0299_send_legacy_dish_cmd (struct dvb_frontend* fe, unsigned long cmd) |
@@ -445,11 +451,20 @@ static int stv0299_init (struct dvb_frontend* fe) | |||
445 | { | 451 | { |
446 | struct stv0299_state* state = fe->demodulator_priv; | 452 | struct stv0299_state* state = fe->demodulator_priv; |
447 | int i; | 453 | int i; |
454 | u8 reg; | ||
455 | u8 val; | ||
448 | 456 | ||
449 | dprintk("stv0299: init chip\n"); | 457 | dprintk("stv0299: init chip\n"); |
450 | 458 | ||
451 | for (i=0; !(state->config->inittab[i] == 0xff && state->config->inittab[i+1] == 0xff); i+=2) | 459 | for (i = 0; ; i += 2) { |
452 | stv0299_writeregI(state, state->config->inittab[i], state->config->inittab[i+1]); | 460 | reg = state->config->inittab[i]; |
461 | val = state->config->inittab[i+1]; | ||
462 | if (reg == 0xff && val == 0xff) | ||
463 | break; | ||
464 | if (reg == 0x0c && state->config->op0_off) | ||
465 | val &= ~0x10; | ||
466 | stv0299_writeregI(state, reg, val); | ||
467 | } | ||
453 | 468 | ||
454 | return 0; | 469 | return 0; |
455 | } | 470 | } |
diff --git a/drivers/media/dvb/frontends/stv0299.h b/drivers/media/dvb/frontends/stv0299.h index 84eaeb518540..abd9cf8153cf 100644 --- a/drivers/media/dvb/frontends/stv0299.h +++ b/drivers/media/dvb/frontends/stv0299.h | |||
@@ -82,6 +82,9 @@ struct stv0299_config | |||
82 | /* Is 13v controlled by OP0 or OP1? */ | 82 | /* Is 13v controlled by OP0 or OP1? */ |
83 | u8 volt13_op0_op1:1; | 83 | u8 volt13_op0_op1:1; |
84 | 84 | ||
85 | /* Turn-off OP0? */ | ||
86 | u8 op0_off:1; | ||
87 | |||
85 | /* minimum delay before retuning */ | 88 | /* minimum delay before retuning */ |
86 | int min_delay_ms; | 89 | int min_delay_ms; |
87 | 90 | ||