00001 /* 00002 * Copyright (c) 2010, Texas Instruments Incorporated 00003 * All rights reserved. 00004 * 00005 * Redistribution and use in source and binary forms, with or without 00006 * modification, are permitted provided that the following conditions 00007 * are met: 00008 * 00009 * * Redistributions of source code must retain the above copyright 00010 * notice, this list of conditions and the following disclaimer. 00011 * 00012 * * Redistributions in binary form must reproduce the above copyright 00013 * notice, this list of conditions and the following disclaimer in the 00014 * documentation and/or other materials provided with the distribution. 00015 * 00016 * * Neither the name of Texas Instruments Incorporated nor the names of 00017 * its contributors may be used to endorse or promote products derived 00018 * from this software without specific prior written permission. 00019 * 00020 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00021 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 00022 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00023 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 00024 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00025 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00026 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 00027 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 00028 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 00029 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 00030 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00031 * 00032 */ 00033 00085 #ifndef ti_sdo_linuxutils_sdma_interface_sdma_ 00086 #define ti_sdo_linuxutils_sdma_interface_sdma_ 00087 00088 #if defined (__cplusplus) 00089 extern "C" { 00090 #endif 00091 00094 00095 #define SDMA_VERSION 0x01010000U 00096 00100 #define SDMA_IOCMAGIC 0x0000fb00 00101 #define SDMA_IOCCMDMASK 0x000000ff 00102 00103 #define SDMA_IOCREQUESTDMA 1 00104 #define SDMA_IOCRELEASEDMA 2 00105 #define SDMA_IOCWAITFORCOMPLETION 3 00106 #define SDMA_IOCGETVERSION 4 00107 00118 struct SDMA_transferState { 00119 volatile int transferCompleted; 00120 volatile int checkPending; 00121 }; 00122 00126 union SDMA_requestDmaParams { 00127 struct SDMA_transferState *ptransferState; 00128 int channel; 00129 }; 00130 00147 typedef struct SDMA_ChannelDescriptor { 00148 int chanNum; 00149 unsigned int * addr; 00150 struct SDMA_transferState transferState; 00151 } SDMA_ChannelDescriptor; 00152 00156 typedef enum SDMA_Status { 00157 SDMA_OK = 0, 00158 SDMA_EFAIL, 00159 SDMA_ENOCHANNEL, 00160 SDMA_ENOINIT 00161 } SDMA_Status; 00162 00163 00167 int SDMA_init(void); 00168 00172 int SDMA_exit(void); 00173 00194 SDMA_Status SDMA_getChannels(int numChannels, 00195 SDMA_ChannelDescriptor chanArray[]); 00196 00207 SDMA_Status SDMA_freeChannels(int numChannels, 00208 SDMA_ChannelDescriptor chanArray[]); 00209 00226 SDMA_Status SDMA_wait(SDMA_ChannelDescriptor * channel); 00227 00241 SDMA_Status SDMA_check(SDMA_ChannelDescriptor * channel, int *pcompleted); 00242 00250 int SDMA_getVersion(void); 00251 00254 #if defined (__cplusplus) 00255 } 00256 #endif 00257 00258 #endif 00259 /* 00260 * @(#) ti.sdo.linuxutils.sdma; 1, 0, 0,95; 11-30-2010 18:31:50; /db/atree/library/trees/linuxutils/linuxutils-j02x/src/ xlibrary 00261 00262 */ 00263