Linux-libre 4.14.44-gnu
[librecmc/linux-libre.git] / drivers / media / pci / cx25821 / cx25821-audio-upstream.h
1 /*
2  *  Driver for the Conexant CX25821 PCIe bridge
3  *
4  *  Copyright (C) 2009 Conexant Systems Inc.
5  *  Authors  <hiep.huynh@conexant.com>, <shu.lin@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
19 #include <linux/mutex.h>
20 #include <linux/workqueue.h>
21
22 #define NUM_AUDIO_PROGS       8
23 #define NUM_AUDIO_FRAMES      8
24 #define END_OF_FILE           0
25 #define IN_PROGRESS           1
26 #define RESET_STATUS          -1
27 #define FIFO_DISABLE          0
28 #define FIFO_ENABLE           1
29 #define NUM_NO_OPS            4
30
31 #define RISC_READ_INSTRUCTION_SIZE      12
32 #define RISC_JUMP_INSTRUCTION_SIZE      12
33 #define RISC_WRITECR_INSTRUCTION_SIZE   16
34 #define RISC_SYNC_INSTRUCTION_SIZE      4
35 #define DWORD_SIZE                      4
36 #define AUDIO_SYNC_LINE                 4
37
38 #define LINES_PER_AUDIO_BUFFER      15
39 #define AUDIO_LINE_SIZE             128
40 #define AUDIO_DATA_BUF_SZ           (AUDIO_LINE_SIZE * LINES_PER_AUDIO_BUFFER)
41
42 #define USE_RISC_NOOP_AUDIO   1
43
44 #ifdef USE_RISC_NOOP_AUDIO
45 #define AUDIO_RISC_DMA_BUF_SIZE                                         \
46         (LINES_PER_AUDIO_BUFFER * RISC_READ_INSTRUCTION_SIZE +          \
47          RISC_WRITECR_INSTRUCTION_SIZE + NUM_NO_OPS * DWORD_SIZE +      \
48          RISC_JUMP_INSTRUCTION_SIZE)
49 #endif
50
51 #ifndef USE_RISC_NOOP_AUDIO
52 #define AUDIO_RISC_DMA_BUF_SIZE                                         \
53         (LINES_PER_AUDIO_BUFFER * RISC_READ_INSTRUCTION_SIZE +          \
54          RISC_WRITECR_INSTRUCTION_SIZE + RISC_JUMP_INSTRUCTION_SIZE)
55 #endif
56
57 static int _line_size;
58 char *_defaultAudioName = "/root/audioGOOD.wav";