gp8psk.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /* DVB USB compliant Linux driver for the
  2. * - GENPIX 8pks/qpsk/DCII USB2.0 DVB-S module
  3. *
  4. * Copyright (C) 2006 Alan Nisota (alannisota@gmail.com)
  5. * Copyright (C) 2006,2007 Alan Nisota (alannisota@gmail.com)
  6. *
  7. * Thanks to GENPIX for the sample code used to implement this module.
  8. *
  9. * This module is based off the vp7045 and vp702x modules
  10. *
  11. * This program is free software; you can redistribute it and/or modify it
  12. * under the terms of the GNU General Public License as published by the Free
  13. * Software Foundation, version 2.
  14. *
  15. * see Documentation/dvb/README.dvb-usb for more information
  16. */
  17. #ifndef _DVB_USB_GP8PSK_H_
  18. #define _DVB_USB_GP8PSK_H_
  19. #define DVB_USB_LOG_PREFIX "gp8psk"
  20. #include "dvb-usb.h"
  21. extern int dvb_usb_gp8psk_debug;
  22. #define deb_info(args...) dprintk(dvb_usb_gp8psk_debug,0x01,args)
  23. #define deb_xfer(args...) dprintk(dvb_usb_gp8psk_debug,0x02,args)
  24. #define deb_rc(args...) dprintk(dvb_usb_gp8psk_debug,0x04,args)
  25. #define deb_fe(args...) dprintk(dvb_usb_gp8psk_debug,0x08,args)
  26. /* Twinhan Vendor requests */
  27. #define TH_COMMAND_IN 0xC0
  28. #define TH_COMMAND_OUT 0xC1
  29. /* gp8psk commands */
  30. #define GET_8PSK_CONFIG 0x80 /* in */
  31. #define SET_8PSK_CONFIG 0x81
  32. #define I2C_WRITE 0x83
  33. #define I2C_READ 0x84
  34. #define ARM_TRANSFER 0x85
  35. #define TUNE_8PSK 0x86
  36. #define GET_SIGNAL_STRENGTH 0x87 /* in */
  37. #define LOAD_BCM4500 0x88
  38. #define BOOT_8PSK 0x89 /* in */
  39. #define START_INTERSIL 0x8A /* in */
  40. #define SET_LNB_VOLTAGE 0x8B
  41. #define SET_22KHZ_TONE 0x8C
  42. #define SEND_DISEQC_COMMAND 0x8D
  43. #define SET_DVB_MODE 0x8E
  44. #define SET_DN_SWITCH 0x8F
  45. #define GET_SIGNAL_LOCK 0x90 /* in */
  46. #define GET_FW_VERS 0x92
  47. #define GET_SERIAL_NUMBER 0x93 /* in */
  48. #define USE_EXTRA_VOLT 0x94
  49. #define GET_FPGA_VERS 0x95
  50. #define CW3K_INIT 0x9d
  51. /* PSK_configuration bits */
  52. #define bm8pskStarted 0x01
  53. #define bm8pskFW_Loaded 0x02
  54. #define bmIntersilOn 0x04
  55. #define bmDVBmode 0x08
  56. #define bm22kHz 0x10
  57. #define bmSEL18V 0x20
  58. #define bmDCtuned 0x40
  59. #define bmArmed 0x80
  60. /* Satellite modulation modes */
  61. #define ADV_MOD_DVB_QPSK 0 /* DVB-S QPSK */
  62. #define ADV_MOD_TURBO_QPSK 1 /* Turbo QPSK */
  63. #define ADV_MOD_TURBO_8PSK 2 /* Turbo 8PSK (also used for Trellis 8PSK) */
  64. #define ADV_MOD_TURBO_16QAM 3 /* Turbo 16QAM (also used for Trellis 8PSK) */
  65. #define ADV_MOD_DCII_C_QPSK 4 /* Digicipher II Combo */
  66. #define ADV_MOD_DCII_I_QPSK 5 /* Digicipher II I-stream */
  67. #define ADV_MOD_DCII_Q_QPSK 6 /* Digicipher II Q-stream */
  68. #define ADV_MOD_DCII_C_OQPSK 7 /* Digicipher II offset QPSK */
  69. #define ADV_MOD_DSS_QPSK 8 /* DSS (DIRECTV) QPSK */
  70. #define ADV_MOD_DVB_BPSK 9 /* DVB-S BPSK */
  71. #define GET_USB_SPEED 0x07
  72. #define USB_SPEED_LOW 0
  73. #define USB_SPEED_FULL 1
  74. #define USB_SPEED_HIGH 2
  75. #define RESET_FX2 0x13
  76. #define FW_VERSION_READ 0x0B
  77. #define VENDOR_STRING_READ 0x0C
  78. #define PRODUCT_STRING_READ 0x0D
  79. #define FW_BCD_VERSION_READ 0x14
  80. /* firmware revision id's */
  81. #define GP8PSK_FW_REV1 0x020604
  82. #define GP8PSK_FW_REV2 0x020704
  83. #define GP8PSK_FW_VERS(_fw_vers) ((_fw_vers)[2]<<0x10 | (_fw_vers)[1]<<0x08 | (_fw_vers)[0])
  84. extern struct dvb_frontend * gp8psk_fe_attach(struct dvb_usb_device *d);
  85. extern int gp8psk_usb_in_op(struct dvb_usb_device *d, u8 req, u16 value, u16 index, u8 *b, int blen);
  86. extern int gp8psk_usb_out_op(struct dvb_usb_device *d, u8 req, u16 value,
  87. u16 index, u8 *b, int blen);
  88. extern int gp8psk_bcm4500_reload(struct dvb_usb_device *d);
  89. #endif