1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Driver for the Conexant CX25821 PCIe bridge
5 * Copyright (C) 2009 Conexant Systems Inc.
6 * Authors <shu.lin@conexant.com>, <hiep.huynh@conexant.com>
9 #ifndef __CX25821_AUDIO_H__
10 #define __CX25821_AUDIO_H__
12 #define USE_RISC_NOOP 1
13 #define LINES_PER_BUFFER 15
14 #define AUDIO_LINE_SIZE 128
16 /* Number of buffer programs to use at once. */
17 #define NUMBER_OF_PROGRAMS 8
20 * Max size of the RISC program for a buffer. - worst case is 2 writes per line
21 * Space is also added for the 4 no-op instructions added on the end.
24 #define MAX_BUFFER_PROGRAM_SIZE \
25 (2 * LINES_PER_BUFFER * RISC_WRITE_INSTRUCTION_SIZE + \
26 RISC_WRITECR_INSTRUCTION_SIZE * 4)
29 /* MAE 12 July 2005 Try to use NOOP RISC instruction instead */
31 #define MAX_BUFFER_PROGRAM_SIZE \
32 (2 * LINES_PER_BUFFER * RISC_WRITE_INSTRUCTION_SIZE + \
33 RISC_NOOP_INSTRUCTION_SIZE * 4)
36 /* Sizes of various instructions in bytes. Used when adding instructions. */
37 #define RISC_WRITE_INSTRUCTION_SIZE 12
38 #define RISC_JUMP_INSTRUCTION_SIZE 12
39 #define RISC_SKIP_INSTRUCTION_SIZE 4
40 #define RISC_SYNC_INSTRUCTION_SIZE 4
41 #define RISC_WRITECR_INSTRUCTION_SIZE 16
42 #define RISC_NOOP_INSTRUCTION_SIZE 4
44 #define MAX_AUDIO_DMA_BUFFER_SIZE \
45 (MAX_BUFFER_PROGRAM_SIZE * NUMBER_OF_PROGRAMS + \
46 RISC_SYNC_INSTRUCTION_SIZE)