Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003     TDA8261 8PSK/QPSK tuner driver
0004     Copyright (C) Manu Abraham (abraham.manu@gmail.com)
0005 
0006 */
0007 
0008 static int tda8261_get_frequency(struct dvb_frontend *fe, u32 *frequency)
0009 {
0010     struct dvb_frontend_ops *frontend_ops = &fe->ops;
0011     struct dvb_tuner_ops    *tuner_ops = &frontend_ops->tuner_ops;
0012     int err = 0;
0013 
0014     if (tuner_ops->get_frequency) {
0015         err = tuner_ops->get_frequency(fe, frequency);
0016         if (err < 0) {
0017             pr_err("%s: Invalid parameter\n", __func__);
0018             return err;
0019         }
0020         pr_debug("%s: Frequency=%d\n", __func__, *frequency);
0021     }
0022     return 0;
0023 }
0024 
0025 static int tda8261_set_frequency(struct dvb_frontend *fe, u32 frequency)
0026 {
0027     struct dvb_frontend_ops *frontend_ops = &fe->ops;
0028     struct dvb_tuner_ops    *tuner_ops = &frontend_ops->tuner_ops;
0029     struct dtv_frontend_properties *c = &fe->dtv_property_cache;
0030     int err = 0;
0031 
0032     if (tuner_ops->set_params) {
0033         err = tuner_ops->set_params(fe);
0034         if (err < 0) {
0035             pr_err("%s: Invalid parameter\n", __func__);
0036             return err;
0037         }
0038     }
0039     pr_debug("%s: Frequency=%d\n", __func__, c->frequency);
0040     return 0;
0041 }
0042 
0043 static int tda8261_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
0044 {
0045     /* FIXME! need to calculate Bandwidth */
0046     *bandwidth = 40000000;
0047 
0048     return 0;
0049 }