diff options
author | Andrew de Quincey <adq_dvb@lidskialf.net> | 2005-07-07 20:57:53 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-07-07 21:23:57 -0400 |
commit | 96bf2f2b549aab918f4225841df54c3d58896822 (patch) | |
tree | 4dc2e28fb2b346ef7d4892c7a3c54d28a8d0fa5c /drivers/media/dvb/ttpci | |
parent | 771e71570ce4da549fe89978de0a29e3299d7fb7 (diff) |
[PATCH] dvb: ttpci: add support for Technotrend/Hauppauge DVB-S SE
Add support for s5h1420 frontend (new Technotrend/Hauppauge DVB-S SE).
Signed-off-by: Andrew de Quincey <adq_dvb@lidskialf.net>
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/ttpci')
-rw-r--r-- | drivers/media/dvb/ttpci/Kconfig | 9 | ||||
-rw-r--r-- | drivers/media/dvb/ttpci/budget.c | 99 |
2 files changed, 104 insertions, 4 deletions
diff --git a/drivers/media/dvb/ttpci/Kconfig b/drivers/media/dvb/ttpci/Kconfig index 7ffa2c7315b3..bf3c011d2cfb 100644 --- a/drivers/media/dvb/ttpci/Kconfig +++ b/drivers/media/dvb/ttpci/Kconfig | |||
@@ -12,7 +12,7 @@ config DVB_AV7110 | |||
12 | select DVB_STV0297 | 12 | select DVB_STV0297 |
13 | select DVB_L64781 | 13 | select DVB_L64781 |
14 | help | 14 | help |
15 | Support for SAA7146 and AV7110 based DVB cards as produced | 15 | Support for SAA7146 and AV7110 based DVB cards as produced |
16 | by Fujitsu-Siemens, Technotrend, Hauppauge and others. | 16 | by Fujitsu-Siemens, Technotrend, Hauppauge and others. |
17 | 17 | ||
18 | This driver only supports the fullfeatured cards with | 18 | This driver only supports the fullfeatured cards with |
@@ -33,7 +33,7 @@ config DVB_AV7110_FIRMWARE | |||
33 | If you want to compile the firmware into the driver you need to say | 33 | If you want to compile the firmware into the driver you need to say |
34 | Y here and provide the correct path of the firmware. You need this | 34 | Y here and provide the correct path of the firmware. You need this |
35 | option if you want to compile the whole driver statically into the | 35 | option if you want to compile the whole driver statically into the |
36 | kernel. | 36 | kernel. |
37 | 37 | ||
38 | All other people say N. | 38 | All other people say N. |
39 | 39 | ||
@@ -66,6 +66,7 @@ config DVB_BUDGET | |||
66 | select DVB_L64781 | 66 | select DVB_L64781 |
67 | select DVB_TDA8083 | 67 | select DVB_TDA8083 |
68 | select DVB_TDA10021 | 68 | select DVB_TDA10021 |
69 | select DVB_S5H1420 | ||
69 | help | 70 | help |
70 | Support for simple SAA7146 based DVB cards | 71 | Support for simple SAA7146 based DVB cards |
71 | (so called Budget- or Nova-PCI cards) without onboard | 72 | (so called Budget- or Nova-PCI cards) without onboard |
@@ -119,9 +120,9 @@ config DVB_BUDGET_PATCH | |||
119 | select DVB_VES1X93 | 120 | select DVB_VES1X93 |
120 | select DVB_TDA8083 | 121 | select DVB_TDA8083 |
121 | help | 122 | help |
122 | Support for Budget Patch (full TS) modification on | 123 | Support for Budget Patch (full TS) modification on |
123 | SAA7146+AV7110 based cards (DVB-S cards). This | 124 | SAA7146+AV7110 based cards (DVB-S cards). This |
124 | driver doesn't use onboard MPEG2 decoder. The | 125 | driver doesn't use onboard MPEG2 decoder. The |
125 | card is driven in Budget-only mode. Card is | 126 | card is driven in Budget-only mode. Card is |
126 | required to have loaded firmware to tune properly. | 127 | required to have loaded firmware to tune properly. |
127 | Firmware can be loaded by insertion and removal of | 128 | Firmware can be loaded by insertion and removal of |
diff --git a/drivers/media/dvb/ttpci/budget.c b/drivers/media/dvb/ttpci/budget.c index 083fd44e5f90..9961917e8a7f 100644 --- a/drivers/media/dvb/ttpci/budget.c +++ b/drivers/media/dvb/ttpci/budget.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #include "ves1820.h" | 40 | #include "ves1820.h" |
41 | #include "l64781.h" | 41 | #include "l64781.h" |
42 | #include "tda8083.h" | 42 | #include "tda8083.h" |
43 | #include "s5h1420.h" | ||
43 | 44 | ||
44 | static void Set22K (struct budget *budget, int state) | 45 | static void Set22K (struct budget *budget, int state) |
45 | { | 46 | { |
@@ -177,6 +178,62 @@ static int budget_diseqc_send_burst(struct dvb_frontend* fe, fe_sec_mini_cmd_t m | |||
177 | return 0; | 178 | return 0; |
178 | } | 179 | } |
179 | 180 | ||
181 | static int lnbp21_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t voltage) | ||
182 | { | ||
183 | struct budget* budget = (struct budget*) fe->dvb->priv; | ||
184 | u8 buf; | ||
185 | struct i2c_msg msg = { .addr = 0x08, .flags = I2C_M_RD, .buf = &buf, .len = sizeof(buf) }; | ||
186 | |||
187 | if (i2c_transfer (&budget->i2c_adap, &msg, 1) != 1) return -EIO; | ||
188 | |||
189 | switch(voltage) { | ||
190 | case SEC_VOLTAGE_13: | ||
191 | buf = (buf & 0xf7) | 0x04; | ||
192 | break; | ||
193 | |||
194 | case SEC_VOLTAGE_18: | ||
195 | buf = (buf & 0xf7) | 0x0c; | ||
196 | break; | ||
197 | |||
198 | case SEC_VOLTAGE_OFF: | ||
199 | buf = buf & 0xf0; | ||
200 | break; | ||
201 | } | ||
202 | |||
203 | msg.flags = 0; | ||
204 | if (i2c_transfer (&budget->i2c_adap, &msg, 1) != 1) return -EIO; | ||
205 | |||
206 | return 0; | ||
207 | } | ||
208 | |||
209 | static int lnbp21_enable_high_lnb_voltage(struct dvb_frontend* fe, int arg) | ||
210 | { | ||
211 | struct budget* budget = (struct budget*) fe->dvb->priv; | ||
212 | u8 buf; | ||
213 | struct i2c_msg msg = { .addr = 0x08, .flags = I2C_M_RD, .buf = &buf, .len = sizeof(buf) }; | ||
214 | |||
215 | if (i2c_transfer (&budget->i2c_adap, &msg, 1) != 1) return -EIO; | ||
216 | |||
217 | if (arg) { | ||
218 | buf = buf | 0x10; | ||
219 | } else { | ||
220 | buf = buf & 0xef; | ||
221 | } | ||
222 | |||
223 | msg.flags = 0; | ||
224 | if (i2c_transfer (&budget->i2c_adap, &msg, 1) != 1) return -EIO; | ||
225 | |||
226 | return 0; | ||
227 | } | ||
228 | |||
229 | static void lnbp21_init(struct budget* budget) | ||
230 | { | ||
231 | u8 buf = 0x00; | ||
232 | struct i2c_msg msg = { .addr = 0x08, .flags = 0, .buf = &buf, .len = sizeof(buf) }; | ||
233 | |||
234 | i2c_transfer (&budget->i2c_adap, &msg, 1); | ||
235 | } | ||
236 | |||
180 | static int alps_bsrv2_pll_set(struct dvb_frontend* fe, struct dvb_frontend_parameters* params) | 237 | static int alps_bsrv2_pll_set(struct dvb_frontend* fe, struct dvb_frontend_parameters* params) |
181 | { | 238 | { |
182 | struct budget* budget = (struct budget*) fe->dvb->priv; | 239 | struct budget* budget = (struct budget*) fe->dvb->priv; |
@@ -395,6 +452,38 @@ static struct tda8083_config grundig_29504_451_config = { | |||
395 | .pll_set = grundig_29504_451_pll_set, | 452 | .pll_set = grundig_29504_451_pll_set, |
396 | }; | 453 | }; |
397 | 454 | ||
455 | static int s5h1420_pll_set(struct dvb_frontend* fe, struct dvb_frontend_parameters* params, u32* freqout) | ||
456 | { | ||
457 | struct budget* budget = (struct budget*) fe->dvb->priv; | ||
458 | u32 div; | ||
459 | u8 data[4]; | ||
460 | struct i2c_msg msg = { .addr = 0x61, .flags = 0, .buf = data, .len = sizeof(data) }; | ||
461 | |||
462 | div = params->frequency / 1000; | ||
463 | data[0] = (div >> 8) & 0x7f; | ||
464 | data[1] = div & 0xff; | ||
465 | data[2] = 0xc2; | ||
466 | |||
467 | if (div < 1450) | ||
468 | data[3] = 0x00; | ||
469 | else if (div < 1850) | ||
470 | data[3] = 0x40; | ||
471 | else if (div < 2000) | ||
472 | data[3] = 0x80; | ||
473 | else | ||
474 | data[3] = 0xc0; | ||
475 | |||
476 | if (i2c_transfer (&budget->i2c_adap, &msg, 1) != 1) return -EIO; | ||
477 | |||
478 | *freqout = div * 1000; | ||
479 | return 0; | ||
480 | } | ||
481 | |||
482 | static struct s5h1420_config s5h1420_config = { | ||
483 | .demod_address = 0x53, | ||
484 | .pll_set = s5h1420_pll_set, | ||
485 | }; | ||
486 | |||
398 | static u8 read_pwm(struct budget* budget) | 487 | static u8 read_pwm(struct budget* budget) |
399 | { | 488 | { |
400 | u8 b = 0xff; | 489 | u8 b = 0xff; |
@@ -459,6 +548,15 @@ static void frontend_init(struct budget *budget) | |||
459 | break; | 548 | break; |
460 | } | 549 | } |
461 | break; | 550 | break; |
551 | |||
552 | case 0x1016: // Hauppauge/TT Nova-S SE (samsung s5h1420/????(tda8260)) | ||
553 | budget->dvb_frontend = s5h1420_attach(&s5h1420_config, &budget->i2c_adap); | ||
554 | if (budget->dvb_frontend) { | ||
555 | budget->dvb_frontend->ops->set_voltage = lnbp21_set_voltage; | ||
556 | budget->dvb_frontend->ops->enable_high_lnb_voltage = lnbp21_enable_high_lnb_voltage; | ||
557 | lnbp21_init(budget); | ||
558 | break; | ||
559 | } | ||
462 | } | 560 | } |
463 | 561 | ||
464 | if (budget->dvb_frontend == NULL) { | 562 | if (budget->dvb_frontend == NULL) { |
@@ -532,6 +630,7 @@ static struct pci_device_id pci_tbl[] = { | |||
532 | MAKE_EXTENSION_PCI(ttbc, 0x13c2, 0x1004), | 630 | MAKE_EXTENSION_PCI(ttbc, 0x13c2, 0x1004), |
533 | MAKE_EXTENSION_PCI(ttbt, 0x13c2, 0x1005), | 631 | MAKE_EXTENSION_PCI(ttbt, 0x13c2, 0x1005), |
534 | MAKE_EXTENSION_PCI(satel, 0x13c2, 0x1013), | 632 | MAKE_EXTENSION_PCI(satel, 0x13c2, 0x1013), |
633 | MAKE_EXTENSION_PCI(ttbs, 0x13c2, 0x1016), | ||
535 | MAKE_EXTENSION_PCI(fsacs1,0x1131, 0x4f60), | 634 | MAKE_EXTENSION_PCI(fsacs1,0x1131, 0x4f60), |
536 | MAKE_EXTENSION_PCI(fsacs0,0x1131, 0x4f61), | 635 | MAKE_EXTENSION_PCI(fsacs0,0x1131, 0x4f61), |
537 | { | 636 | { |