2 TDA8261 8PSK/QPSK tuner driver
3 Copyright (C) Manu Abraham (abraham.manu@gmail.com)
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.
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.
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.
20 static int tda8261_get_frequency(struct dvb_frontend
*fe
, u32
*frequency
)
22 struct dvb_frontend_ops
*frontend_ops
= &fe
->ops
;
23 struct dvb_tuner_ops
*tuner_ops
= &frontend_ops
->tuner_ops
;
24 struct tuner_state t_state
;
27 if (tuner_ops
->get_state
) {
28 err
= tuner_ops
->get_state(fe
, DVBFE_TUNER_FREQUENCY
, &t_state
);
30 printk("%s: Invalid parameter\n", __func__
);
33 *frequency
= t_state
.frequency
;
34 printk("%s: Frequency=%d\n", __func__
, t_state
.frequency
);
39 static int tda8261_set_frequency(struct dvb_frontend
*fe
, u32 frequency
)
41 struct dvb_frontend_ops
*frontend_ops
= &fe
->ops
;
42 struct dvb_tuner_ops
*tuner_ops
= &frontend_ops
->tuner_ops
;
43 struct tuner_state t_state
;
46 t_state
.frequency
= frequency
;
48 if (tuner_ops
->set_state
) {
49 err
= tuner_ops
->set_state(fe
, DVBFE_TUNER_FREQUENCY
, &t_state
);
51 printk("%s: Invalid parameter\n", __func__
);
55 printk("%s: Frequency=%d\n", __func__
, t_state
.frequency
);
59 static int tda8261_get_bandwidth(struct dvb_frontend
*fe
, u32
*bandwidth
)
61 struct dvb_frontend_ops
*frontend_ops
= &fe
->ops
;
62 struct dvb_tuner_ops
*tuner_ops
= &frontend_ops
->tuner_ops
;
63 struct tuner_state t_state
;
66 if (tuner_ops
->get_state
) {
67 err
= tuner_ops
->get_state(fe
, DVBFE_TUNER_BANDWIDTH
, &t_state
);
69 printk("%s: Invalid parameter\n", __func__
);
72 *bandwidth
= t_state
.bandwidth
;
73 printk("%s: Bandwidth=%d\n", __func__
, t_state
.bandwidth
);