aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Endriss <o.endriss@gmx.de>2008-09-03 17:16:09 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-10-12 07:36:56 -0400
commit81ae953b687e7cdfa094b07a6544523f3bb81aa3 (patch)
tree48ba5c778e5bbea974ae308fa68886fcdd4d885f
parent26d2e854bc242f0134a4be7f1eed98129d96d943 (diff)
V4L/DVB (8888): budget: Support Activy DVB-T with TDHD1 tuner
Support Fujitsu-Siemens Activy DVB-T card rev AL (ALPS TDHD1-204A tuner). Signed-off-by: Oliver Endriss <o.endriss@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/dvb/frontends/tdhd1.h70
-rw-r--r--drivers/media/dvb/ttpci/Kconfig1
-rw-r--r--drivers/media/dvb/ttpci/budget.c11
3 files changed, 82 insertions, 0 deletions
diff --git a/drivers/media/dvb/frontends/tdhd1.h b/drivers/media/dvb/frontends/tdhd1.h
new file mode 100644
index 000000000000..de8aac7d7ae0
--- /dev/null
+++ b/drivers/media/dvb/frontends/tdhd1.h
@@ -0,0 +1,70 @@
1/*
2 * tdhd1.h - ALPS TDHD1-204A tuner support
3 *
4 * Copyright (C) 2008 Oliver Endriss <o.endriss@gmx.de>
5 *
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
21 *
22 *
23 * The project's page is at http://www.linuxtv.org
24 */
25
26#ifndef TDHD1_H
27#define TDHD1_H
28
29#include "tda1004x.h"
30
31static struct tda1004x_config alps_tdhd1_204a_config = {
32 .demod_address = 0x8,
33 .invert = 1,
34 .invert_oclk = 0,
35 .xtal_freq = TDA10046_XTAL_4M,
36 .agc_config = TDA10046_AGC_DEFAULT,
37 .if_freq = TDA10046_FREQ_3617,
38};
39
40static int alps_tdhd1_204a_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
41{
42 struct i2c_adapter *i2c = fe->tuner_priv;
43 u8 data[4];
44 struct i2c_msg msg = { .addr = 0x61, .flags = 0, .buf = data, .len = sizeof(data) };
45 u32 div;
46
47 div = (params->frequency + 36166666) / 166666;
48
49 data[0] = (div >> 8) & 0x7f;
50 data[1] = div & 0xff;
51 data[2] = 0x85;
52
53 if (params->frequency >= 174000000 && params->frequency <= 230000000)
54 data[3] = 0x02;
55 else if (params->frequency >= 470000000 && params->frequency <= 823000000)
56 data[3] = 0x0C;
57 else if (params->frequency > 823000000 && params->frequency <= 862000000)
58 data[3] = 0x8C;
59 else
60 return -EINVAL;
61
62 if (fe->ops.i2c_gate_ctrl)
63 fe->ops.i2c_gate_ctrl(fe, 1);
64 if (i2c_transfer(i2c, &msg, 1) != 1)
65 return -EIO;
66
67 return 0;
68}
69
70#endif /* TDHD1_H */
diff --git a/drivers/media/dvb/ttpci/Kconfig b/drivers/media/dvb/ttpci/Kconfig
index 41b5a988b619..867027ceab3e 100644
--- a/drivers/media/dvb/ttpci/Kconfig
+++ b/drivers/media/dvb/ttpci/Kconfig
@@ -86,6 +86,7 @@ config DVB_BUDGET
86 select DVB_TDA10086 if !DVB_FE_CUSTOMISE 86 select DVB_TDA10086 if !DVB_FE_CUSTOMISE
87 select DVB_TDA826X if !DVB_FE_CUSTOMISE 87 select DVB_TDA826X if !DVB_FE_CUSTOMISE
88 select DVB_LNBP21 if !DVB_FE_CUSTOMISE 88 select DVB_LNBP21 if !DVB_FE_CUSTOMISE
89 select DVB_TDA1004X if !DVB_FE_CUSTOMISE
89 help 90 help
90 Support for simple SAA7146 based DVB cards (so called Budget- 91 Support for simple SAA7146 based DVB cards (so called Budget-
91 or Nova-PCI cards) without onboard MPEG2 decoder, and without 92 or Nova-PCI cards) without onboard MPEG2 decoder, and without
diff --git a/drivers/media/dvb/ttpci/budget.c b/drivers/media/dvb/ttpci/budget.c
index 851e523fbffc..a4664ba5aded 100644
--- a/drivers/media/dvb/ttpci/budget.c
+++ b/drivers/media/dvb/ttpci/budget.c
@@ -46,6 +46,7 @@
46#include "lnbp21.h" 46#include "lnbp21.h"
47#include "bsru6.h" 47#include "bsru6.h"
48#include "bsbe1.h" 48#include "bsbe1.h"
49#include "tdhd1.h"
49 50
50static int diseqc_method; 51static int diseqc_method;
51module_param(diseqc_method, int, 0444); 52module_param(diseqc_method, int, 0444);
@@ -511,6 +512,14 @@ static void frontend_init(struct budget *budget)
511 } 512 }
512 break; 513 break;
513 514
515 case 0x5f60: /* Fujitsu Siemens Activy Budget-T PCI rev AL (tda10046/ALPS TDHD1-204A) */
516 budget->dvb_frontend = dvb_attach(tda10046_attach, &alps_tdhd1_204a_config, &budget->i2c_adap);
517 if (budget->dvb_frontend) {
518 budget->dvb_frontend->ops.tuner_ops.set_params = alps_tdhd1_204a_tuner_set_params;
519 budget->dvb_frontend->tuner_priv = &budget->i2c_adap;
520 }
521 break;
522
514 case 0x5f61: /* Fujitsu Siemens Activy Budget-T PCI rev GR (L64781/Grundig 29504-401(tsa5060)) */ 523 case 0x5f61: /* Fujitsu Siemens Activy Budget-T PCI rev GR (L64781/Grundig 29504-401(tsa5060)) */
515 budget->dvb_frontend = dvb_attach(l64781_attach, &grundig_29504_401_config_activy, &budget->i2c_adap); 524 budget->dvb_frontend = dvb_attach(l64781_attach, &grundig_29504_401_config_activy, &budget->i2c_adap);
516 if (budget->dvb_frontend) { 525 if (budget->dvb_frontend) {
@@ -624,6 +633,7 @@ MAKE_BUDGET_INFO(ttbs1401, "TT-Budget-S-1401 PCI", BUDGET_TT);
624MAKE_BUDGET_INFO(fsacs0, "Fujitsu Siemens Activy Budget-S PCI (rev GR/grundig frontend)", BUDGET_FS_ACTIVY); 633MAKE_BUDGET_INFO(fsacs0, "Fujitsu Siemens Activy Budget-S PCI (rev GR/grundig frontend)", BUDGET_FS_ACTIVY);
625MAKE_BUDGET_INFO(fsacs1, "Fujitsu Siemens Activy Budget-S PCI (rev AL/alps frontend)", BUDGET_FS_ACTIVY); 634MAKE_BUDGET_INFO(fsacs1, "Fujitsu Siemens Activy Budget-S PCI (rev AL/alps frontend)", BUDGET_FS_ACTIVY);
626MAKE_BUDGET_INFO(fsact, "Fujitsu Siemens Activy Budget-T PCI (rev GR/Grundig frontend)", BUDGET_FS_ACTIVY); 635MAKE_BUDGET_INFO(fsact, "Fujitsu Siemens Activy Budget-T PCI (rev GR/Grundig frontend)", BUDGET_FS_ACTIVY);
636MAKE_BUDGET_INFO(fsact1, "Fujitsu Siemens Activy Budget-T PCI (rev AL/ALPS TDHD1-204A)", BUDGET_FS_ACTIVY);
627 637
628static struct pci_device_id pci_tbl[] = { 638static struct pci_device_id pci_tbl[] = {
629 MAKE_EXTENSION_PCI(ttbs, 0x13c2, 0x1003), 639 MAKE_EXTENSION_PCI(ttbs, 0x13c2, 0x1003),
@@ -634,6 +644,7 @@ static struct pci_device_id pci_tbl[] = {
634 MAKE_EXTENSION_PCI(ttbs1401, 0x13c2, 0x1018), 644 MAKE_EXTENSION_PCI(ttbs1401, 0x13c2, 0x1018),
635 MAKE_EXTENSION_PCI(fsacs1,0x1131, 0x4f60), 645 MAKE_EXTENSION_PCI(fsacs1,0x1131, 0x4f60),
636 MAKE_EXTENSION_PCI(fsacs0,0x1131, 0x4f61), 646 MAKE_EXTENSION_PCI(fsacs0,0x1131, 0x4f61),
647 MAKE_EXTENSION_PCI(fsact1, 0x1131, 0x5f60),
637 MAKE_EXTENSION_PCI(fsact, 0x1131, 0x5f61), 648 MAKE_EXTENSION_PCI(fsact, 0x1131, 0x5f61),
638 { 649 {
639 .vendor = 0, 650 .vendor = 0,