1 /******************************************************************************
2 ** File Name: adi_hal_internal.h *
5 ** Copyright: 2010 Spreatrum, Incoporated. All Rights Reserved. *
6 ** Description: This file defines the basic operation interfaces of *
7 ** Analog to Digital Module. *
9 ******************************************************************************
11 ******************************************************************************
13 ** ------------------------------------------------------------------------- *
14 ** DATE NAME DESCRIPTION *
15 ** 2/25/2010 Tim Luo Create. *
17 ******************************************************************************/
20 #ifndef _ADI_HAL_INTERNAL_H_
21 #define _ADI_HAL_INTERNAL_H_
23 #include "sci_types.h"
24 #include <asm/arch/adi.h>
27 #define ADI_init sci_adi_init
29 ///for analog die register operation
30 #define ANA_REG_OR(reg_addr, value) \
32 sci_adi_write(reg_addr, (unsigned short)(value), 0); \
34 #define ANA_REG_MSK_OR(reg_addr, value, msk) \
36 sci_adi_write(reg_addr, (unsigned short)((value)&(msk)), msk); \
38 #define ANA_REG_AND(reg_addr, value) \
40 sci_adi_write(reg_addr, 0, (unsigned short)(~(value))); \
42 #define ANA_REG_BIC(reg_addr, value) \
44 sci_adi_write(reg_addr, 0, (unsigned short)(value)); \
48 #define ANA_REG_SET(reg_addr, value) sci_adi_raw_write(reg_addr, (unsigned short)(value))
50 #define ANA_REG_GET(reg_addr) sci_adi_read(reg_addr)
52 #define ANA_GET_CHIP_ID sci_get_adie_chip_id
54 #endif //_ADI_HAL_INTERNAL_H_