tda8261_cfg.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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)
  5. */
  6. static int tda8261_get_frequency(struct dvb_frontend *fe, u32 *frequency)
  7. {
  8. struct dvb_frontend_ops *frontend_ops = &fe->ops;
  9. struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
  10. int err = 0;
  11. if (tuner_ops->get_frequency) {
  12. err = tuner_ops->get_frequency(fe, frequency);
  13. if (err < 0) {
  14. pr_err("%s: Invalid parameter\n", __func__);
  15. return err;
  16. }
  17. pr_debug("%s: Frequency=%d\n", __func__, *frequency);
  18. }
  19. return 0;
  20. }
  21. static int tda8261_set_frequency(struct dvb_frontend *fe, u32 frequency)
  22. {
  23. struct dvb_frontend_ops *frontend_ops = &fe->ops;
  24. struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
  25. struct dtv_frontend_properties *c = &fe->dtv_property_cache;
  26. int err = 0;
  27. if (tuner_ops->set_params) {
  28. err = tuner_ops->set_params(fe);
  29. if (err < 0) {
  30. pr_err("%s: Invalid parameter\n", __func__);
  31. return err;
  32. }
  33. }
  34. pr_debug("%s: Frequency=%d\n", __func__, c->frequency);
  35. return 0;
  36. }
  37. static int tda8261_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
  38. {
  39. /* FIXME! need to calculate Bandwidth */
  40. *bandwidth = 40000000;
  41. return 0;
  42. }