Manu Abraham | 8be969b | 2008-01-25 18:20:48 -0300 | [diff] [blame] | 1 | /* |
| 2 | TDA8261 8PSK/QPSK tuner driver |
| 3 | Copyright (C) Manu Abraham (abraham.manu@gmail.com) |
| 4 | |
| 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. |
| 9 | |
| 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. |
| 14 | |
| 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. |
| 18 | */ |
| 19 | |
| 20 | static int tda8261_get_frequency(struct dvb_frontend *fe, u32 *frequency) |
| 21 | { |
Emil Goode | 2072118 | 2014-06-24 18:42:27 -0300 | [diff] [blame] | 22 | struct dvb_frontend_ops *frontend_ops = &fe->ops; |
| 23 | struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops; |
Manu Abraham | 8be969b | 2008-01-25 18:20:48 -0300 | [diff] [blame] | 24 | int err = 0; |
| 25 | |
Mauro Carvalho Chehab | e417668 | 2015-11-11 18:07:44 -0200 | [diff] [blame] | 26 | if (tuner_ops->get_frequency) { |
| 27 | err = tuner_ops->get_frequency(fe, frequency); |
Emil Goode | 8f73b48 | 2014-06-24 18:42:28 -0300 | [diff] [blame] | 28 | if (err < 0) { |
Mauro Carvalho Chehab | e417668 | 2015-11-11 18:07:44 -0200 | [diff] [blame] | 29 | pr_err("%s: Invalid parameter\n", __func__); |
Manu Abraham | 8be969b | 2008-01-25 18:20:48 -0300 | [diff] [blame] | 30 | return err; |
| 31 | } |
Mauro Carvalho Chehab | e417668 | 2015-11-11 18:07:44 -0200 | [diff] [blame] | 32 | pr_debug("%s: Frequency=%d\n", __func__, *frequency); |
Manu Abraham | 8be969b | 2008-01-25 18:20:48 -0300 | [diff] [blame] | 33 | } |
| 34 | return 0; |
| 35 | } |
| 36 | |
| 37 | static int tda8261_set_frequency(struct dvb_frontend *fe, u32 frequency) |
| 38 | { |
Emil Goode | 2072118 | 2014-06-24 18:42:27 -0300 | [diff] [blame] | 39 | struct dvb_frontend_ops *frontend_ops = &fe->ops; |
| 40 | struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops; |
Mauro Carvalho Chehab | e417668 | 2015-11-11 18:07:44 -0200 | [diff] [blame] | 41 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; |
Manu Abraham | 8be969b | 2008-01-25 18:20:48 -0300 | [diff] [blame] | 42 | int err = 0; |
| 43 | |
Mauro Carvalho Chehab | e417668 | 2015-11-11 18:07:44 -0200 | [diff] [blame] | 44 | if (tuner_ops->set_params) { |
| 45 | err = tuner_ops->set_params(fe); |
Emil Goode | 8f73b48 | 2014-06-24 18:42:28 -0300 | [diff] [blame] | 46 | if (err < 0) { |
Mauro Carvalho Chehab | e417668 | 2015-11-11 18:07:44 -0200 | [diff] [blame] | 47 | pr_err("%s: Invalid parameter\n", __func__); |
Manu Abraham | 8be969b | 2008-01-25 18:20:48 -0300 | [diff] [blame] | 48 | return err; |
| 49 | } |
| 50 | } |
Mauro Carvalho Chehab | e417668 | 2015-11-11 18:07:44 -0200 | [diff] [blame] | 51 | pr_debug("%s: Frequency=%d\n", __func__, c->frequency); |
Manu Abraham | 8be969b | 2008-01-25 18:20:48 -0300 | [diff] [blame] | 52 | return 0; |
| 53 | } |
| 54 | |
| 55 | static int tda8261_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth) |
| 56 | { |
Mauro Carvalho Chehab | e417668 | 2015-11-11 18:07:44 -0200 | [diff] [blame] | 57 | /* FIXME! need to calculate Bandwidth */ |
| 58 | *bandwidth = 40000000; |
Manu Abraham | 8be969b | 2008-01-25 18:20:48 -0300 | [diff] [blame] | 59 | |
Manu Abraham | 8be969b | 2008-01-25 18:20:48 -0300 | [diff] [blame] | 60 | return 0; |
| 61 | } |