cx25821-audio.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Driver for the Conexant CX25821 PCIe bridge
  4. *
  5. * Copyright (C) 2009 Conexant Systems Inc.
  6. * Authors <[email protected]>, <[email protected]>
  7. */
  8. #ifndef __CX25821_AUDIO_H__
  9. #define __CX25821_AUDIO_H__
  10. #define USE_RISC_NOOP 1
  11. #define LINES_PER_BUFFER 15
  12. #define AUDIO_LINE_SIZE 128
  13. /* Number of buffer programs to use at once. */
  14. #define NUMBER_OF_PROGRAMS 8
  15. /*
  16. * Max size of the RISC program for a buffer. - worst case is 2 writes per line
  17. * Space is also added for the 4 no-op instructions added on the end.
  18. */
  19. #ifndef USE_RISC_NOOP
  20. #define MAX_BUFFER_PROGRAM_SIZE \
  21. (2 * LINES_PER_BUFFER * RISC_WRITE_INSTRUCTION_SIZE + \
  22. RISC_WRITECR_INSTRUCTION_SIZE * 4)
  23. #endif
  24. /* MAE 12 July 2005 Try to use NOOP RISC instruction instead */
  25. #ifdef USE_RISC_NOOP
  26. #define MAX_BUFFER_PROGRAM_SIZE \
  27. (2 * LINES_PER_BUFFER * RISC_WRITE_INSTRUCTION_SIZE + \
  28. RISC_NOOP_INSTRUCTION_SIZE * 4)
  29. #endif
  30. /* Sizes of various instructions in bytes. Used when adding instructions. */
  31. #define RISC_WRITE_INSTRUCTION_SIZE 12
  32. #define RISC_JUMP_INSTRUCTION_SIZE 12
  33. #define RISC_SKIP_INSTRUCTION_SIZE 4
  34. #define RISC_SYNC_INSTRUCTION_SIZE 4
  35. #define RISC_WRITECR_INSTRUCTION_SIZE 16
  36. #define RISC_NOOP_INSTRUCTION_SIZE 4
  37. #define MAX_AUDIO_DMA_BUFFER_SIZE \
  38. (MAX_BUFFER_PROGRAM_SIZE * NUMBER_OF_PROGRAMS + \
  39. RISC_SYNC_INSTRUCTION_SIZE)
  40. #endif