m920x.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #ifndef _DVB_USB_M920X_H_
  2. #define _DVB_USB_M920X_H_
  3. #define DVB_USB_LOG_PREFIX "m920x"
  4. #include "dvb-usb.h"
  5. #define deb(args...) dprintk(dvb_usb_m920x_debug,0x01,args)
  6. #define M9206_CORE 0x22
  7. #define M9206_RC_STATE 0xff51
  8. #define M9206_RC_KEY 0xff52
  9. #define M9206_RC_INIT1 0xff54
  10. #define M9206_RC_INIT2 0xff55
  11. #define M9206_FW_GO 0xff69
  12. #define M9206_I2C 0x23
  13. #define M9206_FILTER 0x25
  14. #define M9206_FW 0x30
  15. #define M9206_MAX_FILTERS 8
  16. #define M9206_MAX_ADAPTERS 4
  17. /*
  18. sequences found in logs:
  19. [index value]
  20. 0x80 write addr
  21. (0x00 out byte)*
  22. 0x40 out byte
  23. 0x80 write addr
  24. (0x00 out byte)*
  25. 0x80 read addr
  26. (0x21 in byte)*
  27. 0x60 in byte
  28. this sequence works:
  29. 0x80 read addr
  30. (0x21 in byte)*
  31. 0x60 in byte
  32. Guess at API of the I2C function:
  33. I2C operation is done one byte at a time with USB control messages. The
  34. index the messages is sent to is made up of a set of flags that control
  35. the I2C bus state:
  36. 0x80: Send START condition. After a START condition, one would normally
  37. always send the 7-bit slave I2C address as the 7 MSB, followed by
  38. the read/write bit as the LSB.
  39. 0x40: Send STOP condition. This should be set on the last byte of an
  40. I2C transaction.
  41. 0x20: Read a byte from the slave. As opposed to writing a byte to the
  42. slave. The slave will normally not produce any data unless you
  43. set the R/W bit to 1 when sending the slave's address after the
  44. START condition.
  45. 0x01: Respond with ACK, as opposed to a NACK. For a multi-byte read,
  46. the master should send an ACK, that is pull SDA low during the 9th
  47. clock cycle, after every byte but the last. This flags only makes
  48. sense when bit 0x20 is set, indicating a read.
  49. What any other bits might mean, or how to get the slave's ACK/NACK
  50. response to a write, is unknown.
  51. */
  52. struct m920x_state {
  53. u16 filters[M9206_MAX_ADAPTERS][M9206_MAX_FILTERS];
  54. int filtering_enabled[M9206_MAX_ADAPTERS];
  55. int rep_count;
  56. };
  57. /* Initialisation data for the m920x
  58. */
  59. struct m920x_inits {
  60. u16 address;
  61. u8 data;
  62. };
  63. #endif