/*----------------------------------------------------------------------------*
 * No Warranty                                                                *
 * Except as may be otherwise agreed to in writing, no warranties of any      *
 * kind, whether express or implied, are given by MTK with respect to any MTK *
 * Deliverables or any use thereof, and MTK Deliverables are provided on an   *
 * "AS IS" basis.  MTK hereby expressly disclaims all such warranties,        *
 * including any implied warranties of merchantability, non-infringement and  *
 * fitness for a particular purpose and any warranties arising out of course  *
 * of performance, course of dealing or usage of trade.  Parties further      *
 * acknowledge that Company may, either presently and/or in the future,       *
 * instruct MTK to assist it in the development and the implementation, in    *
 * accordance with Company's designs, of certain softwares relating to        *
 * Company's product(s) (the "Services").  Except as may be otherwise agreed  *
 * to in writing, no warranties of any kind, whether express or implied, are  *
 * given by MTK with respect to the Services provided, and the Services are   *
 * provided on an "AS IS" basis.  Company further acknowledges that the       *
 * Services may contain errors, that testing is important and Company is      *
 * solely responsible for fully testing the Services and/or derivatives       *
 * thereof before they are used, sublicensed or distributed.  Should there be *
 * any third party action brought against MTK, arising out of or relating to  *
 * the Services, Company agree to fully indemnify and hold MTK harmless.      *
 * If the parties mutually agree to enter into or continue a business         *
 * relationship or other arrangement, the terms and conditions set forth      *
 * hereunder shall remain effective and, unless explicitly stated otherwise,  *
 * shall prevail in the event of a conflict in the terms in any agreements    *
 * entered into between the parties.                                          *
 *---------------------------------------------------------------------------*/


/*-----------------------------------------------------------------------------
 * Copyright (c) 2005, MediaTek Inc.
 * All rights reserved.
 *
 * Unauthorized use, practice, perform, copy, distribution, reproduction,
 * or disclosure of this information in whole or in part is prohibited.
 *---------------------------------------------------------------------------*/

 /** @file irt_dma_drvif.h
  *  irt dma driver internal public interfaces
  *
  */
#ifndef IRT_DMA_DRVIF_H
#define IRT_DMA_DRVIF_H

#include "x_common.h"
#include "x_typedef.h"
#include "x_timer.h"
#include "x_assert.h"
#include "x_os.h"
#include "x_ckgen.h"
#include "x_clksrc.h"
#include "x_hal_5381.h"
#include "x_hal_926.h"



//---------------------------------------------------------------------------
// Include files
//---------------------------------------------------------------------------


//---------------------------------------------------------------------------
// Configurations
//---------------------------------------------------------------------------
typedef enum _IRT_ROTOTATE_MODE
{
	ROT_0,
	ROT_0_FLIP,
	ROT_90,
	ROT_90_FLIP,
	ROT_180,
	ROT_180_FLIP,
	ROT_270,
	ROT_270_FLIP,
}IRT_ROT_MODE;


typedef struct _IRT_DMA_PARAM_SET_T
{
	UPTR  u4YSrcAddr;
	UPTR  u4CSrcAddr;
	UPTR  u4YTgAddr;
	UPTR  u4CTgAddr;
	UINT32 u4Width;	
	UINT32 u4Height;
	IRT_ROT_MODE eMode;	
	BOOL fg5351Block;
	BOOL fgRaster;
	BOOL fg10bitIn;  
	BOOL fg10bitOut;
    BOOL fgRotate10bitOut;
    BOOL fgJumpMode;
}IRT_DMA_PARAM_SET_T;


//---------------------------------------------------------------------------
// Macro definitions
//---------------------------------------------------------------------------

// assertion
#define IRT_ASSERT(x)             ASSERT(x)

// check 16-byte align
#define IRT_CHK_16B_ALIGN(num)    IRT_ASSERT(!(num & 0xF))

// check 32-byte align
#define IRT_CHK_32B_ALIGN(num)    IRT_ASSERT(!(num & 0x1F))

// chk3ck 64-byte align
#define IRT_CHK_64B_ALIGN(num)	  IRT_ASSERT(!(num & 0x3F))

//---------------------------------------------------------------------------
// Public functions
//---------------------------------------------------------------------------

extern void IRT_DMA_RotateMirror(IRT_DMA_PARAM_SET_T *pvRoParam);
extern void IRT_DMA_Init(void);
extern void IRT_DMA_Lock(void);
extern void IRT_DMA_Unlock(void);
extern void IRT_DMA_Reset(void);
extern void IRT_DMA_PrintRegister(void);
void IRT_DMA_SetSrcMode(IRT_DMA_PARAM_SET_T *pvRoParam);
void IRT_DMA_LockWaitIsr(void);
void IRT_DMA_UnlockWaitIsr(void);
#endif

