diff options
| author | Michael Hennerich <michael.hennerich@analog.com> | 2010-10-27 18:33:19 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-27 21:03:07 -0400 |
| commit | 459773ae8dbbd480886d186181c6bc2e8556025f (patch) | |
| tree | 38d738b858105a46a473bcae0958e2ded77a2e21 /include/linux/i2c | |
| parent | ead6db084392349ad33323b1bb2916058dd7e82b (diff) | |
gpio: adp5588-gpio: support interrupt controller
Implement irq_chip functionality on ADP5588/5587 GPIO expanders. Only
level sensitive interrupts are supported. Interrupts provided by this
irq_chip must be requested using request_threaded_irq().
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/i2c')
| -rw-r--r-- | include/linux/i2c/adp5588.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/i2c/adp5588.h b/include/linux/i2c/adp5588.h index 269181b8f62..531376b7777 100644 --- a/include/linux/i2c/adp5588.h +++ b/include/linux/i2c/adp5588.h | |||
| @@ -74,6 +74,20 @@ | |||
| 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_INT_CFG (1 << 4) | ||
| 81 | #define ADP5588_GPI_IEN (1 << 1) | ||
| 82 | |||
| 83 | /* Interrupt Status Register */ | ||
| 84 | #define ADP5588_GPI_INT (1 << 1) | ||
| 85 | #define ADP5588_KE_INT (1 << 0) | ||
| 86 | |||
| 87 | #define ADP5588_MAXGPIO 18 | ||
| 88 | #define ADP5588_BANK(offs) ((offs) >> 3) | ||
| 89 | #define ADP5588_BIT(offs) (1u << ((offs) & 0x7)) | ||
| 90 | |||
| 77 | /* Put one of these structures in i2c_board_info platform_data */ | 91 | /* Put one of these structures in i2c_board_info platform_data */ |
| 78 | 92 | ||
| 79 | #define ADP5588_KEYMAPSIZE 80 | 93 | #define ADP5588_KEYMAPSIZE 80 |
| @@ -128,6 +142,7 @@ struct adp5588_kpad_platform_data { | |||
| 128 | 142 | ||
| 129 | struct adp5588_gpio_platform_data { | 143 | struct adp5588_gpio_platform_data { |
| 130 | unsigned gpio_start; /* GPIO Chip base # */ | 144 | unsigned gpio_start; /* GPIO Chip base # */ |
| 145 | unsigned irq_base; /* interrupt base # */ | ||
| 131 | unsigned pullup_dis_mask; /* Pull-Up Disable Mask */ | 146 | unsigned pullup_dis_mask; /* Pull-Up Disable Mask */ |
| 132 | int (*setup)(struct i2c_client *client, | 147 | int (*setup)(struct i2c_client *client, |
| 133 | int gpio, unsigned ngpio, | 148 | int gpio, unsigned ngpio, |
