aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/ttusb-budget
diff options
context:
space:
mode:
authorGavin Hamill <gdh@acentral.co.uk>2005-07-07 20:58:04 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-07 21:23:58 -0400
commit53936391741dee735304e997e2289500adf970c7 (patch)
treee9778f3326759d1e632d3ebad3ce83e450df4ff0 /drivers/media/dvb/ttusb-budget
parent80887a59c255f4a6c348dfc679501b3679d1070f (diff)
[PATCH] dvb: ttpci: add support for Hauppauge/TT DVB-C budget
Add support for Hauppauge/TT DVB-C budget. Signed-off-by: Gavin Hamill <gdh@acentral.co.uk> Signed-off-by: Johannes Stezenbach <js@linuxtv.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media/dvb/ttusb-budget')
-rw-r--r--drivers/media/dvb/ttusb-budget/Kconfig1
-rw-r--r--drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c50
2 files changed, 50 insertions, 1 deletions
diff --git a/drivers/media/dvb/ttusb-budget/Kconfig b/drivers/media/dvb/ttusb-budget/Kconfig
index 4aa714ab4c28..c6c1d41a2efb 100644
--- a/drivers/media/dvb/ttusb-budget/Kconfig
+++ b/drivers/media/dvb/ttusb-budget/Kconfig
@@ -3,6 +3,7 @@ config DVB_TTUSB_BUDGET
3 depends on DVB_CORE && USB 3 depends on DVB_CORE && USB
4 select DVB_CX22700 4 select DVB_CX22700
5 select DVB_TDA1004X 5 select DVB_TDA1004X
6 select DVB_VES1820
6 select DVB_TDA8083 7 select DVB_TDA8083
7 select DVB_STV0299 8 select DVB_STV0299
8 help 9 help
diff --git a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
index afa0e7a0e506..2c17a5f58340 100644
--- a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
+++ b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
@@ -24,6 +24,7 @@
24#include "dmxdev.h" 24#include "dmxdev.h"
25#include "dvb_demux.h" 25#include "dvb_demux.h"
26#include "dvb_net.h" 26#include "dvb_net.h"
27#include "ves1820.h"
27#include "cx22700.h" 28#include "cx22700.h"
28#include "tda1004x.h" 29#include "tda1004x.h"
29#include "stv0299.h" 30#include "stv0299.h"
@@ -1367,6 +1368,47 @@ static struct tda8083_config ttusb_novas_grundig_29504_491_config = {
1367 .pll_set = ttusb_novas_grundig_29504_491_pll_set, 1368 .pll_set = ttusb_novas_grundig_29504_491_pll_set,
1368}; 1369};
1369 1370
1371static int alps_tdbe2_pll_set(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
1372{
1373 struct ttusb* ttusb = fe->dvb->priv;
1374 u32 div;
1375 u8 data[4];
1376 struct i2c_msg msg = { .addr = 0x62, .flags = 0, .buf = data, .len = sizeof(data) };
1377
1378 div = (params->frequency + 35937500 + 31250) / 62500;
1379
1380 data[0] = (div >> 8) & 0x7f;
1381 data[1] = div & 0xff;
1382 data[2] = 0x85 | ((div >> 10) & 0x60);
1383 data[3] = (params->frequency < 174000000 ? 0x88 : params->frequency < 470000000 ? 0x84 : 0x81);
1384
1385 if (i2c_transfer (&ttusb->i2c_adap, &msg, 1) != 1)
1386 return -EIO;
1387
1388 return 0;
1389}
1390
1391
1392static struct ves1820_config alps_tdbe2_config = {
1393 .demod_address = 0x09,
1394 .xin = 57840000UL,
1395 .invert = 1,
1396 .selagc = VES1820_SELAGC_SIGNAMPERR,
1397 .pll_set = alps_tdbe2_pll_set,
1398};
1399
1400static u8 read_pwm(struct ttusb* ttusb)
1401{
1402 u8 b = 0xff;
1403 u8 pwm;
1404 struct i2c_msg msg[] = { { .addr = 0x50,.flags = 0,.buf = &b,.len = 1 },
1405 { .addr = 0x50,.flags = I2C_M_RD,.buf = &pwm,.len = 1} };
1406
1407 if ((i2c_transfer(&ttusb->i2c_adap, msg, 2) != 2) || (pwm == 0xff))
1408 pwm = 0x48;
1409
1410 return pwm;
1411}
1370 1412
1371 1413
1372static void frontend_init(struct ttusb* ttusb) 1414static void frontend_init(struct ttusb* ttusb)
@@ -1394,6 +1436,12 @@ static void frontend_init(struct ttusb* ttusb)
1394 1436
1395 break; 1437 break;
1396 1438
1439 case 0x1004: // Hauppauge/TT DVB-C budget (ves1820/ALPS TDBE2(sp5659))
1440 ttusb->fe = ves1820_attach(&alps_tdbe2_config, &ttusb->i2c_adap, read_pwm(ttusb));
1441 if (ttusb->fe != NULL)
1442 break;
1443 break;
1444
1397 case 0x1005: // Hauppauge/TT Nova-USB-t budget (tda10046/Philips td1316(tda6651tt) OR cx22700/ALPS TDMB7(??)) 1445 case 0x1005: // Hauppauge/TT Nova-USB-t budget (tda10046/Philips td1316(tda6651tt) OR cx22700/ALPS TDMB7(??))
1398 // try the ALPS TDMB7 first 1446 // try the ALPS TDMB7 first
1399 ttusb->fe = cx22700_attach(&alps_tdmb7_config, &ttusb->i2c_adap); 1447 ttusb->fe = cx22700_attach(&alps_tdmb7_config, &ttusb->i2c_adap);
@@ -1570,7 +1618,7 @@ static void ttusb_disconnect(struct usb_interface *intf)
1570 1618
1571static struct usb_device_id ttusb_table[] = { 1619static struct usb_device_id ttusb_table[] = {
1572 {USB_DEVICE(0xb48, 0x1003)}, 1620 {USB_DEVICE(0xb48, 0x1003)},
1573/* {USB_DEVICE(0xb48, 0x1004)},UNDEFINED HARDWARE - mail linuxtv.org list*/ /* to be confirmed ???? */ 1621 {USB_DEVICE(0xb48, 0x1004)},
1574 {USB_DEVICE(0xb48, 0x1005)}, 1622 {USB_DEVICE(0xb48, 0x1005)},
1575 {} 1623 {}
1576}; 1624};