si2165.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. Driver for Silicon Labs SI2165 DVB-C/-T Demodulator
  3. Copyright (C) 2013-2014 Matthias Schwarzott <zzam@gentoo.org>
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. References:
  13. http://www.silabs.com/Support%20Documents/TechnicalDocs/Si2165-short.pdf
  14. */
  15. #ifndef _DVB_SI2165_H
  16. #define _DVB_SI2165_H
  17. #include <linux/dvb/frontend.h>
  18. enum {
  19. SI2165_MODE_OFF = 0x00,
  20. SI2165_MODE_PLL_EXT = 0x20,
  21. SI2165_MODE_PLL_XTAL = 0x21
  22. };
  23. struct si2165_config {
  24. /* i2c addr
  25. * possible values: 0x64,0x65,0x66,0x67 */
  26. u8 i2c_addr;
  27. /* external clock or XTAL */
  28. u8 chip_mode;
  29. /* frequency of external clock or xtal in Hz
  30. * possible values: 4000000, 16000000, 20000000, 240000000, 27000000
  31. */
  32. u32 ref_freq_Hz;
  33. /* invert the spectrum */
  34. bool inversion;
  35. };
  36. #if IS_REACHABLE(CONFIG_DVB_SI2165)
  37. struct dvb_frontend *si2165_attach(
  38. const struct si2165_config *config,
  39. struct i2c_adapter *i2c);
  40. #else
  41. static inline struct dvb_frontend *si2165_attach(
  42. const struct si2165_config *config,
  43. struct i2c_adapter *i2c)
  44. {
  45. pr_warn("%s: driver disabled by Kconfig\n", __func__);
  46. return NULL;
  47. }
  48. #endif /* CONFIG_DVB_SI2165 */
  49. #endif /* _DVB_SI2165_H */