mxl5xx.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Driver for the MaxLinear MxL5xx family of tuners/demods
  4. *
  5. * Copyright (C) 2014-2015 Ralph Metzler <[email protected]>
  6. * Marcus Metzler <[email protected]>
  7. * developed for Digital Devices GmbH
  8. *
  9. * based on code:
  10. * Copyright (c) 2011-2013 MaxLinear, Inc. All rights reserved
  11. * which was released under GPL V2
  12. */
  13. #ifndef _MXL5XX_H_
  14. #define _MXL5XX_H_
  15. #include <linux/types.h>
  16. #include <linux/i2c.h>
  17. #include <media/dvb_frontend.h>
  18. struct mxl5xx_cfg {
  19. u8 adr;
  20. u8 type;
  21. u32 cap;
  22. u32 clk;
  23. u32 ts_clk;
  24. u8 *fw;
  25. u32 fw_len;
  26. int (*fw_read)(void *priv, u8 *buf, u32 len);
  27. void *fw_priv;
  28. };
  29. #if IS_REACHABLE(CONFIG_DVB_MXL5XX)
  30. extern struct dvb_frontend *mxl5xx_attach(struct i2c_adapter *i2c,
  31. struct mxl5xx_cfg *cfg, u32 demod, u32 tuner,
  32. int (**fn_set_input)(struct dvb_frontend *, int));
  33. #else
  34. static inline struct dvb_frontend *mxl5xx_attach(struct i2c_adapter *i2c,
  35. struct mxl5xx_cfg *cfg, u32 demod, u32 tuner,
  36. int (**fn_set_input)(struct dvb_frontend *, int))
  37. {
  38. pr_warn("%s: driver disabled by Kconfig\n", __func__);
  39. return NULL;
  40. }
  41. #endif /* CONFIG_DVB_MXL5XX */
  42. #endif /* _MXL5XX_H_ */