cxd2820r.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. * Sony CXD2820R demodulator driver
  3. *
  4. * Copyright (C) 2010 Antti Palosaari <crope@iki.fi>
  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 along
  17. * with this program; if not, write to the Free Software Foundation, Inc.,
  18. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  19. */
  20. #ifndef CXD2820R_H
  21. #define CXD2820R_H
  22. #include <linux/kconfig.h>
  23. #include <linux/dvb/frontend.h>
  24. #define CXD2820R_GPIO_D (0 << 0) /* disable */
  25. #define CXD2820R_GPIO_E (1 << 0) /* enable */
  26. #define CXD2820R_GPIO_O (0 << 1) /* output */
  27. #define CXD2820R_GPIO_I (1 << 1) /* input */
  28. #define CXD2820R_GPIO_L (0 << 2) /* output low */
  29. #define CXD2820R_GPIO_H (1 << 2) /* output high */
  30. #define CXD2820R_TS_SERIAL 0x08
  31. #define CXD2820R_TS_SERIAL_MSB 0x28
  32. #define CXD2820R_TS_PARALLEL 0x30
  33. #define CXD2820R_TS_PARALLEL_MSB 0x70
  34. struct cxd2820r_config {
  35. /* Demodulator I2C address.
  36. * Driver determines DVB-C slave I2C address automatically from master
  37. * address.
  38. * Default: none, must set
  39. * Values: 0x6c, 0x6d
  40. */
  41. u8 i2c_address;
  42. /* TS output mode.
  43. * Default: none, must set.
  44. * Values:
  45. */
  46. u8 ts_mode;
  47. /* TS clock inverted.
  48. * Default: 0
  49. * Values: 0, 1
  50. */
  51. bool ts_clock_inv;
  52. /* IF AGC polarity.
  53. * Default: 0
  54. * Values: 0, 1
  55. */
  56. bool if_agc_polarity;
  57. /* Spectrum inversion.
  58. * Default: 0
  59. * Values: 0, 1
  60. */
  61. bool spec_inv;
  62. };
  63. #if IS_REACHABLE(CONFIG_DVB_CXD2820R)
  64. extern struct dvb_frontend *cxd2820r_attach(
  65. const struct cxd2820r_config *config,
  66. struct i2c_adapter *i2c,
  67. int *gpio_chip_base
  68. );
  69. #else
  70. static inline struct dvb_frontend *cxd2820r_attach(
  71. const struct cxd2820r_config *config,
  72. struct i2c_adapter *i2c,
  73. int *gpio_chip_base
  74. )
  75. {
  76. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  77. return NULL;
  78. }
  79. #endif
  80. #endif /* CXD2820R_H */