Commit 459773ae authored by Michael Hennerich's avatar Michael Hennerich Committed by Linus Torvalds

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: default avatarMichael Hennerich <michael.hennerich@analog.com>
Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent ead6db08
......@@ -272,6 +272,13 @@ config GPIO_ADP5588
To compile this driver as a module, choose M here: the module will be
called adp5588-gpio.
config GPIO_ADP5588_IRQ
bool "Interrupt controller support for ADP5588"
depends on GPIO_ADP5588=y
help
Say yes here to enable the adp5588 to be used as an interrupt
controller. It requires the driver to be built in the kernel.
comment "PCI GPIO expanders:"
config GPIO_CS5535
......
This diff is collapsed.
......@@ -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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment