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/kconfig.h>
  24. #include <linux/dvb/frontend.h>
  25. #include "dvb_frontend.h"
  26. struct stv0288_config {
  27. /* the demodulator's i2c address */
  28. u8 demod_address;
  29. u8* inittab;
  30. /* minimum delay before retuning */
  31. int min_delay_ms;
  32. int (*set_ts_params)(struct dvb_frontend *fe, int is_punctured);
  33. };
  34. #if IS_REACHABLE(CONFIG_DVB_STV0288)
  35. extern struct dvb_frontend *stv0288_attach(const struct stv0288_config *config,
  36. struct i2c_adapter *i2c);
  37. #else
  38. static inline struct dvb_frontend *stv0288_attach(const struct stv0288_config *config,
  39. struct i2c_adapter *i2c)
  40. {
  41. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  42. return NULL;
  43. }
  44. #endif /* CONFIG_DVB_STV0288 */
  45. static inline int stv0288_writereg(struct dvb_frontend *fe, u8 reg, u8 val)
  46. {
  47. int r = 0;
  48. u8 buf[] = { reg, val };
  49. if (fe->ops.write)
  50. r = fe->ops.write(fe, buf, 2);
  51. return r;
  52. }
  53. #endif /* STV0288_H */