gp8psk-fe.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * gp8psk_fe driver
  3. *
  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, or (at your option)
  7. * any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. */
  14. #ifndef GP8PSK_FE_H
  15. #define GP8PSK_FE_H
  16. #include <linux/types.h>
  17. /* gp8psk commands */
  18. #define GET_8PSK_CONFIG 0x80 /* in */
  19. #define SET_8PSK_CONFIG 0x81
  20. #define I2C_WRITE 0x83
  21. #define I2C_READ 0x84
  22. #define ARM_TRANSFER 0x85
  23. #define TUNE_8PSK 0x86
  24. #define GET_SIGNAL_STRENGTH 0x87 /* in */
  25. #define LOAD_BCM4500 0x88
  26. #define BOOT_8PSK 0x89 /* in */
  27. #define START_INTERSIL 0x8A /* in */
  28. #define SET_LNB_VOLTAGE 0x8B
  29. #define SET_22KHZ_TONE 0x8C
  30. #define SEND_DISEQC_COMMAND 0x8D
  31. #define SET_DVB_MODE 0x8E
  32. #define SET_DN_SWITCH 0x8F
  33. #define GET_SIGNAL_LOCK 0x90 /* in */
  34. #define GET_FW_VERS 0x92
  35. #define GET_SERIAL_NUMBER 0x93 /* in */
  36. #define USE_EXTRA_VOLT 0x94
  37. #define GET_FPGA_VERS 0x95
  38. #define CW3K_INIT 0x9d
  39. /* PSK_configuration bits */
  40. #define bm8pskStarted 0x01
  41. #define bm8pskFW_Loaded 0x02
  42. #define bmIntersilOn 0x04
  43. #define bmDVBmode 0x08
  44. #define bm22kHz 0x10
  45. #define bmSEL18V 0x20
  46. #define bmDCtuned 0x40
  47. #define bmArmed 0x80
  48. /* Satellite modulation modes */
  49. #define ADV_MOD_DVB_QPSK 0 /* DVB-S QPSK */
  50. #define ADV_MOD_TURBO_QPSK 1 /* Turbo QPSK */
  51. #define ADV_MOD_TURBO_8PSK 2 /* Turbo 8PSK (also used for Trellis 8PSK) */
  52. #define ADV_MOD_TURBO_16QAM 3 /* Turbo 16QAM (also used for Trellis 8PSK) */
  53. #define ADV_MOD_DCII_C_QPSK 4 /* Digicipher II Combo */
  54. #define ADV_MOD_DCII_I_QPSK 5 /* Digicipher II I-stream */
  55. #define ADV_MOD_DCII_Q_QPSK 6 /* Digicipher II Q-stream */
  56. #define ADV_MOD_DCII_C_OQPSK 7 /* Digicipher II offset QPSK */
  57. #define ADV_MOD_DSS_QPSK 8 /* DSS (DIRECTV) QPSK */
  58. #define ADV_MOD_DVB_BPSK 9 /* DVB-S BPSK */
  59. /* firmware revision id's */
  60. #define GP8PSK_FW_REV1 0x020604
  61. #define GP8PSK_FW_REV2 0x020704
  62. #define GP8PSK_FW_VERS(_fw_vers) \
  63. ((_fw_vers)[2]<<0x10 | (_fw_vers)[1]<<0x08 | (_fw_vers)[0])
  64. struct gp8psk_fe_ops {
  65. int (*in)(void *priv, u8 req, u16 value, u16 index, u8 *b, int blen);
  66. int (*out)(void *priv, u8 req, u16 value, u16 index, u8 *b, int blen);
  67. int (*reload)(void *priv);
  68. };
  69. struct dvb_frontend *gp8psk_fe_attach(const struct gp8psk_fe_ops *ops,
  70. void *priv, bool is_rev1);
  71. #endif