Duy Truong | 790f06d | 2013-02-13 16:38:12 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2010-2011, The Linux Foundation. All rights reserved. |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 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 | |
| 16 | struct 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 | |
| 25 | enum { |
| 26 | DAI_SPKR = 0, |
| 27 | DAI_MIC, |
| 28 | DAI_MI2S, |
| 29 | DAI_SEC_SPKR, |
| 30 | DAI_SEC_MIC, |
| 31 | }; |
| 32 | |
| 33 | /* Function Prototypes */ |
| 34 | int dai_open(uint32_t dma_ch); |
| 35 | void dai_close(uint32_t dma_ch); |
| 36 | int dai_start(uint32_t dma_ch); |
| 37 | int dai_stop(uint32_t dma_ch); |
| 38 | int dai_set_params(uint32_t dma_ch, struct dai_dma_params *params); |
| 39 | uint32_t dai_get_dma_pos(uint32_t dma_ch); |
| 40 | void register_dma_irq_handler(int dma_ch, |
| 41 | irqreturn_t (*callback) (int intrSrc, void *private_data), |
| 42 | void *private_data); |
| 43 | void unregister_dma_irq_handler(int dma_ch); |
| 44 | void dai_set_master_mode(uint32_t dma_ch, int mode); |
| 45 | int dai_start_hdmi(uint32_t dma_ch); |
Deepa Madiregama | 6a3a01a | 2011-10-28 06:34:17 +0530 | [diff] [blame] | 46 | int wait_for_dma_cnt_stop(uint32_t dma_ch); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 47 | void dai_stop_hdmi(uint32_t dma_ch); |
| 48 | |
| 49 | #endif |