stv6110x.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. STV6110(A) Silicon tuner driver
  4. Copyright (C) Manu Abraham <abraham.manu@gmail.com>
  5. Copyright (C) ST Microelectronics
  6. */
  7. #ifndef __STV6110x_H
  8. #define __STV6110x_H
  9. struct stv6110x_config {
  10. u8 addr;
  11. u32 refclk;
  12. u8 clk_div; /* divisor value for the output clock */
  13. struct dvb_frontend *frontend;
  14. struct stv6110x_devctl* (*get_devctl)(struct i2c_client *i2c);
  15. };
  16. enum tuner_mode {
  17. TUNER_SLEEP = 1,
  18. TUNER_WAKE,
  19. };
  20. enum tuner_status {
  21. TUNER_PHASELOCKED = 1,
  22. };
  23. struct stv6110x_devctl {
  24. int (*tuner_init) (struct dvb_frontend *fe);
  25. int (*tuner_sleep) (struct dvb_frontend *fe);
  26. int (*tuner_set_mode) (struct dvb_frontend *fe, enum tuner_mode mode);
  27. int (*tuner_set_frequency) (struct dvb_frontend *fe, u32 frequency);
  28. int (*tuner_get_frequency) (struct dvb_frontend *fe, u32 *frequency);
  29. int (*tuner_set_bandwidth) (struct dvb_frontend *fe, u32 bandwidth);
  30. int (*tuner_get_bandwidth) (struct dvb_frontend *fe, u32 *bandwidth);
  31. int (*tuner_set_bbgain) (struct dvb_frontend *fe, u32 gain);
  32. int (*tuner_get_bbgain) (struct dvb_frontend *fe, u32 *gain);
  33. int (*tuner_set_refclk) (struct dvb_frontend *fe, u32 refclk);
  34. int (*tuner_get_status) (struct dvb_frontend *fe, u32 *status);
  35. };
  36. #if IS_REACHABLE(CONFIG_DVB_STV6110x)
  37. extern const struct stv6110x_devctl *stv6110x_attach(struct dvb_frontend *fe,
  38. const struct stv6110x_config *config,
  39. struct i2c_adapter *i2c);
  40. #else
  41. static inline const struct stv6110x_devctl *stv6110x_attach(struct dvb_frontend *fe,
  42. const struct stv6110x_config *config,
  43. struct i2c_adapter *i2c)
  44. {
  45. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  46. return NULL;
  47. }
  48. #endif /* CONFIG_DVB_STV6110x */
  49. #endif /* __STV6110x_H */