aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard/gpiofn.h
blob: fb3e7588af78bec4472ba2b290e57317309761ae (plain)
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
55
56
57
#ifndef __GPIOFN_H //[
#define __GPIOFN_H


#ifdef CONFIG_MACH_MX6SL_NTX//[
	#define GPIOFN_PLATFORM_MX6		1
#endif//]CONFIG_MACH_MX6SL_NTX


#ifdef GPIOFN_PLATFORM_MX6//[
	#include <mach/iomux-mx6sl.h>
#else //][!GPIOFN_PLATFORM_MX6
	#include <mach/iomux-mx50.h>
#endif //]GPIOFN_PLATFORM_MX6


#include <linux/timer.h>
#include <linux/list.h>

typedef int (*fn_gpio)(int I_iGPIO_val,unsigned uGPIO);

typedef struct tagGPIODATA{
	//-------------------------------
	// public :
	fn_gpio pfnGPIO;
	fn_gpio pfnGPIO_INT;
	unsigned uGPIO;
	char *szName;
	iomux_v3_cfg_t tPADCtrl;
	unsigned int uiIRQType;
	int iWakeup; // 1->enable wakeup device , 0-> disable wakeup device .
	unsigned long dwDebounceTicks;
	int iActive; 
	//--------------------------------
	// private :
	struct work_struct tWork;
	struct workqueue_struct *ptWQ;
	struct timer_list tTimerDebounce;
	unsigned long dwCurrentDebounceTicks;
	int iLastGPIOVal;
	int iCurrentGPIOVal;
	struct list_head list;
}GPIODATA;


int gpiofn_init(void);
int gpiofn_release(void);

int gpiofn_suspend(void);
void gpiofn_resume(void);

int gpiofn_register(GPIODATA *I_ptGPIO_Data);
int gpiofn_unregister(GPIODATA *I_ptGPIO_Data);


#endif //] __GPIOFN_H