From patchwork Tue Nov 7 18:15:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 835427 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="oKrUHBqd"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yWd5H6FkMz9t2m for ; Wed, 8 Nov 2017 05:20:19 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755053AbdKGSUE (ORCPT ); Tue, 7 Nov 2017 13:20:04 -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 Received: by mail-wm0-f66.google.com with SMTP id r68so5662485wmr.1; Tue, 07 Nov 2017 10:16:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=VKX+qxQuADkgY58caNIjpu9gaALSAQ5okz6eytGbrXY=; b=oKrUHBqdIaJTBgoMTL0/OS5rqC2yCDEtlj85YtTFyFvNEhNzYrQuCnxs2nXvi69SxO xcuEAuls9YWAsk78f4qBkAw46l3ZfyNq7+ZXYcuFSKNaNrhKHqtLS0y5ZHkcXIqn8nYC GEypEycoYUIck/OT6verdcElawf1SvpSSP+mhnfoOl3geMekKNnTDC2+3SIWnS8Slhhn fCll38RVTPsy7/mcuFe1FvRjPIzSiACUFXMKMxnYoZL20k1Ck6QwIa0xb+x/tSgb1HBQ yMJ7Cd+6x+oOqDwLhyL6yw/edWY9NqoSBwlBP2QodyxO0lOc5CJ6s7X+4w3R7IeM3F+q ckbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=VKX+qxQuADkgY58caNIjpu9gaALSAQ5okz6eytGbrXY=; b=UZiWpKmdtCSb/FZjY4XARsJ8QDAJi+3+wd//flMQ98ZJgCidVav+znXSCd344eC17V RR6gkV9wVQuxvj9IDbYXN4nj1h7/x3ECkcTEsJRLJSzvGodgaa1Afl+/wY2ylwYDz+gn O2iXQ3FRwfSOIkY/j9oDIzZgNdMqDmXiDmBnwLtX+ujryh6HUL1oIE108BD+YFcVIphb 4QL7n0mb4y0Ws9nDyuZVvya+EnDO8OO+2i5xd0vEnOcM2NikVFpfrlxgZlbyYVGxOO2F 1ODJkfVn8xot976O1XX+4cqgChEI7GVG/43YlVVNawDbi8FSdjKQm77LOj/IZkCNlm2S fY7w== X-Gm-Message-State: AJaThX7W85UmRgL5UQG5x0ew7HV/Wf5e9qFCNR3lxe8uGcQ2RU9+SsYX 9W+aDMTjLaZCyr6mhJ0LUrM= X-Google-Smtp-Source: ABhQp+TRsrifbFNjx87jNgaEGbu7U1bs7kRCLcwv8h7tD9P6DQGwzp9v1ZKLIfHNzMHVVwq7IywRiA== X-Received: by 10.28.24.70 with SMTP id 67mr42874wmy.7.1510078562651; Tue, 07 Nov 2017 10:16:02 -0800 (PST) Received: from localhost (p200300E41BC8E9001FF851737372D2C2.dip0.t-ipconnect.de. [2003:e4:1bc8:e900:1ff8:5173:7372:d2c2]) by smtp.gmail.com with ESMTPSA id 11sm2421004wmp.7.2017.11.07.10.16.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Nov 2017 10:16:01 -0800 (PST) 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-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@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)