diff options
Diffstat (limited to 'include/linux/i2c/adp5588.h')
-rw-r--r-- | include/linux/i2c/adp5588.h | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/include/linux/i2c/adp5588.h b/include/linux/i2c/adp5588.h index 269181b8f623..cec17cf6cac2 100644 --- a/include/linux/i2c/adp5588.h +++ b/include/linux/i2c/adp5588.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Analog Devices ADP5588 I/O Expander and QWERTY Keypad Controller | 2 | * Analog Devices ADP5588 I/O Expander and QWERTY Keypad Controller |
3 | * | 3 | * |
4 | * Copyright 2009 Analog Devices Inc. | 4 | * Copyright 2009-2010 Analog Devices Inc. |
5 | * | 5 | * |
6 | * Licensed under the GPL-2 or later. | 6 | * Licensed under the GPL-2 or later. |
7 | */ | 7 | */ |
@@ -74,6 +74,33 @@ | |||
74 | 74 | ||
75 | #define ADP5588_DEVICE_ID_MASK 0xF | 75 | #define ADP5588_DEVICE_ID_MASK 0xF |
76 | 76 | ||
77 | /* Configuration Register1 */ | ||
78 | #define ADP5588_AUTO_INC (1 << 7) | ||
79 | #define ADP5588_GPIEM_CFG (1 << 6) | ||
80 | #define ADP5588_OVR_FLOW_M (1 << 5) | ||
81 | #define ADP5588_INT_CFG (1 << 4) | ||
82 | #define ADP5588_OVR_FLOW_IEN (1 << 3) | ||
83 | #define ADP5588_K_LCK_IM (1 << 2) | ||
84 | #define ADP5588_GPI_IEN (1 << 1) | ||
85 | #define ADP5588_KE_IEN (1 << 0) | ||
86 | |||
87 | /* Interrupt Status Register */ | ||
88 | #define ADP5588_CMP2_INT (1 << 5) | ||
89 | #define ADP5588_CMP1_INT (1 << 4) | ||
90 | #define ADP5588_OVR_FLOW_INT (1 << 3) | ||
91 | #define ADP5588_K_LCK_INT (1 << 2) | ||
92 | #define ADP5588_GPI_INT (1 << 1) | ||
93 | #define ADP5588_KE_INT (1 << 0) | ||
94 | |||
95 | /* Key Lock and Event Counter Register */ | ||
96 | #define ADP5588_K_LCK_EN (1 << 6) | ||
97 | #define ADP5588_LCK21 0x30 | ||
98 | #define ADP5588_KEC 0xF | ||
99 | |||
100 | #define ADP5588_MAXGPIO 18 | ||
101 | #define ADP5588_BANK(offs) ((offs) >> 3) | ||
102 | #define ADP5588_BIT(offs) (1u << ((offs) & 0x7)) | ||
103 | |||
77 | /* Put one of these structures in i2c_board_info platform_data */ | 104 | /* Put one of these structures in i2c_board_info platform_data */ |
78 | 105 | ||
79 | #define ADP5588_KEYMAPSIZE 80 | 106 | #define ADP5588_KEYMAPSIZE 80 |
@@ -126,9 +153,12 @@ struct adp5588_kpad_platform_data { | |||
126 | const struct adp5588_gpio_platform_data *gpio_data; | 153 | const struct adp5588_gpio_platform_data *gpio_data; |
127 | }; | 154 | }; |
128 | 155 | ||
156 | struct i2c_client; /* forward declaration */ | ||
157 | |||
129 | struct adp5588_gpio_platform_data { | 158 | struct adp5588_gpio_platform_data { |
130 | unsigned gpio_start; /* GPIO Chip base # */ | 159 | int gpio_start; /* GPIO Chip base # */ |
131 | unsigned pullup_dis_mask; /* Pull-Up Disable Mask */ | 160 | unsigned irq_base; /* interrupt base # */ |
161 | unsigned pullup_dis_mask; /* Pull-Up Disable Mask */ | ||
132 | int (*setup)(struct i2c_client *client, | 162 | int (*setup)(struct i2c_client *client, |
133 | int gpio, unsigned ngpio, | 163 | int gpio, unsigned ngpio, |
134 | void *context); | 164 | void *context); |