tizen 2.4 release
[profile/mobile/platform/kernel/u-boot-tm1.git] / arch / arm / include / asm / arch-sc8830 / adi.h
1 /* * Copyright (C) 2012 Spreadtrum Communications Inc.
2  *
3  * This software is licensed under the terms of the GNU General Public
4  * License version 2, as published by the Free Software Foundation, and
5  * may be copied, distributed, and modified under those terms.
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
14 #ifndef __ADI_H__
15 #define __ADI_H__
16
17 void sci_adi_init(void);
18
19 /*
20  * sci_get_adie_chip_id - read a-die chip id
21  */
22 u32 sci_get_adie_chip_id(void);
23
24 int sci_adi_read(u32 reg);
25
26 /*
27  * WARN: the arguments (reg, value) is different from
28  * the general __raw_writel(value, reg)
29  * For sci_adi_write_fast: if set sync 1, then this function will
30  * return until the val have reached hardware.otherwise, just
31  * async write(is maybe in software buffer)
32  */
33 int sci_adi_write_fast(u32 reg, u16 val, u32 sync);
34 int sci_adi_write(u32 reg, u16 or_val, u16 clear_msk);
35
36 static inline int sci_adi_raw_write(u32 reg, u16 val)
37 {
38         return sci_adi_write_fast(reg, val, 1);
39 }
40
41 static inline int sci_adi_set(u32 reg, u16 bits)
42 {
43         return sci_adi_write(reg, bits, 0);
44 }
45
46 static inline int sci_adi_clr(u32 reg, u16 bits)
47 {
48         return sci_adi_write(reg, 0, bits);
49 }
50
51 #endif