xref: /openbmc/linux/sound/pci/asihpi/hpi6205.h (revision b830f94f)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*****************************************************************************
3 
4     AudioScience HPI driver
5     Copyright (C) 1997-2011  AudioScience Inc. <support@audioscience.com>
6 
7 
8 Host Interface module for an ASI6205 based
9 bus mastering PCI adapter.
10 
11 Copyright AudioScience, Inc., 2003
12 ******************************************************************************/
13 
14 #ifndef _HPI6205_H_
15 #define _HPI6205_H_
16 
17 #include "hpi_internal.h"
18 
19 /***********************************************************
20 	Defines used for basic messaging
21 ************************************************************/
22 #define H620_HIF_RESET          0
23 #define H620_HIF_IDLE           1
24 #define H620_HIF_GET_RESP       2
25 #define H620_HIF_DATA_DONE      3
26 #define H620_HIF_DATA_MASK      0x10
27 #define H620_HIF_SEND_DATA      0x14
28 #define H620_HIF_GET_DATA       0x15
29 #define H620_HIF_UNKNOWN                0x0000ffff
30 
31 /***********************************************************
32 	Types used for mixer control caching
33 ************************************************************/
34 
35 #define H620_MAX_ISTREAMS 32
36 #define H620_MAX_OSTREAMS 32
37 #define HPI_NMIXER_CONTROLS 2048
38 
39 /*********************************************************************
40 This is used for dynamic control cache allocation
41 **********************************************************************/
42 struct controlcache_6205 {
43 	u32 number_of_controls;
44 	u32 physical_address32;
45 	u32 size_in_bytes;
46 };
47 
48 /*********************************************************************
49 This is used for dynamic allocation of async event array
50 **********************************************************************/
51 struct async_event_buffer_6205 {
52 	u32 physical_address32;
53 	u32 spare;
54 	struct hpi_fifo_buffer b;
55 };
56 
57 /***********************************************************
58 The Host located memory buffer that the 6205 will bus master
59 in and out of.
60 ************************************************************/
61 #define HPI6205_SIZEOF_DATA (16*1024)
62 
63 struct message_buffer_6205 {
64 	struct hpi_message message;
65 	char data[256];
66 };
67 
68 struct response_buffer_6205 {
69 	struct hpi_response response;
70 	char data[256];
71 };
72 
73 union buffer_6205 {
74 	struct message_buffer_6205 message_buffer;
75 	struct response_buffer_6205 response_buffer;
76 	u8 b_data[HPI6205_SIZEOF_DATA];
77 };
78 
79 struct bus_master_interface {
80 	u32 host_cmd;
81 	u32 dsp_ack;
82 	u32 transfer_size_in_bytes;
83 	union buffer_6205 u;
84 	struct controlcache_6205 control_cache;
85 	struct async_event_buffer_6205 async_buffer;
86 	struct hpi_hostbuffer_status
87 	 instream_host_buffer_status[H620_MAX_ISTREAMS];
88 	struct hpi_hostbuffer_status
89 	 outstream_host_buffer_status[H620_MAX_OSTREAMS];
90 };
91 
92 #endif
93