xref: /openbmc/linux/sound/pci/asihpi/hpi6000.h (revision 9cfc5c90)
1 /*****************************************************************************
2 
3     AudioScience HPI driver
4     Copyright (C) 1997-2011  AudioScience Inc. <support@audioscience.com>
5 
6     This program is free software; you can redistribute it and/or modify
7     it under the terms of version 2 of the GNU General Public License as
8     published by the Free Software Foundation;
9 
10     This program is distributed in the hope that it will be useful,
11     but WITHOUT ANY WARRANTY; without even the implied warranty of
12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13     GNU General Public License for more details.
14 
15     You should have received a copy of the GNU General Public License
16     along with this program; if not, write to the Free Software
17     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18 
19 Public declarations for DSP Proramming Interface to TI C6701
20 
21 Shared between hpi6000.c and DSP code
22 
23 (C) Copyright AudioScience Inc. 1998-2003
24 ******************************************************************************/
25 
26 #ifndef _HPI6000_H_
27 #define _HPI6000_H_
28 
29 #define HPI_NMIXER_CONTROLS 200
30 
31 /*
32  * Control caching is always supported in the HPI code.
33  * The DSP should make sure that dwControlCacheSizeInBytes is initialized to 0
34  * during boot to make it in-active.
35  */
36 struct hpi_hif_6000 {
37 	u32 host_cmd;
38 	u32 dsp_ack;
39 	u32 address;
40 	u32 length;
41 	u32 message_buffer_address;
42 	u32 response_buffer_address;
43 	u32 dsp_number;
44 	u32 adapter_info;
45 	u32 control_cache_is_dirty;
46 	u32 control_cache_address;
47 	u32 control_cache_size_in_bytes;
48 	u32 control_cache_count;
49 };
50 
51 #define HPI_HIF_PACK_ADAPTER_INFO(adapter, version_major, version_minor) \
52 		((adapter << 16) | (version_major << 8) | version_minor)
53 #define HPI_HIF_ADAPTER_INFO_EXTRACT_ADAPTER(adapterinfo) \
54 		((adapterinfo >> 16) & 0xffff)
55 #define HPI_HIF_ADAPTER_INFO_EXTRACT_HWVERSION_MAJOR(adapterinfo) \
56 		((adapterinfo >> 8) & 0xff)
57 #define HPI_HIF_ADAPTER_INFO_EXTRACT_HWVERSION_MINOR(adapterinfo) \
58 		(adapterinfo & 0xff)
59 
60 /* Command/status exchanged between host and DSP */
61 #define HPI_HIF_IDLE            0
62 #define HPI_HIF_SEND_MSG        1
63 #define HPI_HIF_GET_RESP        2
64 #define HPI_HIF_DATA_MASK       0x10
65 #define HPI_HIF_SEND_DATA       0x13
66 #define HPI_HIF_GET_DATA        0x14
67 #define HPI_HIF_SEND_DONE       5
68 #define HPI_HIF_RESET           9
69 
70 #endif				/* _HPI6000_H_ */
71