diff options
author | Igor M. Liplianin <liplianin@me.by> | 2009-11-16 20:22:32 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-12-05 15:41:43 -0500 |
commit | b699c2712b1ddcc3ef4491adde00a47a880fde97 (patch) | |
tree | 446f12baedad897f614de8b09c01855894a133c0 /drivers/media/dvb | |
parent | fa26ae3e8260530121e6e0e57427468a9f0038d7 (diff) |
V4L/DVB (13407): Add Prof 7301 PCI DVB-S2 card
Add Prof 7301 PCI DVB-S2 card
The card based on stv0903 demod, stb6100 tuner.
Signed-off-by: Igor M. Liplianin <liplianin@me.by>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r-- | drivers/media/dvb/frontends/stb6100_proc.h | 138 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/stv0900.h | 2 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/stv0900_core.c | 3 |
3 files changed, 143 insertions, 0 deletions
diff --git a/drivers/media/dvb/frontends/stb6100_proc.h b/drivers/media/dvb/frontends/stb6100_proc.h new file mode 100644 index 000000000000..112163a48622 --- /dev/null +++ b/drivers/media/dvb/frontends/stb6100_proc.h | |||
@@ -0,0 +1,138 @@ | |||
1 | /* | ||
2 | STB6100 Silicon Tuner wrapper | ||
3 | Copyright (C)2009 Igor M. Liplianin (liplianin@me.by) | ||
4 | |||
5 | This program is free software; you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published by | ||
7 | the Free Software Foundation; either version 2 of the License, or | ||
8 | (at your option) any later version. | ||
9 | |||
10 | This program is distributed in the hope that it will be useful, | ||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | GNU General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU General Public License | ||
16 | along with this program; if not, write to the Free Software | ||
17 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
18 | */ | ||
19 | |||
20 | static int stb6100_get_freq(struct dvb_frontend *fe, u32 *frequency) | ||
21 | { | ||
22 | struct dvb_frontend_ops *frontend_ops = NULL; | ||
23 | struct dvb_tuner_ops *tuner_ops = NULL; | ||
24 | struct tuner_state state; | ||
25 | int err = 0; | ||
26 | |||
27 | if (&fe->ops) | ||
28 | frontend_ops = &fe->ops; | ||
29 | if (&frontend_ops->tuner_ops) | ||
30 | tuner_ops = &frontend_ops->tuner_ops; | ||
31 | if (tuner_ops->get_state) { | ||
32 | if (frontend_ops->i2c_gate_ctrl) | ||
33 | frontend_ops->i2c_gate_ctrl(fe, 1); | ||
34 | |||
35 | err = tuner_ops->get_state(fe, DVBFE_TUNER_FREQUENCY, &state); | ||
36 | if (err < 0) { | ||
37 | printk(KERN_ERR "%s: Invalid parameter\n", __func__); | ||
38 | return err; | ||
39 | } | ||
40 | |||
41 | if (frontend_ops->i2c_gate_ctrl) | ||
42 | frontend_ops->i2c_gate_ctrl(fe, 0); | ||
43 | |||
44 | *frequency = state.frequency; | ||
45 | } | ||
46 | |||
47 | return 0; | ||
48 | } | ||
49 | |||
50 | static int stb6100_set_freq(struct dvb_frontend *fe, u32 frequency) | ||
51 | { | ||
52 | struct dvb_frontend_ops *frontend_ops = NULL; | ||
53 | struct dvb_tuner_ops *tuner_ops = NULL; | ||
54 | struct tuner_state state; | ||
55 | int err = 0; | ||
56 | |||
57 | state.frequency = frequency; | ||
58 | if (&fe->ops) | ||
59 | frontend_ops = &fe->ops; | ||
60 | if (&frontend_ops->tuner_ops) | ||
61 | tuner_ops = &frontend_ops->tuner_ops; | ||
62 | if (tuner_ops->set_state) { | ||
63 | if (frontend_ops->i2c_gate_ctrl) | ||
64 | frontend_ops->i2c_gate_ctrl(fe, 1); | ||
65 | |||
66 | err = tuner_ops->set_state(fe, DVBFE_TUNER_FREQUENCY, &state); | ||
67 | if (err < 0) { | ||
68 | printk(KERN_ERR "%s: Invalid parameter\n", __func__); | ||
69 | return err; | ||
70 | } | ||
71 | |||
72 | if (frontend_ops->i2c_gate_ctrl) | ||
73 | frontend_ops->i2c_gate_ctrl(fe, 0); | ||
74 | |||
75 | } | ||
76 | |||
77 | return 0; | ||
78 | } | ||
79 | |||
80 | static int stb6100_get_bandw(struct dvb_frontend *fe, u32 *bandwidth) | ||
81 | { | ||
82 | struct dvb_frontend_ops *frontend_ops = NULL; | ||
83 | struct dvb_tuner_ops *tuner_ops = NULL; | ||
84 | struct tuner_state state; | ||
85 | int err = 0; | ||
86 | |||
87 | if (&fe->ops) | ||
88 | frontend_ops = &fe->ops; | ||
89 | if (&frontend_ops->tuner_ops) | ||
90 | tuner_ops = &frontend_ops->tuner_ops; | ||
91 | if (tuner_ops->get_state) { | ||
92 | if (frontend_ops->i2c_gate_ctrl) | ||
93 | frontend_ops->i2c_gate_ctrl(fe, 1); | ||
94 | |||
95 | err = tuner_ops->get_state(fe, DVBFE_TUNER_BANDWIDTH, &state); | ||
96 | if (err < 0) { | ||
97 | printk(KERN_ERR "%s: Invalid parameter\n", __func__); | ||
98 | return err; | ||
99 | } | ||
100 | |||
101 | if (frontend_ops->i2c_gate_ctrl) | ||
102 | frontend_ops->i2c_gate_ctrl(fe, 0); | ||
103 | |||
104 | *bandwidth = state.bandwidth; | ||
105 | } | ||
106 | |||
107 | return 0; | ||
108 | } | ||
109 | |||
110 | static int stb6100_set_bandw(struct dvb_frontend *fe, u32 bandwidth) | ||
111 | { | ||
112 | struct dvb_frontend_ops *frontend_ops = NULL; | ||
113 | struct dvb_tuner_ops *tuner_ops = NULL; | ||
114 | struct tuner_state state; | ||
115 | int err = 0; | ||
116 | |||
117 | state.bandwidth = bandwidth; | ||
118 | if (&fe->ops) | ||
119 | frontend_ops = &fe->ops; | ||
120 | if (&frontend_ops->tuner_ops) | ||
121 | tuner_ops = &frontend_ops->tuner_ops; | ||
122 | if (tuner_ops->set_state) { | ||
123 | if (frontend_ops->i2c_gate_ctrl) | ||
124 | frontend_ops->i2c_gate_ctrl(fe, 1); | ||
125 | |||
126 | err = tuner_ops->set_state(fe, DVBFE_TUNER_BANDWIDTH, &state); | ||
127 | if (err < 0) { | ||
128 | printk(KERN_ERR "%s: Invalid parameter\n", __func__); | ||
129 | return err; | ||
130 | } | ||
131 | |||
132 | if (frontend_ops->i2c_gate_ctrl) | ||
133 | frontend_ops->i2c_gate_ctrl(fe, 0); | ||
134 | |||
135 | } | ||
136 | |||
137 | return 0; | ||
138 | } | ||
diff --git a/drivers/media/dvb/frontends/stv0900.h b/drivers/media/dvb/frontends/stv0900.h index 446bdfc8ad10..29c3fa85c227 100644 --- a/drivers/media/dvb/frontends/stv0900.h +++ b/drivers/media/dvb/frontends/stv0900.h | |||
@@ -49,6 +49,8 @@ struct stv0900_config { | |||
49 | u8 tun2_maddress; | 49 | u8 tun2_maddress; |
50 | u8 tun1_adc;/* 1 for stv6110, 2 for stb6100 */ | 50 | u8 tun1_adc;/* 1 for stv6110, 2 for stb6100 */ |
51 | u8 tun2_adc; | 51 | u8 tun2_adc; |
52 | /* Set device param to start dma */ | ||
53 | int (*set_ts_params)(struct dvb_frontend *fe, int is_punctured); | ||
52 | }; | 54 | }; |
53 | 55 | ||
54 | #if defined(CONFIG_DVB_STV0900) || (defined(CONFIG_DVB_STV0900_MODULE) \ | 56 | #if defined(CONFIG_DVB_STV0900) || (defined(CONFIG_DVB_STV0900_MODULE) \ |
diff --git a/drivers/media/dvb/frontends/stv0900_core.c b/drivers/media/dvb/frontends/stv0900_core.c index e2062048f433..df49ea0983bc 100644 --- a/drivers/media/dvb/frontends/stv0900_core.c +++ b/drivers/media/dvb/frontends/stv0900_core.c | |||
@@ -1494,6 +1494,9 @@ static enum dvbfe_search stv0900_search(struct dvb_frontend *fe, | |||
1494 | if (!(INRANGE(100000, c->symbol_rate, 70000000))) | 1494 | if (!(INRANGE(100000, c->symbol_rate, 70000000))) |
1495 | return DVBFE_ALGO_SEARCH_FAILED; | 1495 | return DVBFE_ALGO_SEARCH_FAILED; |
1496 | 1496 | ||
1497 | if (state->config->set_ts_params) | ||
1498 | state->config->set_ts_params(fe, 0); | ||
1499 | |||
1497 | p_result.locked = FALSE; | 1500 | p_result.locked = FALSE; |
1498 | p_search.path = demod; | 1501 | p_search.path = demod; |
1499 | p_search.frequency = c->frequency; | 1502 | p_search.frequency = c->frequency; |