summaryrefslogtreecommitdiffstats
path: root/include/linux/i2c
diff options
context:
space:
mode:
authorMichael Hennerich <michael.hennerich@analog.com>2010-10-27 15:33:19 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-27 18:03:07 -0700
commit459773ae8dbbd480886d186181c6bc2e8556025f (patch)
tree38d738b858105a46a473bcae0958e2ded77a2e21 /include/linux/i2c
parentead6db084392349ad33323b1bb2916058dd7e82b (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.h15
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 @@
#define ADP5588_DEVICE_ID_MASK 0xF
+ /* Configuration Register1 */
+#define ADP5588_AUTO_INC (1 << 7)
+#define ADP5588_GPIEM_CFG (1 << 6)
+#define ADP5588_INT_CFG (1 << 4)
+#define ADP5588_GPI_IEN (1 << 1)
+
+/* Interrupt Status Register */
+#define ADP5588_GPI_INT (1 << 1)
+#define ADP5588_KE_INT (1 << 0)
+
+#define ADP5588_MAXGPIO 18
+#define ADP5588_BANK(offs) ((offs) >> 3)
+#define ADP5588_BIT(offs) (1u << ((offs) & 0x7))
+
/* Put one of these structures in i2c_board_info platform_data */
#define ADP5588_KEYMAPSIZE 80
@@ -128,6 +142,7 @@ struct adp5588_kpad_platform_data {
struct adp5588_gpio_platform_data {
unsigned gpio_start; /* GPIO Chip base # */
+ unsigned irq_base; /* interrupt base # */
unsigned pullup_dis_mask; /* Pull-Up Disable Mask */
int (*setup)(struct i2c_client *client,
int gpio, unsigned ngpio,