si21xx.h 785 B

123456789101112131415161718192021222324252627282930313233343536
  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 IS_REACHABLE(CONFIG_DVB_SI21XX)
  12. extern struct dvb_frontend *si21xx_attach(const struct si21xx_config *config,
  13. struct i2c_adapter *i2c);
  14. #else
  15. static inline struct dvb_frontend *si21xx_attach(
  16. const struct si21xx_config *config, struct i2c_adapter *i2c)
  17. {
  18. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  19. return NULL;
  20. }
  21. #endif
  22. static inline int si21xx_writeregister(struct dvb_frontend *fe, u8 reg, u8 val)
  23. {
  24. int r = 0;
  25. u8 buf[] = {reg, val};
  26. if (fe->ops.write)
  27. r = fe->ops.write(fe, buf, 2);
  28. return r;
  29. }
  30. #endif