blob: 4d3fb960a87f3c4a154c6e1275826405ca94c2f8 [file] [log] [blame]
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001/* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 */
13#ifndef __DAI_H__
14#define __DAI_H__
15
16struct dai_dma_params {
17 u8 *buffer;
18 uint32_t src_start;
19 uint32_t bus_id;
20 int buffer_size;
21 int period_size;
22 int channels;
23};
24
25enum {
26 DAI_SPKR = 0,
27 DAI_MIC,
28 DAI_MI2S,
29 DAI_SEC_SPKR,
30 DAI_SEC_MIC,
31};
32
33/* Function Prototypes */
34int dai_open(uint32_t dma_ch);
35void dai_close(uint32_t dma_ch);
36int dai_start(uint32_t dma_ch);
37int dai_stop(uint32_t dma_ch);
38int dai_set_params(uint32_t dma_ch, struct dai_dma_params *params);
39uint32_t dai_get_dma_pos(uint32_t dma_ch);
40void register_dma_irq_handler(int dma_ch,
41 irqreturn_t (*callback) (int intrSrc, void *private_data),
42 void *private_data);
43void unregister_dma_irq_handler(int dma_ch);
44void dai_set_master_mode(uint32_t dma_ch, int mode);
45int dai_start_hdmi(uint32_t dma_ch);
Deepa Madiregama6a3a01a2011-10-28 06:34:17 +053046int wait_for_dma_cnt_stop(uint32_t dma_ch);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070047void dai_stop_hdmi(uint32_t dma_ch);
48
49#endif