cx24120.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * Conexant CX24120/CX24118 - DVB-S/S2 demod/tuner driver
  3. *
  4. * Copyright (C) 2008 Patrick Boettcher <pb@linuxtv.org>
  5. * Copyright (C) 2009 Sergey Tyurin <forum.free-x.de>
  6. * Updated 2012 by Jannis Achstetter <jannis_achstetter@web.de>
  7. * Copyright (C) 2015 Jemma Denson <jdenson@gmail.com>
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 2 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. */
  19. #ifndef CX24120_H
  20. #define CX24120_H
  21. #include <linux/kconfig.h>
  22. #include <linux/dvb/frontend.h>
  23. #include <linux/firmware.h>
  24. struct cx24120_initial_mpeg_config {
  25. u8 x1;
  26. u8 x2;
  27. u8 x3;
  28. };
  29. struct cx24120_config {
  30. u8 i2c_addr;
  31. u32 xtal_khz;
  32. struct cx24120_initial_mpeg_config initial_mpeg_config;
  33. int (*request_firmware)(struct dvb_frontend *fe,
  34. const struct firmware **fw, char *name);
  35. /* max bytes I2C provider can write at once */
  36. u16 i2c_wr_max;
  37. };
  38. #if IS_REACHABLE(CONFIG_DVB_CX24120)
  39. struct dvb_frontend *cx24120_attach(const struct cx24120_config *config,
  40. struct i2c_adapter *i2c);
  41. #else
  42. static inline
  43. struct dvb_frontend *cx24120_attach(const struct cx24120_config *config,
  44. struct i2c_adapter *i2c)
  45. {
  46. pr_warn("%s: driver disabled by Kconfig\n", __func__);
  47. return NULL;
  48. }
  49. #endif
  50. #endif /* CX24120_H */