lg2160.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. * Support for LG2160 - ATSC/MH
  3. *
  4. * Copyright (C) 2010 Michael Krufky <mkrufky@linuxtv.org>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. *
  20. */
  21. #ifndef _LG2160_H_
  22. #define _LG2160_H_
  23. #include <linux/kconfig.h>
  24. #include <linux/i2c.h>
  25. #include "dvb_frontend.h"
  26. enum lg_chip_type {
  27. LG2160 = 0,
  28. LG2161 = 1,
  29. };
  30. #define LG2161_1019 LG2161
  31. #define LG2161_1040 LG2161
  32. enum lg2160_spi_clock {
  33. LG2160_SPI_3_125_MHZ = 0,
  34. LG2160_SPI_6_25_MHZ = 1,
  35. LG2160_SPI_12_5_MHZ = 2,
  36. };
  37. #if 0
  38. enum lg2161_oif {
  39. LG2161_OIF_EBI2_SLA = 1,
  40. LG2161_OIF_SDIO_SLA = 2,
  41. LG2161_OIF_SPI_SLA = 3,
  42. LG2161_OIF_SPI_MAS = 4,
  43. LG2161_OIF_SERIAL_TS = 7,
  44. };
  45. #endif
  46. struct lg2160_config {
  47. u8 i2c_addr;
  48. /* user defined IF frequency in KHz */
  49. u16 if_khz;
  50. /* disable i2c repeater - 0:repeater enabled 1:repeater disabled */
  51. unsigned int deny_i2c_rptr:1;
  52. /* spectral inversion - 0:disabled 1:enabled */
  53. unsigned int spectral_inversion:1;
  54. unsigned int output_if;
  55. enum lg2160_spi_clock spi_clock;
  56. enum lg_chip_type lg_chip;
  57. };
  58. #if IS_REACHABLE(CONFIG_DVB_LG2160)
  59. extern
  60. struct dvb_frontend *lg2160_attach(const struct lg2160_config *config,
  61. struct i2c_adapter *i2c_adap);
  62. #else
  63. static inline
  64. struct dvb_frontend *lg2160_attach(const struct lg2160_config *config,
  65. struct i2c_adapter *i2c_adap)
  66. {
  67. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  68. return NULL;
  69. }
  70. #endif /* CONFIG_DVB_LG2160 */
  71. #endif /* _LG2160_H_ */