cx25821-audio.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Driver for the Conexant CX25821 PCIe bridge
  3. *
  4. * Copyright (C) 2009 Conexant Systems Inc.
  5. * Authors <shu.lin@conexant.com>, <hiep.huynh@conexant.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. *
  16. * GNU General Public License for more details.
  17. */
  18. #ifndef __CX25821_AUDIO_H__
  19. #define __CX25821_AUDIO_H__
  20. #define USE_RISC_NOOP 1
  21. #define LINES_PER_BUFFER 15
  22. #define AUDIO_LINE_SIZE 128
  23. /* Number of buffer programs to use at once. */
  24. #define NUMBER_OF_PROGRAMS 8
  25. /*
  26. * Max size of the RISC program for a buffer. - worst case is 2 writes per line
  27. * Space is also added for the 4 no-op instructions added on the end.
  28. */
  29. #ifndef USE_RISC_NOOP
  30. #define MAX_BUFFER_PROGRAM_SIZE \
  31. (2 * LINES_PER_BUFFER * RISC_WRITE_INSTRUCTION_SIZE + \
  32. RISC_WRITECR_INSTRUCTION_SIZE * 4)
  33. #endif
  34. /* MAE 12 July 2005 Try to use NOOP RISC instruction instead */
  35. #ifdef USE_RISC_NOOP
  36. #define MAX_BUFFER_PROGRAM_SIZE \
  37. (2 * LINES_PER_BUFFER * RISC_WRITE_INSTRUCTION_SIZE + \
  38. RISC_NOOP_INSTRUCTION_SIZE * 4)
  39. #endif
  40. /* Sizes of various instructions in bytes. Used when adding instructions. */
  41. #define RISC_WRITE_INSTRUCTION_SIZE 12
  42. #define RISC_JUMP_INSTRUCTION_SIZE 12
  43. #define RISC_SKIP_INSTRUCTION_SIZE 4
  44. #define RISC_SYNC_INSTRUCTION_SIZE 4
  45. #define RISC_WRITECR_INSTRUCTION_SIZE 16
  46. #define RISC_NOOP_INSTRUCTION_SIZE 4
  47. #define MAX_AUDIO_DMA_BUFFER_SIZE \
  48. (MAX_BUFFER_PROGRAM_SIZE * NUMBER_OF_PROGRAMS + \
  49. RISC_SYNC_INSTRUCTION_SIZE)
  50. #endif