si21xx.h 842 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef SI21XX_H
  2. #define SI21XX_H
  3. #include <linux/dvb/frontend.h>
  4. #include "dvb_frontend.h"
  5. struct si21xx_config {
  6. /* the demodulator's i2c address */
  7. u8 demod_address;
  8. /* minimum delay before retuning */
  9. int min_delay_ms;
  10. };
  11. #if defined(CONFIG_DVB_SI21XX) || \
  12. (defined(CONFIG_DVB_SI21XX_MODULE) && defined(MODULE))
  13. extern struct dvb_frontend *si21xx_attach(const struct si21xx_config *config,
  14. struct i2c_adapter *i2c);
  15. #else
  16. static inline struct dvb_frontend *si21xx_attach(
  17. const struct si21xx_config *config, struct i2c_adapter *i2c)
  18. {
  19. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  20. return NULL;
  21. }
  22. #endif
  23. static inline int si21xx_writeregister(struct dvb_frontend *fe, u8 reg, u8 val)
  24. {
  25. int r = 0;
  26. u8 buf[] = {reg, val};
  27. if (fe->ops.write)
  28. r = fe->ops.write(fe, buf, 2);
  29. return r;
  30. }
  31. #endif