tda8261_cfg.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. struct tuner_state t_state;
  21. int err = 0;
  22. if (tuner_ops->get_state) {
  23. err = tuner_ops->get_state(fe, DVBFE_TUNER_FREQUENCY, &t_state);
  24. if (err < 0) {
  25. printk("%s: Invalid parameter\n", __func__);
  26. return err;
  27. }
  28. *frequency = t_state.frequency;
  29. printk("%s: Frequency=%d\n", __func__, t_state.frequency);
  30. }
  31. return 0;
  32. }
  33. static int tda8261_set_frequency(struct dvb_frontend *fe, u32 frequency)
  34. {
  35. struct dvb_frontend_ops *frontend_ops = &fe->ops;
  36. struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
  37. struct tuner_state t_state;
  38. int err = 0;
  39. t_state.frequency = frequency;
  40. if (tuner_ops->set_state) {
  41. err = tuner_ops->set_state(fe, DVBFE_TUNER_FREQUENCY, &t_state);
  42. if (err < 0) {
  43. printk("%s: Invalid parameter\n", __func__);
  44. return err;
  45. }
  46. }
  47. printk("%s: Frequency=%d\n", __func__, t_state.frequency);
  48. return 0;
  49. }
  50. static int tda8261_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
  51. {
  52. struct dvb_frontend_ops *frontend_ops = &fe->ops;
  53. struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
  54. struct tuner_state t_state;
  55. int err = 0;
  56. if (tuner_ops->get_state) {
  57. err = tuner_ops->get_state(fe, DVBFE_TUNER_BANDWIDTH, &t_state);
  58. if (err < 0) {
  59. printk("%s: Invalid parameter\n", __func__);
  60. return err;
  61. }
  62. *bandwidth = t_state.bandwidth;
  63. printk("%s: Bandwidth=%d\n", __func__, t_state.bandwidth);
  64. }
  65. return 0;
  66. }