cinergyT2.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * TerraTec Cinergy T2/qanu USB2 DVB-T adapter.
  4. *
  5. * Copyright (C) 2007 Tomi Orava ([email protected])
  6. *
  7. * Based on the dvb-usb-framework code and the
  8. * original Terratec Cinergy T2 driver by:
  9. *
  10. * Copyright (C) 2004 Daniel Mack <[email protected]> and
  11. * Holger Waechtler <[email protected]>
  12. *
  13. * Protocol Spec published on http://qanu.de/specs/terratec_cinergyT2.pdf
  14. */
  15. #ifndef _DVB_USB_CINERGYT2_H_
  16. #define _DVB_USB_CINERGYT2_H_
  17. #include <linux/usb/input.h>
  18. #define DVB_USB_LOG_PREFIX "cinergyT2"
  19. #include "dvb-usb.h"
  20. #define DRIVER_NAME "TerraTec/qanu USB2.0 Highspeed DVB-T Receiver"
  21. extern int dvb_usb_cinergyt2_debug;
  22. #define deb_info(args...) dprintk(dvb_usb_cinergyt2_debug, 0x001, args)
  23. #define deb_xfer(args...) dprintk(dvb_usb_cinergyt2_debug, 0x002, args)
  24. #define deb_pll(args...) dprintk(dvb_usb_cinergyt2_debug, 0x004, args)
  25. #define deb_ts(args...) dprintk(dvb_usb_cinergyt2_debug, 0x008, args)
  26. #define deb_err(args...) dprintk(dvb_usb_cinergyt2_debug, 0x010, args)
  27. #define deb_rc(args...) dprintk(dvb_usb_cinergyt2_debug, 0x020, args)
  28. #define deb_fw(args...) dprintk(dvb_usb_cinergyt2_debug, 0x040, args)
  29. #define deb_mem(args...) dprintk(dvb_usb_cinergyt2_debug, 0x080, args)
  30. #define deb_uxfer(args...) dprintk(dvb_usb_cinergyt2_debug, 0x100, args)
  31. enum cinergyt2_ep1_cmd {
  32. CINERGYT2_EP1_PID_TABLE_RESET = 0x01,
  33. CINERGYT2_EP1_PID_SETUP = 0x02,
  34. CINERGYT2_EP1_CONTROL_STREAM_TRANSFER = 0x03,
  35. CINERGYT2_EP1_SET_TUNER_PARAMETERS = 0x04,
  36. CINERGYT2_EP1_GET_TUNER_STATUS = 0x05,
  37. CINERGYT2_EP1_START_SCAN = 0x06,
  38. CINERGYT2_EP1_CONTINUE_SCAN = 0x07,
  39. CINERGYT2_EP1_GET_RC_EVENTS = 0x08,
  40. CINERGYT2_EP1_SLEEP_MODE = 0x09,
  41. CINERGYT2_EP1_GET_FIRMWARE_VERSION = 0x0A
  42. };
  43. struct dvbt_get_status_msg {
  44. uint32_t freq;
  45. uint8_t bandwidth;
  46. uint16_t tps;
  47. uint8_t flags;
  48. __le16 gain;
  49. uint8_t snr;
  50. __le32 viterbi_error_rate;
  51. uint32_t rs_error_rate;
  52. __le32 uncorrected_block_count;
  53. uint8_t lock_bits;
  54. uint8_t prev_lock_bits;
  55. } __attribute__((packed));
  56. struct dvbt_set_parameters_msg {
  57. uint8_t cmd;
  58. __le32 freq;
  59. uint8_t bandwidth;
  60. __le16 tps;
  61. uint8_t flags;
  62. } __attribute__((packed));
  63. extern struct dvb_frontend *cinergyt2_fe_attach(struct dvb_usb_device *d);
  64. #endif /* _DVB_USB_CINERGYT2_H_ */