digitv.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _DVB_USB_DIGITV_H_
  3. #define _DVB_USB_DIGITV_H_
  4. #define DVB_USB_LOG_PREFIX "digitv"
  5. #include "dvb-usb.h"
  6. struct digitv_state {
  7. int is_nxt6000;
  8. unsigned char sndbuf[7];
  9. unsigned char rcvbuf[7];
  10. };
  11. /* protocol (from usblogging and the SDK:
  12. *
  13. * Always 7 bytes bulk message(s) for controlling
  14. *
  15. * First byte describes the command. Reads are 2 consecutive transfer (as always).
  16. *
  17. * General structure:
  18. *
  19. * write or first message of a read:
  20. * <cmdbyte> VV <len> B0 B1 B2 B3
  21. *
  22. * second message of a read
  23. * <cmdbyte> VV <len> R0 R1 R2 R3
  24. *
  25. * whereas 0 < len <= 4
  26. *
  27. * I2C address is stored somewhere inside the device.
  28. *
  29. * 0x01 read from EEPROM
  30. * VV = offset; B* = 0; R* = value(s)
  31. *
  32. * 0x02 read register of the COFDM
  33. * VV = register; B* = 0; R* = value(s)
  34. *
  35. * 0x05 write register of the COFDM
  36. * VV = register; B* = value(s);
  37. *
  38. * 0x06 write to the tuner (only for NXT6000)
  39. * VV = 0; B* = PLL data; len = 4;
  40. *
  41. * 0x03 read remote control
  42. * VV = 0; B* = 0; len = 4; R* = key
  43. *
  44. * 0x07 write to the remote (don't know why one should this, resetting ?)
  45. * VV = 0; B* = key; len = 4;
  46. *
  47. * 0x08 write remote type
  48. * VV = 0; B[0] = 0x01, len = 4
  49. *
  50. * 0x09 write device init
  51. * TODO
  52. */
  53. #define USB_READ_EEPROM 1
  54. #define USB_READ_COFDM 2
  55. #define USB_WRITE_COFDM 5
  56. #define USB_WRITE_TUNER 6
  57. #define USB_READ_REMOTE 3
  58. #define USB_WRITE_REMOTE 7
  59. #define USB_WRITE_REMOTE_TYPE 8
  60. #define USB_DEV_INIT 9
  61. #endif