~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to sound/soc/omap/abe/abe_port.h

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 
 
3
  This file is provided under a dual BSD/GPLv2 license.  When using or
 
4
  redistributing this file, you may do so under either license.
 
5
 
 
6
  GPL LICENSE SUMMARY
 
7
 
 
8
  Copyright(c) 2010-2011 Texas Instruments Incorporated,
 
9
  All rights reserved.
 
10
 
 
11
  This program is free software; you can redistribute it and/or modify
 
12
  it under the terms of version 2 of the GNU General Public License as
 
13
  published by the Free Software Foundation.
 
14
 
 
15
  This program is distributed in the hope that it will be useful, but
 
16
  WITHOUT ANY WARRANTY; without even the implied warranty of
 
17
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
18
  General Public License for more details.
 
19
 
 
20
  You should have received a copy of the GNU General Public License
 
21
  along with this program; if not, write to the Free Software
 
22
  Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
 
23
  The full GNU General Public License is included in this distribution
 
24
  in the file called LICENSE.GPL.
 
25
 
 
26
  BSD LICENSE
 
27
 
 
28
  Copyright(c) 2010-2011 Texas Instruments Incorporated,
 
29
  All rights reserved.
 
30
 
 
31
  Redistribution and use in source and binary forms, with or without
 
32
  modification, are permitted provided that the following conditions
 
33
  are met:
 
34
 
 
35
    * Redistributions of source code must retain the above copyright
 
36
      notice, this list of conditions and the following disclaimer.
 
37
    * Redistributions in binary form must reproduce the above copyright
 
38
      notice, this list of conditions and the following disclaimer in
 
39
      the documentation and/or other materials provided with the
 
40
      distribution.
 
41
    * Neither the name of Texas Instruments Incorporated nor the names of
 
42
      its contributors may be used to endorse or promote products derived
 
43
      from this software without specific prior written permission.
 
44
 
 
45
  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 
46
  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 
47
  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 
48
  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 
49
  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 
50
  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 
51
  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 
52
  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 
53
  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 
54
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 
55
  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
56
 
 
57
*/
 
58
 
 
59
#ifndef _ABE_PORT_H_
 
60
#define _ABE_PORT_H_
 
61
 
 
62
struct omap_abe_data_format {
 
63
        /* Sampling frequency of the stream */
 
64
        u32 f;
 
65
        /* Sample format type  */
 
66
        u32 samp_format;
 
67
};
 
68
 
 
69
struct omap_abe_port_protocol {
 
70
        /* Direction=0 means input from AESS point of view */
 
71
        u32 direction;
 
72
        /* Protocol type (switch) during the data transfers */
 
73
        u32 protocol_switch;
 
74
        union {
 
75
                /* McBSP/McASP peripheral connected to ATC */
 
76
                struct {
 
77
                        u32 desc_addr;
 
78
                        /* Address of ATC McBSP/McASP descriptor's in bytes */
 
79
                        u32 buf_addr;
 
80
                        /* DMEM address in bytes */
 
81
                        u32 buf_size;
 
82
                        /* ITERation on each DMAreq signals */
 
83
                        u32 iter;
 
84
                } serial;
 
85
                /* DMIC peripheral connected to ATC */
 
86
                struct {
 
87
                        /* DMEM address in bytes */
 
88
                        u32 buf_addr;
 
89
                        /* DMEM buffer size in bytes */
 
90
                        u32 buf_size;
 
91
                        /* Number of activated DMIC */
 
92
                        u32 nbchan;
 
93
                } dmic;
 
94
                /* McPDMDL peripheral connected to ATC */
 
95
                struct {
 
96
                        /* DMEM address in bytes */
 
97
                        u32 buf_addr;
 
98
                        /* DMEM size in bytes */
 
99
                        u32 buf_size;
 
100
                        /* Control allowed on McPDM DL */
 
101
                        u32 control;
 
102
                } mcpdmdl;
 
103
                /* McPDMUL peripheral connected to ATC */
 
104
                struct {
 
105
                        /* DMEM address size in bytes */
 
106
                        u32 buf_addr;
 
107
                        /* DMEM buffer size size in bytes */
 
108
                        u32 buf_size;
 
109
                } mcpdmul;
 
110
                /* Ping-Pong interface to the Host using cache-flush */
 
111
                struct {
 
112
                        /* Address of ATC descriptor's */
 
113
                        u32 desc_addr;
 
114
                        /* DMEM buffer base address in bytes */
 
115
                        u32 buf_addr;
 
116
                        /* DMEM size in bytes for each ping and pong buffers */
 
117
                        u32 buf_size;
 
118
                        /* IRQ address (either DMA (0) MCU (1) or DSP(2)) */
 
119
                        u32 irq_addr;
 
120
                        /* IRQ data content loaded in the AESS IRQ register */
 
121
                        u32 irq_data;
 
122
                        /* Call-back function upon IRQ reception */
 
123
                        u32 callback;
 
124
                } pingpong;
 
125
                /* DMAreq line to CBPr */
 
126
                struct {
 
127
                        /* Address of ATC descriptor's */
 
128
                        u32 desc_addr;
 
129
                        /* DMEM buffer address in bytes */
 
130
                        u32 buf_addr;
 
131
                        /* DMEM buffer size size in bytes */
 
132
                        u32 buf_size;
 
133
                        /* ITERation on each DMAreq signals */
 
134
                        u32 iter;
 
135
                        /* DMAreq address */
 
136
                        u32 dma_addr;
 
137
                        /* DMA/AESS = 1 << #DMA */
 
138
                        u32 dma_data;
 
139
                } dmareq;
 
140
                /* Circular buffer - direct addressing to DMEM */
 
141
                struct {
 
142
                        /* DMEM buffer base address in bytes */
 
143
                        u32 buf_addr;
 
144
                        /* DMEM buffer size in bytes */
 
145
                        u32 buf_size;
 
146
                        /* DMAreq address */
 
147
                        u32 dma_addr;
 
148
                        /* DMA/AESS = 1 << #DMA */
 
149
                        u32 dma_data;
 
150
                } circular_buffer;
 
151
        } port;
 
152
};
 
153
 
 
154
extern const abe_port_t abe_port_init[];
 
155
extern abe_port_t abe_port[];
 
156
extern const u32 abe_port_priority[];
 
157
 
 
158
int omap_abe_select_main_port(u32 id);
 
159
u32 omap_abe_dma_port_iter_factor(struct omap_abe_data_format *f);
 
160
 
 
161
#endif/* _ABE_PORT_H_ */