devlml.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /* Lml 22 driver */
  2. #define MJPG_VERSION "LML33 v0.2"
  3. #define NLML 2
  4. /*
  5. * The following values can be modified to tune/set default behaviour of the
  6. * driver.
  7. */
  8. /* The number of uS delay in I2C state transitions (probably >= 10) */
  9. #define I2C_DELAY 50
  10. /* The amount of spinning to do before the I2C bus is timed out */
  11. #define I2C_TIMEOUT 10000000
  12. /* The amount of spinning to do before the guest bus is timed out */
  13. #define GUEST_TIMEOUT 10000000
  14. /*
  15. * The amount of spinning to do before the polling of the still
  16. * transfer port is aborted.
  17. */
  18. #define STILL_TIMEOUT 1000000
  19. /*
  20. * The following number is the maximum number of cards permited. Each
  21. * card found is mapped to a device minor number starting from 0.
  22. */
  23. #define MAX_CARDS 1
  24. /* The following are the datastructures needed by the device. */
  25. #define I2C_BUS 0x044
  26. /* which bit of I2C_BUS is which */
  27. #define I2C_SCL 1
  28. #define I2C_SDA 2
  29. #define INTR_JPEGREP 0x08000000
  30. #define INTR_GIRQ0 0x20000000
  31. #define INTR_STAT 0x03c
  32. /* A Device records the properties of the various card types supported. */
  33. typedef struct {
  34. int number; /* The H33_CARDTYPE_ assigned */
  35. char *card_name; /* A string name */
  36. int zr060addr; /* Which guest bus address for the ZR36060 */
  37. } Device;
  38. /*
  39. * The remainder of the #defs are constants which should not need changing.
  40. *
  41. * The PCI vendor and device ids of the zoran chipset on the dc30.
  42. * these really belong in pci.h.
  43. */
  44. #define VENDOR_ZORAN 0x11de
  45. #define ZORAN_36057 0x6057
  46. #define ZORAN_36067 ZORAN_36057
  47. #define BT819Addr 0x8a
  48. #define BT856Addr 0x88
  49. #define NBUF 4
  50. #define FRAGM_FINAL_B 1
  51. #define STAT_BIT 1
  52. typedef struct HdrFragment HdrFragment;
  53. typedef struct FrameHeader FrameHeader;
  54. typedef union Fragment Fragment;
  55. typedef struct FragmentTable FragmentTable;
  56. typedef struct CodeData CodeData;
  57. /* If we're on a little endian architecture, then 0xFF, 0xD8 byte sequence is */
  58. #define MRK_SOI 0xD8FF
  59. #define MRK_APP3 0xE3FF
  60. #define APP_NAME "LML"
  61. struct FrameHeader { /* Don't modify this struct, used by h/w */
  62. ushort mrkSOI;
  63. ushort mrkAPP3;
  64. ushort lenAPP3;
  65. char nm[4];
  66. ushort frameNo;
  67. vlong ftime;
  68. ulong frameSize;
  69. ushort frameSeqNo;
  70. ushort SOIfiller;
  71. };
  72. #define FRAGSIZE (128*1024)
  73. union Fragment {
  74. FrameHeader fh;
  75. char fb[FRAGSIZE];
  76. };
  77. struct HdrFragment {
  78. uchar hdr[sizeof(FrameHeader)];
  79. Fragment;
  80. };
  81. struct FragmentTable { /* Don't modify this struct, used by h/w */
  82. ulong addr; /* Physical address */
  83. ulong leng;
  84. };
  85. struct CodeData { /* Don't modify this struct, used by h/w */
  86. ulong pamjpg; /* Physical addr of statCom[0] */
  87. ulong pagrab; /* Physical addr of grab buffer */
  88. ulong statCom[4]; /* Physical addresses of fragdescs */
  89. FragmentTable fragdesc[4];
  90. HdrFragment frag[4];
  91. };
  92. enum{
  93. Codedatasize = (sizeof(CodeData) + BY2PG - 1) & ~(BY2PG - 1),
  94. Grabdatasize = (730 * 568 * 2 * 2 + BY2PG - 1) & ~(BY2PG - 1),
  95. };
  96. #define POST_OFFICE 0x200
  97. #define POST_PEND 0x02000000
  98. #define POST_TIME 0x01000000
  99. #define POST_DIR 0x00800000
  100. #define GID060 0