1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3 TDA8261 8PSK/QPSK tuner driver
4 Copyright (C) Manu Abraham (abraham.manu@gmail.com)
5
6 */
7
tda8261_get_frequency(struct dvb_frontend * fe,u32 * frequency)8 static int tda8261_get_frequency(struct dvb_frontend *fe, u32 *frequency)
9 {
10 struct dvb_frontend_ops *frontend_ops = &fe->ops;
11 struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
12 int err = 0;
13
14 if (tuner_ops->get_frequency) {
15 err = tuner_ops->get_frequency(fe, frequency);
16 if (err < 0) {
17 pr_err("%s: Invalid parameter\n", __func__);
18 return err;
19 }
20 pr_debug("%s: Frequency=%d\n", __func__, *frequency);
21 }
22 return 0;
23 }
24
tda8261_set_frequency(struct dvb_frontend * fe,u32 frequency)25 static int tda8261_set_frequency(struct dvb_frontend *fe, u32 frequency)
26 {
27 struct dvb_frontend_ops *frontend_ops = &fe->ops;
28 struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
29 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
30 int err = 0;
31
32 if (tuner_ops->set_params) {
33 err = tuner_ops->set_params(fe);
34 if (err < 0) {
35 pr_err("%s: Invalid parameter\n", __func__);
36 return err;
37 }
38 }
39 pr_debug("%s: Frequency=%d\n", __func__, c->frequency);
40 return 0;
41 }
42
tda8261_get_bandwidth(struct dvb_frontend * fe,u32 * bandwidth)43 static int tda8261_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
44 {
45 /* FIXME! need to calculate Bandwidth */
46 *bandwidth = 40000000;
47
48 return 0;
49 }
50