stv0288.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. Driver for ST STV0288 demodulator
  3. Copyright (C) 2006 Georg Acher, BayCom GmbH, acher (at) baycom (dot) de
  4. for Reel Multimedia
  5. Copyright (C) 2008 TurboSight.com, <bob@turbosight.com>
  6. Copyright (C) 2008 Igor M. Liplianin <liplianin@me.by>
  7. Removed stb6000 specific tuner code and revised some
  8. procedures.
  9. This program is free software; you can redistribute it and/or modify
  10. it under the terms of the GNU General Public License as published by
  11. the Free Software Foundation; either version 2 of the License, or
  12. (at your option) any later version.
  13. This program is distributed in the hope that it will be useful,
  14. but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. GNU General Public License for more details.
  17. You should have received a copy of the GNU General Public License
  18. along with this program; if not, write to the Free Software
  19. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. */
  21. #ifndef STV0288_H
  22. #define STV0288_H
  23. #include <linux/dvb/frontend.h>
  24. #include <media/dvb_frontend.h>
  25. struct stv0288_config {
  26. /* the demodulator's i2c address */
  27. u8 demod_address;
  28. u8* inittab;
  29. /* minimum delay before retuning */
  30. int min_delay_ms;
  31. int (*set_ts_params)(struct dvb_frontend *fe, int is_punctured);
  32. };
  33. #if IS_REACHABLE(CONFIG_DVB_STV0288)
  34. extern struct dvb_frontend *stv0288_attach(const struct stv0288_config *config,
  35. struct i2c_adapter *i2c);
  36. #else
  37. static inline struct dvb_frontend *stv0288_attach(const struct stv0288_config *config,
  38. struct i2c_adapter *i2c)
  39. {
  40. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  41. return NULL;
  42. }
  43. #endif /* CONFIG_DVB_STV0288 */
  44. static inline int stv0288_writereg(struct dvb_frontend *fe, u8 reg, u8 val)
  45. {
  46. int r = 0;
  47. u8 buf[] = { reg, val };
  48. if (fe->ops.write)
  49. r = fe->ops.write(fe, buf, 2);
  50. return r;
  51. }
  52. #endif /* STV0288_H */