aboutsummaryrefslogtreecommitdiff
path: root/include/mach/mt_pmic_wrap.h
blob: e6c94bf0bda3d2257303331c78a9d01f13dfb247 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef __MT_PMIC_WRAP_H__
#define __MT_PMIC_WRAP_H__
/* #include <mach/typedefs.h> */
/* #include <linux/smp.h> */
#include <mach/mt_typedefs.h>
#include <linux/device.h>


struct mt_pmic_wrap_driver{

    struct device_driver driver;
	S32 (*wacs2_hal)( U32  write, U32  adr, U32  wdata, U32 *rdata );

	S32 (*show_hal)(char *buf);
	S32 (*store_hal)(const char *buf, size_t count);

	S32 (*suspend)(void);
	void (*resume)(void);
};
typedef enum {
    PWRAP_READ	= 0,
    PWRAP_WRITE	= 1,
}PWRAP_OPS;

/* ------external API for pmic_wrap user-------------------------------------------------- */
S32 pwrap_read( U32  adr, U32 *rdata );
S32 pwrap_write( U32  adr, U32  wdata );
//S32 pwrap_write_nochk( U32  adr, U32  wdata );
//S32 pwrap_read_nochk( U32  adr, U32 *rdata );

S32 pwrap_wacs2( U32  write, U32  adr, U32  wdata, U32 *rdata );
/*_____________ROME only_____________________________________________*/
/********************************************************************/
/* return value : EINT_STA: [0]: CPU IRQ status in MT6331 */
/* [1]: MD32 IRQ status in MT6331 */
/* [2]: CPU IRQ status in MT6332 */
/* [3]: RESERVED */
/********************************************************************/
U32 pmic_wrap_eint_status(void);
/********************************************************************/
/* set value(W1C) : EINT_CLR:       [0]: CPU IRQ status in MT6331 */
/* [1]: MD32 IRQ status in MT6331 */
/* [2]: CPU IRQ status in MT6332 */
/* [3]: RESERVED */
/* para: offset is shift of clear bit which needs to clear */
/********************************************************************/
void pmic_wrap_eint_clr(int offset);
/*--------------------------------------------------------------------*/
U32 mt_pmic_wrap_eint_status(void);
void mt_pmic_wrap_eint_clr(int offset);
S32 pwrap_init( void );
struct mt_pmic_wrap_driver *get_mt_pmic_wrap_drv(void);

#endif				/* __MT_PMIC_WRAP_H__ */