-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathctp_platform_ops.h
51 lines (42 loc) · 1.22 KB
/
ctp_platform_ops.h
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
// This is a cut down version of the ctp_platform_ops.h in sunxi.
// Remove when putting gslx680 back in tree.
#include <linux/i2c.h>
#include <linux/input.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/errno.h>
#include <linux/kernel.h>// gpio base address
#define PIO_BASE_ADDRESS (0x01c20800)
#define PIO_RANGE_SIZE (0x400)
#define GPIO_ENABLE
#define SYSCONFIG_GPIO_ENABLE
#define PIO_INT_STAT_OFFSET (0x214)
#define PIO_INT_CTRL_OFFSET (0x210)
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/ioport.h>
#include <asm/irq.h>
#include <asm/io.h>
#include <mach/irqs.h>
#include <linux/i2c.h>
typedef enum {
PIO_INT_CFG0_OFFSET = 0x200,
PIO_INT_CFG1_OFFSET = 0x204,
PIO_INT_CFG2_OFFSET = 0x208,
PIO_INT_CFG3_OFFSET = 0x20c,
} int_cfg_offset;
typedef enum{
POSITIVE_EDGE = 0x0,
NEGATIVE_EDGE = 0x1,
HIGH_LEVEL = 0x2,
LOW_LEVEL = 0x3,
DOUBLE_EDGE = 0x4
} ext_int_mode;
// gpio base address
#define PIO_BASE_ADDRESS (0x01c20800)
#define PIO_RANGE_SIZE (0x400)
#define GPIO_ENABLE
#define SYSCONFIG_GPIO_ENABLE
#define PIO_INT_STAT_OFFSET (0x214)
#define PIO_INT_CTRL_OFFSET (0x210)