stv6110x.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. };
  23. enum tuner_mode {
  24. TUNER_SLEEP = 1,
  25. TUNER_WAKE,
  26. };
  27. enum tuner_status {
  28. TUNER_PHASELOCKED = 1,
  29. };
  30. struct stv6110x_devctl {
  31. int (*tuner_init) (struct dvb_frontend *fe);
  32. int (*tuner_set_mode) (struct dvb_frontend *fe, enum tuner_mode mode);
  33. int (*tuner_set_frequency) (struct dvb_frontend *fe, u32 frequency);
  34. int (*tuner_get_frequency) (struct dvb_frontend *fe, u32 *frequency);
  35. int (*tuner_set_bandwidth) (struct dvb_frontend *fe, u32 bandwidth);
  36. int (*tuner_get_bandwidth) (struct dvb_frontend *fe, u32 *bandwidth);
  37. int (*tuner_set_bbgain) (struct dvb_frontend *fe, u32 gain);
  38. int (*tuner_get_bbgain) (struct dvb_frontend *fe, u32 *gain);
  39. int (*tuner_set_refclk) (struct dvb_frontend *fe, u32 refclk);
  40. int (*tuner_get_status) (struct dvb_frontend *fe, u32 *status);
  41. };
  42. #if defined(CONFIG_DVB_STV6110x) || (defined(CONFIG_DVB_STV6110x_MODULE) && defined(MODULE))
  43. extern struct stv6110x_devctl *stv6110x_attach(struct dvb_frontend *fe,
  44. const struct stv6110x_config *config,
  45. struct i2c_adapter *i2c);
  46. #else
  47. static inline struct stv6110x_devctl *stv6110x_attach(struct dvb_frontend *fe,
  48. const struct stv6110x_config *config,
  49. struct i2c_adapter *i2c)
  50. {
  51. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  52. return NULL;
  53. }
  54. #endif /* CONFIG_DVB_STV6110x */
  55. #endif /* __STV6110x_H */