Merge tag 'io_uring-5.11-2021-01-16' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / drivers / media / dvb-frontends / tda8261_cfg.h
blob3d26004d55c4eba464aa4a663955bbdf9b3b5625
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)
6 */
8 static int tda8261_get_frequency(struct dvb_frontend *fe, u32 *frequency)
10 struct dvb_frontend_ops *frontend_ops = &fe->ops;
11 struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
12 int err = 0;
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;
20 pr_debug("%s: Frequency=%d\n", __func__, *frequency);
22 return 0;
25 static int tda8261_set_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;
29 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
30 int err = 0;
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;
39 pr_debug("%s: Frequency=%d\n", __func__, c->frequency);
40 return 0;
43 static int tda8261_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
45 /* FIXME! need to calculate Bandwidth */
46 *bandwidth = 40000000;
48 return 0;