tda8261_cfg.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. TDA8261 8PSK/QPSK tuner driver
  3. Copyright (C) Manu Abraham (abraham.manu@gmail.com)
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15. */
  16. static int tda8261_get_frequency(struct dvb_frontend *fe, u32 *frequency)
  17. {
  18. struct dvb_frontend_ops *frontend_ops = &fe->ops;
  19. struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
  20. int err = 0;
  21. if (tuner_ops->get_frequency) {
  22. err = tuner_ops->get_frequency(fe, frequency);
  23. if (err < 0) {
  24. pr_err("%s: Invalid parameter\n", __func__);
  25. return err;
  26. }
  27. pr_debug("%s: Frequency=%d\n", __func__, *frequency);
  28. }
  29. return 0;
  30. }
  31. static int tda8261_set_frequency(struct dvb_frontend *fe, u32 frequency)
  32. {
  33. struct dvb_frontend_ops *frontend_ops = &fe->ops;
  34. struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
  35. struct dtv_frontend_properties *c = &fe->dtv_property_cache;
  36. int err = 0;
  37. if (tuner_ops->set_params) {
  38. err = tuner_ops->set_params(fe);
  39. if (err < 0) {
  40. pr_err("%s: Invalid parameter\n", __func__);
  41. return err;
  42. }
  43. }
  44. pr_debug("%s: Frequency=%d\n", __func__, c->frequency);
  45. return 0;
  46. }
  47. static int tda8261_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
  48. {
  49. /* FIXME! need to calculate Bandwidth */
  50. *bandwidth = 40000000;
  51. return 0;
  52. }