9c41cbf6b96a889ac1c8be3afc4ca26a1dc8b987
[profile/mobile/platform/kernel/u-boot-tm1.git] / arch / arm / include / asm / arch-sc9630 / adi_hal_internal.h
1 /******************************************************************************
2  ** File Name:      adi_hal_internal.h                                                 *
3  ** Author:         tim.luo                                             *
4  ** DATE:           2/25/2010                                                *
5  ** Copyright:      2010 Spreatrum, Incoporated. All Rights Reserved.         *
6  ** Description:    This file defines the basic operation interfaces of       *
7  **                 Analog to Digital Module.                                       *
8  **                                                                                             *
9  ******************************************************************************
10
11  ******************************************************************************
12  **                        Edit History                                       *
13  ** ------------------------------------------------------------------------- *
14  ** DATE           NAME             DESCRIPTION                               *
15  ** 2/25/2010     Tim Luo      Create.                                   *
16  **                                                                                                *
17  ******************************************************************************/
18
19
20 #ifndef _ADI_HAL_INTERNAL_H_
21 #define  _ADI_HAL_INTERNAL_H_
22
23 #include "sci_types.h"
24 #include <asm/arch/adi.h>
25     
26
27 #define         ADI_init        sci_adi_init
28
29 ///for analog die register operation
30 #define ANA_REG_OR(reg_addr, value)     \
31     do{\
32         sci_adi_write(reg_addr, (unsigned short)(value), 0); \
33     }while(0)
34 #define ANA_REG_MSK_OR(reg_addr, value, msk)        \
35     do{\
36         sci_adi_write(reg_addr, (unsigned short)((value)&(msk)), msk); \
37     }while(0)
38 #define ANA_REG_AND(reg_addr, value)    \
39     do{\
40         sci_adi_write(reg_addr, 0, (unsigned short)(~(value))); \
41     }while(0)
42 #define ANA_REG_BIC(reg_addr, value)    \
43     do{\
44         sci_adi_write(reg_addr, 0, (unsigned short)(value)); \
45     }while(0)
46
47
48 #define ANA_REG_SET(reg_addr, value)    sci_adi_raw_write(reg_addr, (unsigned short)(value))
49
50 #define ANA_REG_GET(reg_addr)           sci_adi_read(reg_addr)
51
52 #define ANA_GET_CHIP_ID                 sci_get_adie_chip_id
53
54 #endif  //_ADI_HAL_INTERNAL_H_