stv0288.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. Driver for ST STV0288 demodulator
  4. Copyright (C) 2006 Georg Acher, BayCom GmbH, acher (at) baycom (dot) de
  5. for Reel Multimedia
  6. Copyright (C) 2008 TurboSight.com, <bob@turbosight.com>
  7. Copyright (C) 2008 Igor M. Liplianin <liplianin@me.by>
  8. Removed stb6000 specific tuner code and revised some
  9. procedures.
  10. */
  11. #ifndef STV0288_H
  12. #define STV0288_H
  13. #include <linux/dvb/frontend.h>
  14. #include <media/dvb_frontend.h>
  15. struct stv0288_config {
  16. /* the demodulator's i2c address */
  17. u8 demod_address;
  18. u8* inittab;
  19. /* minimum delay before retuning */
  20. int min_delay_ms;
  21. int (*set_ts_params)(struct dvb_frontend *fe, int is_punctured);
  22. };
  23. #if IS_REACHABLE(CONFIG_DVB_STV0288)
  24. extern struct dvb_frontend *stv0288_attach(const struct stv0288_config *config,
  25. struct i2c_adapter *i2c);
  26. #else
  27. static inline struct dvb_frontend *stv0288_attach(const struct stv0288_config *config,
  28. struct i2c_adapter *i2c)
  29. {
  30. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  31. return NULL;
  32. }
  33. #endif /* CONFIG_DVB_STV0288 */
  34. static inline int stv0288_writereg(struct dvb_frontend *fe, u8 reg, u8 val)
  35. {
  36. int r = 0;
  37. u8 buf[] = { reg, val };
  38. if (fe->ops.write)
  39. r = fe->ops.write(fe, buf, 2);
  40. return r;
  41. }
  42. #endif /* STV0288_H */