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