mxl5xx.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 <rjkm@metzlerbros.de>
  6. * Marcus Metzler <mocm@metzlerbros.de>
  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. * This program is free software; you can redistribute it and/or
  14. * modify it under the terms of the GNU General Public License
  15. * version 2, as published by the Free Software Foundation.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU General Public License for more details.
  21. */
  22. #ifndef _MXL5XX_H_
  23. #define _MXL5XX_H_
  24. #include <linux/types.h>
  25. #include <linux/i2c.h>
  26. #include <media/dvb_frontend.h>
  27. struct mxl5xx_cfg {
  28. u8 adr;
  29. u8 type;
  30. u32 cap;
  31. u32 clk;
  32. u32 ts_clk;
  33. u8 *fw;
  34. u32 fw_len;
  35. int (*fw_read)(void *priv, u8 *buf, u32 len);
  36. void *fw_priv;
  37. };
  38. #if IS_REACHABLE(CONFIG_DVB_MXL5XX)
  39. extern struct dvb_frontend *mxl5xx_attach(struct i2c_adapter *i2c,
  40. struct mxl5xx_cfg *cfg, u32 demod, u32 tuner,
  41. int (**fn_set_input)(struct dvb_frontend *, int));
  42. #else
  43. static inline struct dvb_frontend *mxl5xx_attach(struct i2c_adapter *i2c,
  44. struct mxl5xx_cfg *cfg, u32 demod, u32 tuner,
  45. int (**fn_set_input)(struct dvb_frontend *, int))
  46. {
  47. pr_warn("%s: driver disabled by Kconfig\n", __func__);
  48. return NULL;
  49. }
  50. #endif /* CONFIG_DVB_MXL5XX */
  51. #endif /* _MXL5XX_H_ */