stv0288.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 "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 defined(CONFIG_DVB_STV0288) || (defined(CONFIG_DVB_STV0288_MODULE) && \
  34. defined(MODULE))
  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 */