cx24110.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. cx24110 - Single Chip Satellite Channel Receiver driver module
  4. Copyright (C) 2002 Peter Hettkamp <peter.hettkamp@htp-tel.de> based on
  5. work
  6. Copyright (C) 1999 Convergence Integrated Media GmbH <ralph@convergence.de>
  7. */
  8. #ifndef CX24110_H
  9. #define CX24110_H
  10. #include <linux/dvb/frontend.h>
  11. struct cx24110_config
  12. {
  13. /* the demodulator's i2c address */
  14. u8 demod_address;
  15. };
  16. static inline int cx24110_pll_write(struct dvb_frontend *fe, u32 val)
  17. {
  18. u8 buf[] = {
  19. (u8)((val >> 24) & 0xff),
  20. (u8)((val >> 16) & 0xff),
  21. (u8)((val >> 8) & 0xff)
  22. };
  23. if (fe->ops.write)
  24. return fe->ops.write(fe, buf, 3);
  25. return 0;
  26. }
  27. #if IS_REACHABLE(CONFIG_DVB_CX24110)
  28. extern struct dvb_frontend* cx24110_attach(const struct cx24110_config* config,
  29. struct i2c_adapter* i2c);
  30. #else
  31. static inline struct dvb_frontend* cx24110_attach(const struct cx24110_config* config,
  32. struct i2c_adapter* i2c)
  33. {
  34. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  35. return NULL;
  36. }
  37. #endif // CONFIG_DVB_CX24110
  38. #endif // CX24110_H