Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  *  Driver for the Conexant CX25821 PCIe bridge
0004  *
0005  *  Copyright (C) 2009 Conexant Systems Inc.
0006  *  Authors  <shu.lin@conexant.com>, <hiep.huynh@conexant.com>
0007  */
0008 
0009 #ifndef __CX25821_AUDIO_H__
0010 #define __CX25821_AUDIO_H__
0011 
0012 #define USE_RISC_NOOP       1
0013 #define LINES_PER_BUFFER    15
0014 #define AUDIO_LINE_SIZE     128
0015 
0016 /* Number of buffer programs to use at once. */
0017 #define NUMBER_OF_PROGRAMS  8
0018 
0019 /*
0020  * Max size of the RISC program for a buffer. - worst case is 2 writes per line
0021  * Space is also added for the 4 no-op instructions added on the end.
0022  */
0023 #ifndef USE_RISC_NOOP
0024 #define MAX_BUFFER_PROGRAM_SIZE                     \
0025     (2 * LINES_PER_BUFFER * RISC_WRITE_INSTRUCTION_SIZE +       \
0026      RISC_WRITECR_INSTRUCTION_SIZE * 4)
0027 #endif
0028 
0029 /* MAE 12 July 2005 Try to use NOOP RISC instruction instead */
0030 #ifdef USE_RISC_NOOP
0031 #define MAX_BUFFER_PROGRAM_SIZE                     \
0032     (2 * LINES_PER_BUFFER * RISC_WRITE_INSTRUCTION_SIZE +       \
0033      RISC_NOOP_INSTRUCTION_SIZE * 4)
0034 #endif
0035 
0036 /* Sizes of various instructions in bytes.  Used when adding instructions. */
0037 #define RISC_WRITE_INSTRUCTION_SIZE 12
0038 #define RISC_JUMP_INSTRUCTION_SIZE  12
0039 #define RISC_SKIP_INSTRUCTION_SIZE  4
0040 #define RISC_SYNC_INSTRUCTION_SIZE  4
0041 #define RISC_WRITECR_INSTRUCTION_SIZE   16
0042 #define RISC_NOOP_INSTRUCTION_SIZE  4
0043 
0044 #define MAX_AUDIO_DMA_BUFFER_SIZE                   \
0045     (MAX_BUFFER_PROGRAM_SIZE * NUMBER_OF_PROGRAMS +         \
0046      RISC_SYNC_INSTRUCTION_SIZE)
0047 
0048 #endif