Mauro Carvalho Chehab | 1a9fc85 | 2009-09-13 11:30:11 -0300 | [diff] [blame] | 1 | /* |
| 2 | * Driver for the Conexant CX25821 PCIe bridge |
| 3 | * |
| 4 | * Copyright (C) 2009 Conexant Systems Inc. |
| 5 | * Authors <shu.lin@conexant.com>, <hiep.huynh@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 | #ifndef __CX25821_AUDIO_H__ |
| 24 | #define __CX25821_AUDIO_H__ |
| 25 | |
| 26 | #define USE_RISC_NOOP 1 |
| 27 | #define LINES_PER_BUFFER 15 |
| 28 | #define AUDIO_LINE_SIZE 128 |
| 29 | |
Palash Bandyopadhyay | 6d8c2ba | 2010-07-04 14:15:38 -0300 | [diff] [blame] | 30 | /* Number of buffer programs to use at once. */ |
Mauro Carvalho Chehab | 1a9fc85 | 2009-09-13 11:30:11 -0300 | [diff] [blame] | 31 | #define NUMBER_OF_PROGRAMS 8 |
| 32 | |
Palash Bandyopadhyay | 6d8c2ba | 2010-07-04 14:15:38 -0300 | [diff] [blame] | 33 | /* |
Ruslan Pisarev | e4115bb | 2010-09-27 10:01:36 -0300 | [diff] [blame] | 34 | * Max size of the RISC program for a buffer. - worst case is 2 writes per line |
| 35 | * Space is also added for the 4 no-op instructions added on the end. |
| 36 | */ |
Mauro Carvalho Chehab | 1a9fc85 | 2009-09-13 11:30:11 -0300 | [diff] [blame] | 37 | #ifndef USE_RISC_NOOP |
| 38 | #define MAX_BUFFER_PROGRAM_SIZE \ |
Leonid V. Fedorenchik | cc4600c | 2011-09-02 11:55:37 +0800 | [diff] [blame] | 39 | (2 * LINES_PER_BUFFER * RISC_WRITE_INSTRUCTION_SIZE + \ |
| 40 | RISC_WRITECR_INSTRUCTION_SIZE * 4) |
Mauro Carvalho Chehab | 1a9fc85 | 2009-09-13 11:30:11 -0300 | [diff] [blame] | 41 | #endif |
| 42 | |
Palash Bandyopadhyay | 6d8c2ba | 2010-07-04 14:15:38 -0300 | [diff] [blame] | 43 | /* MAE 12 July 2005 Try to use NOOP RISC instruction instead */ |
Mauro Carvalho Chehab | 1a9fc85 | 2009-09-13 11:30:11 -0300 | [diff] [blame] | 44 | #ifdef USE_RISC_NOOP |
| 45 | #define MAX_BUFFER_PROGRAM_SIZE \ |
Leonid V. Fedorenchik | cc4600c | 2011-09-02 11:55:37 +0800 | [diff] [blame] | 46 | (2 * LINES_PER_BUFFER * RISC_WRITE_INSTRUCTION_SIZE + \ |
| 47 | RISC_NOOP_INSTRUCTION_SIZE * 4) |
Mauro Carvalho Chehab | 1a9fc85 | 2009-09-13 11:30:11 -0300 | [diff] [blame] | 48 | #endif |
| 49 | |
Palash Bandyopadhyay | 6d8c2ba | 2010-07-04 14:15:38 -0300 | [diff] [blame] | 50 | /* Sizes of various instructions in bytes. Used when adding instructions. */ |
Mauro Carvalho Chehab | 1a9fc85 | 2009-09-13 11:30:11 -0300 | [diff] [blame] | 51 | #define RISC_WRITE_INSTRUCTION_SIZE 12 |
| 52 | #define RISC_JUMP_INSTRUCTION_SIZE 12 |
| 53 | #define RISC_SKIP_INSTRUCTION_SIZE 4 |
| 54 | #define RISC_SYNC_INSTRUCTION_SIZE 4 |
| 55 | #define RISC_WRITECR_INSTRUCTION_SIZE 16 |
| 56 | #define RISC_NOOP_INSTRUCTION_SIZE 4 |
| 57 | |
Gorskin Ilya | bb59a4c | 2010-08-18 01:15:52 +0600 | [diff] [blame] | 58 | #define MAX_AUDIO_DMA_BUFFER_SIZE \ |
| 59 | (MAX_BUFFER_PROGRAM_SIZE * NUMBER_OF_PROGRAMS + RISC_SYNC_INSTRUCTION_SIZE) |
Mauro Carvalho Chehab | 1a9fc85 | 2009-09-13 11:30:11 -0300 | [diff] [blame] | 60 | |
| 61 | #endif |