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 *  You should have received a copy of the GNU General Public License
19 *  along with this program; if not, write to the Free Software
20 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 */
22
23#include <linux/mutex.h>
24#include <linux/workqueue.h>
25
26#define NUM_AUDIO_PROGS       8
27#define NUM_AUDIO_FRAMES      8
28#define END_OF_FILE           0
29#define IN_PROGRESS           1
30#define RESET_STATUS          -1
31#define FIFO_DISABLE          0
32#define FIFO_ENABLE           1
33#define NUM_NO_OPS            4
34
35#define RISC_READ_INSTRUCTION_SIZE      12
36#define RISC_JUMP_INSTRUCTION_SIZE      12
37#define RISC_WRITECR_INSTRUCTION_SIZE   16
38#define RISC_SYNC_INSTRUCTION_SIZE      4
39#define DWORD_SIZE                      4
40#define AUDIO_SYNC_LINE                 4
41
42#define LINES_PER_AUDIO_BUFFER      15
43#define AUDIO_LINE_SIZE             128
44#define AUDIO_DATA_BUF_SZ           (AUDIO_LINE_SIZE * LINES_PER_AUDIO_BUFFER)
45
46#define USE_RISC_NOOP_AUDIO   1
47
48#ifdef USE_RISC_NOOP_AUDIO
49#define AUDIO_RISC_DMA_BUF_SIZE						\
50	(LINES_PER_AUDIO_BUFFER * RISC_READ_INSTRUCTION_SIZE +		\
51	 RISC_WRITECR_INSTRUCTION_SIZE + NUM_NO_OPS * DWORD_SIZE +	\
52	 RISC_JUMP_INSTRUCTION_SIZE)
53#endif
54
55#ifndef USE_RISC_NOOP_AUDIO
56#define AUDIO_RISC_DMA_BUF_SIZE						\
57	(LINES_PER_AUDIO_BUFFER * RISC_READ_INSTRUCTION_SIZE +		\
58	 RISC_WRITECR_INSTRUCTION_SIZE + RISC_JUMP_INSTRUCTION_SIZE)
59#endif
60
61static int _line_size;
62char *_defaultAudioName = "/root/audioGOOD.wav";
63