aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
diff options
context:
space:
mode:
authorAndrew de Quincey <adq_dvb@lidskialf.net>2006-04-27 20:45:01 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-06-25 00:59:43 -0400
commitd020542fdaaa69e3061e15d096f11fbc4aeeb93f (patch)
tree06566c4d1718ed5178109a2627ded473710814d4 /drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
parent972c3517b792520a513d0ecd897ac6719e46fe0d (diff)
V4L/DVB (3932): Convert lnbp21 to a module
Convert lnbp21.h into a linux kernel module. Fix up previous users to use it. Convert dvb-ttusb-budget to use it. Signed-off-by: Andrew de Quincey <adq_dvb@lidskialf.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c')
-rw-r--r--drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c28
1 files changed, 2 insertions, 26 deletions
diff --git a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
index cd19ba628101..71581303b0ea 100644
--- a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
+++ b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
@@ -30,6 +30,7 @@
30#include "tda1004x.h" 30#include "tda1004x.h"
31#include "stv0299.h" 31#include "stv0299.h"
32#include "tda8083.h" 32#include "tda8083.h"
33#include "lnbp21.h"
33 34
34#include <linux/dvb/frontend.h> 35#include <linux/dvb/frontend.h>
35#include <linux/dvb/dmx.h> 36#include <linux/dvb/dmx.h>
@@ -486,31 +487,6 @@ static int ttusb_send_diseqc(struct dvb_frontend* fe,
486} 487}
487#endif 488#endif
488 489
489static int lnbp21_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t voltage)
490{
491 struct ttusb* ttusb = (struct ttusb*) fe->dvb->priv;
492 int ret;
493 u8 data[1];
494 struct i2c_msg msg = { .addr = 0x08, .flags = 0, .buf = data, .len = sizeof(data) };
495
496 switch(voltage) {
497 case SEC_VOLTAGE_OFF:
498 data[0] = 0x00;
499 break;
500 case SEC_VOLTAGE_13:
501 data[0] = 0x44;
502 break;
503 case SEC_VOLTAGE_18:
504 data[0] = 0x4c;
505 break;
506 default:
507 return -EINVAL;
508 };
509
510 ret = i2c_transfer(&ttusb->i2c_adap, &msg, 1);
511 return (ret != 1) ? -EIO : 0;
512}
513
514static int ttusb_update_lnb(struct ttusb *ttusb) 490static int ttusb_update_lnb(struct ttusb *ttusb)
515{ 491{
516 u8 b[] = { 0xaa, ++ttusb->c, 0x16, 5, /*power: */ 1, 492 u8 b[] = { 0xaa, ++ttusb->c, 0x16, 5, /*power: */ 1,
@@ -1415,7 +1391,7 @@ static void frontend_init(struct ttusb* ttusb)
1415 1391
1416 if(ttusb->revision == TTUSB_REV_2_2) { // ALPS BSBE1 1392 if(ttusb->revision == TTUSB_REV_2_2) { // ALPS BSBE1
1417 alps_stv0299_config.inittab = alps_bsbe1_inittab; 1393 alps_stv0299_config.inittab = alps_bsbe1_inittab;
1418 ttusb->fe->ops->set_voltage = lnbp21_set_voltage; 1394 lnbp21_attach(ttusb->fe, &ttusb->i2c_adap, 0, 0);
1419 } else { // ALPS BSRU6 1395 } else { // ALPS BSRU6
1420 ttusb->fe->ops->set_voltage = ttusb_set_voltage; 1396 ttusb->fe->ops->set_voltage = ttusb_set_voltage;
1421 } 1397 }