au88x0_wt.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /***************************************************************************
  3. * WT register offsets.
  4. *
  5. * Wed Oct 22 13:50:20 2003
  6. * Copyright 2003 mjander
  7. * mjander@users.sourceforge.org
  8. ****************************************************************************/
  9. #ifndef _AU88X0_WT_H
  10. #define _AU88X0_WT_H
  11. /* WT channels are grouped in banks. Each bank has 0x20 channels. */
  12. /* Bank register address boundary is 0x8000 */
  13. #define NR_WT_PB 0x20
  14. /* WT bank base register (as dword address). */
  15. #define WT_BAR(x) (((x)&0xffe0)<<0x8)
  16. #define WT_BANK(x) (x>>5)
  17. /* WT Bank registers */
  18. #define WT_CTRL(bank) (((((bank)&1)<<0xd) + 0x00)<<2) /* 0x0000 */
  19. #define WT_SRAMP(bank) (((((bank)&1)<<0xd) + 0x01)<<2) /* 0x0004 */
  20. #define WT_DSREG(bank) (((((bank)&1)<<0xd) + 0x02)<<2) /* 0x0008 */
  21. #define WT_MRAMP(bank) (((((bank)&1)<<0xd) + 0x03)<<2) /* 0x000c */
  22. #define WT_GMODE(bank) (((((bank)&1)<<0xd) + 0x04)<<2) /* 0x0010 */
  23. #define WT_ARAMP(bank) (((((bank)&1)<<0xd) + 0x05)<<2) /* 0x0014 */
  24. /* WT Voice registers */
  25. #define WT_STEREO(voice) ((WT_BAR(voice)+ 0x20 +(((voice)&0x1f)>>1))<<2) /* 0x0080 */
  26. #define WT_MUTE(voice) ((WT_BAR(voice)+ 0x40 +((voice)&0x1f))<<2) /* 0x0100 */
  27. #define WT_RUN(voice) ((WT_BAR(voice)+ 0x60 +((voice)&0x1f))<<2) /* 0x0180 */
  28. /* Some kind of parameters. */
  29. /* PARM0, PARM1 : Filter (0xFF000000), SampleRate (0x0000FFFF) */
  30. /* PARM2, PARM3 : Still unknown */
  31. #define WT_PARM(x,y) (((WT_BAR(x))+ 0x80 +(((x)&0x1f)<<2)+(y))<<2) /* 0x0200 */
  32. #define WT_DELAY(x,y) (((WT_BAR(x))+ 0x100 +(((x)&0x1f)<<2)+(y))<<2) /* 0x0400 */
  33. /* Numeric indexes used by SetReg() and GetReg() */
  34. #if 0
  35. enum {
  36. run = 0, /* 0 W 1:run 0:stop */
  37. parm0, /* 1 W filter, samplerate */
  38. parm1, /* 2 W filter, samplerate */
  39. parm2, /* 3 W */
  40. parm3, /* 4 RW volume. This value is calculated using floating point ops. */
  41. sramp, /* 5 W */
  42. mute, /* 6 W 1:mute, 0:unmute */
  43. gmode, /* 7 RO Looks like only bit0 is used. */
  44. aramp, /* 8 W */
  45. mramp, /* 9 W */
  46. ctrl, /* a W */
  47. delay, /* b W All 4 values are written at once with same value. */
  48. dsreg, /* c (R)W */
  49. } wt_reg;
  50. #endif
  51. typedef struct {
  52. u32 parm0; /* this_1E4 */
  53. u32 parm1; /* this_1E8 */
  54. u32 parm2; /* this_1EC */
  55. u32 parm3; /* this_1F0 */
  56. u32 this_1D0;
  57. } wt_voice_t;
  58. #endif /* _AU88X0_WT_H */
  59. /* End of file */