blob: 031fe3b80a5a429b342236666ab930a5d4155c7c [file] [log] [blame]
Duy Truong790f06d2013-02-13 16:38:12 -08001/* Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002 *
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