stv6110x.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. STV6110(A) Silicon tuner driver
  3. Copyright (C) Manu Abraham <abraham.manu@gmail.com>
  4. Copyright (C) ST Microelectronics
  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. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. */
  17. #ifndef __STV6110x_H
  18. #define __STV6110x_H
  19. struct stv6110x_config {
  20. u8 addr;
  21. u32 refclk;
  22. u8 clk_div; /* divisor value for the output clock */
  23. };
  24. enum tuner_mode {
  25. TUNER_SLEEP = 1,
  26. TUNER_WAKE,
  27. };
  28. enum tuner_status {
  29. TUNER_PHASELOCKED = 1,
  30. };
  31. struct stv6110x_devctl {
  32. int (*tuner_init) (struct dvb_frontend *fe);
  33. int (*tuner_sleep) (struct dvb_frontend *fe);
  34. int (*tuner_set_mode) (struct dvb_frontend *fe, enum tuner_mode mode);
  35. int (*tuner_set_frequency) (struct dvb_frontend *fe, u32 frequency);
  36. int (*tuner_get_frequency) (struct dvb_frontend *fe, u32 *frequency);
  37. int (*tuner_set_bandwidth) (struct dvb_frontend *fe, u32 bandwidth);
  38. int (*tuner_get_bandwidth) (struct dvb_frontend *fe, u32 *bandwidth);
  39. int (*tuner_set_bbgain) (struct dvb_frontend *fe, u32 gain);
  40. int (*tuner_get_bbgain) (struct dvb_frontend *fe, u32 *gain);
  41. int (*tuner_set_refclk) (struct dvb_frontend *fe, u32 refclk);
  42. int (*tuner_get_status) (struct dvb_frontend *fe, u32 *status);
  43. };
  44. #if IS_REACHABLE(CONFIG_DVB_STV6110x)
  45. extern struct stv6110x_devctl *stv6110x_attach(struct dvb_frontend *fe,
  46. const struct stv6110x_config *config,
  47. struct i2c_adapter *i2c);
  48. #else
  49. static inline struct stv6110x_devctl *stv6110x_attach(struct dvb_frontend *fe,
  50. const struct stv6110x_config *config,
  51. struct i2c_adapter *i2c)
  52. {
  53. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  54. return NULL;
  55. }
  56. #endif /* CONFIG_DVB_STV6110x */
  57. #endif /* __STV6110x_H */