si21xx.h 812 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef SI21XX_H
  2. #define SI21XX_H
  3. #include <linux/kconfig.h>
  4. #include <linux/dvb/frontend.h>
  5. #include "dvb_frontend.h"
  6. struct si21xx_config {
  7. /* the demodulator's i2c address */
  8. u8 demod_address;
  9. /* minimum delay before retuning */
  10. int min_delay_ms;
  11. };
  12. #if IS_REACHABLE(CONFIG_DVB_SI21XX)
  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