From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752999AbdKGSUF (ORCPT ); Tue, 7 Nov 2017 13:20:05 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:46333 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755493AbdKGSQE (ORCPT ); Tue, 7 Nov 2017 13:16:04 -0500 X-Google-Smtp-Source: ABhQp+TRsrifbFNjx87jNgaEGbu7U1bs7kRCLcwv8h7tD9P6DQGwzp9v1ZKLIfHNzMHVVwq7IywRiA== From: Thierry Reding To: Linus Walleij , Grygorii Strashko Cc: Jonathan Hunter , linux-gpio@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v7 01/15] gpio: Introduce struct gpio_irq_chip Date: Tue, 7 Nov 2017 19:15:45 +0100 Message-Id: <20171107181559.6318-2-thierry.reding@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171107181559.6318-1-thierry.reding@gmail.com> References: <20171107181559.6318-1-thierry.reding@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thierry Reding This new structure will be used to group all fields related to interrupt handling in a GPIO chip. Doing so will properly namespace these fields and make it easier to distinguish which fields are used for IRQ support. Signed-off-by: Thierry Reding --- include/linux/gpio/driver.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index 8cbbba497b6f..c25d058e6c71 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h @@ -20,6 +20,36 @@ struct module; #ifdef CONFIG_GPIOLIB +#ifdef CONFIG_GPIOLIB_IRQCHIP +/** + * struct gpio_irq_chip - GPIO interrupt controller + */ +struct gpio_irq_chip { + /** + * @domain_ops: + * + * Table of interrupt domain operations for this IRQ chip. + */ + const struct irq_domain_ops *domain_ops; + + /** + * @parent_handler: + * + * The interrupt handler for the GPIO chip's parent interrupts, may be + * NULL if the parent interrupts are nested rather than cascaded. + */ + irq_flow_handler_t parent_handler; + + /** + * @parent_handler_data: + * + * Data associated, and passed to, the handler for the parent + * interrupt. + */ + void *parent_handler_data; +}; +#endif + /** * struct gpio_chip - abstract a GPIO controller * @label: a functional name for the GPIO device, such as a part @@ -177,6 +207,14 @@ struct gpio_chip { bool irq_need_valid_mask; unsigned long *irq_valid_mask; struct lock_class_key *lock_key; + + /** + * @irq: + * + * Integrates interrupt chip functionality with the GPIO chip. Can be + * used to handle IRQs for most practical cases. + */ + struct gpio_irq_chip irq; #endif #if defined(CONFIG_OF_GPIO) -- 2.14.1