3 Copyright (C) Manu Abraham (abraham.manu@gmail.com)
5 Copyright (C) ST Microelectronics
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
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.
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., 675 Mass Ave, Cambridge, MA 02139, USA.
22 static int stb6100_get_frequency(struct dvb_frontend
*fe
, u32
*frequency
)
24 struct dvb_frontend_ops
*frontend_ops
= NULL
;
25 struct dvb_tuner_ops
*tuner_ops
= NULL
;
26 struct tuner_state t_state
;
30 frontend_ops
= &fe
->ops
;
31 if (&frontend_ops
->tuner_ops
)
32 tuner_ops
= &frontend_ops
->tuner_ops
;
33 if (tuner_ops
->get_state
) {
34 if ((err
= tuner_ops
->get_state(fe
, DVBFE_TUNER_FREQUENCY
, &t_state
)) < 0) {
35 printk("%s: Invalid parameter\n", __func__
);
38 *frequency
= t_state
.frequency
;
39 printk("%s: Frequency=%d\n", __func__
, t_state
.frequency
);
44 static int stb6100_set_frequency(struct dvb_frontend
*fe
, u32 frequency
)
46 struct dvb_frontend_ops
*frontend_ops
= NULL
;
47 struct dvb_tuner_ops
*tuner_ops
= NULL
;
48 struct tuner_state t_state
;
51 t_state
.frequency
= frequency
;
53 frontend_ops
= &fe
->ops
;
54 if (&frontend_ops
->tuner_ops
)
55 tuner_ops
= &frontend_ops
->tuner_ops
;
56 if (tuner_ops
->set_state
) {
57 if ((err
= tuner_ops
->set_state(fe
, DVBFE_TUNER_FREQUENCY
, &t_state
)) < 0) {
58 printk("%s: Invalid parameter\n", __func__
);
62 printk("%s: Frequency=%d\n", __func__
, t_state
.frequency
);
66 static int stb6100_get_bandwidth(struct dvb_frontend
*fe
, u32
*bandwidth
)
68 struct dvb_frontend_ops
*frontend_ops
= &fe
->ops
;
69 struct dvb_tuner_ops
*tuner_ops
= &frontend_ops
->tuner_ops
;
70 struct tuner_state t_state
;
74 frontend_ops
= &fe
->ops
;
75 if (&frontend_ops
->tuner_ops
)
76 tuner_ops
= &frontend_ops
->tuner_ops
;
77 if (tuner_ops
->get_state
) {
78 if ((err
= tuner_ops
->get_state(fe
, DVBFE_TUNER_BANDWIDTH
, &t_state
)) < 0) {
79 printk("%s: Invalid parameter\n", __func__
);
82 *bandwidth
= t_state
.bandwidth
;
84 printk("%s: Bandwidth=%d\n", __func__
, t_state
.bandwidth
);
88 static int stb6100_set_bandwidth(struct dvb_frontend
*fe
, u32 bandwidth
)
90 struct dvb_frontend_ops
*frontend_ops
= NULL
;
91 struct dvb_tuner_ops
*tuner_ops
= NULL
;
92 struct tuner_state t_state
;
95 t_state
.bandwidth
= bandwidth
;
97 frontend_ops
= &fe
->ops
;
98 if (&frontend_ops
->tuner_ops
)
99 tuner_ops
= &frontend_ops
->tuner_ops
;
100 if (tuner_ops
->set_state
) {
101 if ((err
= tuner_ops
->set_state(fe
, DVBFE_TUNER_BANDWIDTH
, &t_state
)) < 0) {
102 printk("%s: Invalid parameter\n", __func__
);
106 printk("%s: Bandwidth=%d\n", __func__
, t_state
.bandwidth
);