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 #include <linux/dvb/frontend.h>
23 #include <media/dvb_frontend.h>
25 static int stb6100_get_frequency(struct dvb_frontend
*fe
, u32
*frequency
)
27 struct dvb_frontend_ops
*frontend_ops
= &fe
->ops
;
28 struct dvb_tuner_ops
*tuner_ops
= &frontend_ops
->tuner_ops
;
31 if (tuner_ops
->get_frequency
) {
32 err
= tuner_ops
->get_frequency(fe
, frequency
);
34 printk("%s: Invalid parameter\n", __func__
);
41 static int stb6100_set_frequency(struct dvb_frontend
*fe
, u32 frequency
)
43 struct dvb_frontend_ops
*frontend_ops
= &fe
->ops
;
44 struct dvb_tuner_ops
*tuner_ops
= &frontend_ops
->tuner_ops
;
45 struct dtv_frontend_properties
*c
= &fe
->dtv_property_cache
;
46 u32 bw
= c
->bandwidth_hz
;
49 c
->frequency
= frequency
;
50 c
->bandwidth_hz
= 0; /* Don't adjust the bandwidth */
52 if (tuner_ops
->set_params
) {
53 err
= tuner_ops
->set_params(fe
);
56 printk("%s: Invalid parameter\n", __func__
);
63 static int stb6100_get_bandwidth(struct dvb_frontend
*fe
, u32
*bandwidth
)
65 struct dvb_frontend_ops
*frontend_ops
= &fe
->ops
;
66 struct dvb_tuner_ops
*tuner_ops
= &frontend_ops
->tuner_ops
;
69 if (tuner_ops
->get_bandwidth
) {
70 err
= tuner_ops
->get_bandwidth(fe
, bandwidth
);
72 printk("%s: Invalid parameter\n", __func__
);
79 static int stb6100_set_bandwidth(struct dvb_frontend
*fe
, u32 bandwidth
)
81 struct dvb_frontend_ops
*frontend_ops
= &fe
->ops
;
82 struct dvb_tuner_ops
*tuner_ops
= &frontend_ops
->tuner_ops
;
83 struct dtv_frontend_properties
*c
= &fe
->dtv_property_cache
;
84 u32 freq
= c
->frequency
;
87 c
->bandwidth_hz
= bandwidth
;
88 c
->frequency
= 0; /* Don't adjust the frequency */
90 if (tuner_ops
->set_params
) {
91 err
= tuner_ops
->set_params(fe
);
94 printk("%s: Invalid parameter\n", __func__
);