af9013.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Afatech AF9013 demodulator driver
  4. *
  5. * Copyright (C) 2007 Antti Palosaari <crope@iki.fi>
  6. * Copyright (C) 2011 Antti Palosaari <crope@iki.fi>
  7. *
  8. * Thanks to Afatech who kindly provided information.
  9. */
  10. #ifndef AF9013_H
  11. #define AF9013_H
  12. #include <linux/dvb/frontend.h>
  13. /*
  14. * I2C address: 0x1c, 0x1d
  15. */
  16. /**
  17. * struct af9013_platform_data - Platform data for the af9013 driver
  18. * @clk: Clock frequency.
  19. * @tuner: Used tuner model.
  20. * @if_frequency: IF frequency.
  21. * @ts_mode: TS mode.
  22. * @ts_output_pin: TS output pin.
  23. * @spec_inv: Input spectrum inverted.
  24. * @api_version: Firmware API version.
  25. * @gpio: GPIOs.
  26. * @get_dvb_frontend: Get DVB frontend callback.
  27. * @get_i2c_adapter: Get I2C adapter.
  28. * @pid_filter_ctrl: Control PID filter.
  29. * @pid_filter: Set PID to PID filter.
  30. */
  31. struct af9013_platform_data {
  32. /*
  33. * 20480000, 25000000, 28000000, 28800000
  34. */
  35. u32 clk;
  36. #define AF9013_TUNER_MXL5003D 3 /* MaxLinear */
  37. #define AF9013_TUNER_MXL5005D 13 /* MaxLinear */
  38. #define AF9013_TUNER_MXL5005R 30 /* MaxLinear */
  39. #define AF9013_TUNER_ENV77H11D5 129 /* Panasonic */
  40. #define AF9013_TUNER_MT2060 130 /* Microtune */
  41. #define AF9013_TUNER_MC44S803 133 /* Freescale */
  42. #define AF9013_TUNER_QT1010 134 /* Quantek */
  43. #define AF9013_TUNER_UNKNOWN 140 /* for can tuners ? */
  44. #define AF9013_TUNER_MT2060_2 147 /* Microtune */
  45. #define AF9013_TUNER_TDA18271 156 /* NXP */
  46. #define AF9013_TUNER_QT1010A 162 /* Quantek */
  47. #define AF9013_TUNER_MXL5007T 177 /* MaxLinear */
  48. #define AF9013_TUNER_TDA18218 179 /* NXP */
  49. u8 tuner;
  50. u32 if_frequency;
  51. #define AF9013_TS_MODE_USB 0
  52. #define AF9013_TS_MODE_PARALLEL 1
  53. #define AF9013_TS_MODE_SERIAL 2
  54. u8 ts_mode;
  55. u8 ts_output_pin;
  56. bool spec_inv;
  57. u8 api_version[4];
  58. #define AF9013_GPIO_ON (1 << 0)
  59. #define AF9013_GPIO_EN (1 << 1)
  60. #define AF9013_GPIO_O (1 << 2)
  61. #define AF9013_GPIO_I (1 << 3)
  62. #define AF9013_GPIO_LO (AF9013_GPIO_ON|AF9013_GPIO_EN)
  63. #define AF9013_GPIO_HI (AF9013_GPIO_ON|AF9013_GPIO_EN|AF9013_GPIO_O)
  64. #define AF9013_GPIO_TUNER_ON (AF9013_GPIO_ON|AF9013_GPIO_EN)
  65. #define AF9013_GPIO_TUNER_OFF (AF9013_GPIO_ON|AF9013_GPIO_EN|AF9013_GPIO_O)
  66. u8 gpio[4];
  67. struct dvb_frontend* (*get_dvb_frontend)(struct i2c_client *);
  68. struct i2c_adapter* (*get_i2c_adapter)(struct i2c_client *);
  69. int (*pid_filter_ctrl)(struct dvb_frontend *, int);
  70. int (*pid_filter)(struct dvb_frontend *, u8, u16, int);
  71. };
  72. /*
  73. * AF9013/5 GPIOs (mostly guessed)
  74. * demod#1-gpio#0 - set demod#2 i2c-addr for dual devices
  75. * demod#1-gpio#1 - xtal setting (?)
  76. * demod#1-gpio#3 - tuner#1
  77. * demod#2-gpio#0 - tuner#2
  78. * demod#2-gpio#1 - xtal setting (?)
  79. */
  80. #endif /* AF9013_H */