Commit | Line | Data |
---|---|---|
6fa3eb70 S |
1 | #ifndef __MT_PMIC_WRAP_H__ |
2 | #define __MT_PMIC_WRAP_H__ | |
3 | /* #include <mach/typedefs.h> */ | |
4 | /* #include <linux/smp.h> */ | |
5 | #include <mach/mt_typedefs.h> | |
6 | #include <linux/device.h> | |
7 | ||
8 | ||
9 | struct mt_pmic_wrap_driver { | |
10 | ||
11 | struct device_driver driver; | |
12 | S32(*wacs2_hal) (U32 write, U32 adr, U32 wdata, U32 * rdata); | |
13 | ||
14 | S32(*show_hal) (char *buf); | |
15 | S32(*store_hal) (const char *buf, size_t count); | |
16 | ||
17 | S32(*suspend) (void); | |
18 | void (*resume) (void); | |
19 | }; | |
20 | typedef enum { | |
21 | PWRAP_READ = 0, | |
22 | PWRAP_WRITE = 1, | |
23 | } PWRAP_OPS; | |
24 | ||
25 | /* ------external API for pmic_wrap user-------------------------------------------------- */ | |
26 | S32 pwrap_read(U32 adr, U32 * rdata); | |
27 | S32 pwrap_write(U32 adr, U32 wdata); | |
28 | ||
29 | S32 pwrap_wacs2(U32 write, U32 adr, U32 wdata, U32 *rdata); | |
30 | /*_____________ROME only_____________________________________________*/ | |
31 | /********************************************************************/ | |
32 | /* return value : EINT_STA: [0]: CPU IRQ status in MT6331 */ | |
33 | /* [1]: MD32 IRQ status in MT6331 */ | |
34 | /* [2]: CPU IRQ status in MT6332 */ | |
35 | /* [3]: RESERVED */ | |
36 | /********************************************************************/ | |
37 | U32 pmic_wrap_eint_status(void); | |
38 | /********************************************************************/ | |
39 | /* set value(W1C) : EINT_CLR: [0]: CPU IRQ status in MT6331 */ | |
40 | /* [1]: MD32 IRQ status in MT6331 */ | |
41 | /* [2]: CPU IRQ status in MT6332 */ | |
42 | /* [3]: RESERVED */ | |
43 | /* para: offset is shift of clear bit which needs to clear */ | |
44 | /********************************************************************/ | |
45 | void pmic_wrap_eint_clr(int offset); | |
46 | /*--------------------------------------------------------------------*/ | |
47 | U32 mt_pmic_wrap_eint_status(void); | |
48 | void mt_pmic_wrap_eint_clr(int offset); | |
49 | S32 pwrap_init(void); | |
50 | struct mt_pmic_wrap_driver *get_mt_pmic_wrap_drv(void); | |
51 | ||
52 | #endif /* __MT_PMIC_WRAP_H__ */ |