From patchwork Thu Nov 2 17:49:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 833468 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-gpio-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="AMd/Zstp"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3ySXmf2dhtz9sPm for ; Fri, 3 Nov 2017 04:55:14 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933396AbdKBRts (ORCPT ); Thu, 2 Nov 2017 13:49:48 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:50391 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933295AbdKBRtq (ORCPT ); Thu, 2 Nov 2017 13:49:46 -0400 Received: by mail-wm0-f66.google.com with SMTP id s66so536548wmf.5; Thu, 02 Nov 2017 10:49:45 -0700 (PDT) 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=Ga+wTVN34fka+7Z7rwKGC/etQydnjGrs0J/6FL/WWiE=; b=AMd/Zstp+9XVIvz90BfyZoXG+75MpEuLqkSD7m3CgbuSQlen7kkXUHFVFuDqf7XJmj hkpHqM1mJw1gsaxxixp4dRhwyDIDC7+JTidLvlQvVAZjk6aF/eU/mZuI4JCY8d7XnNKe jc5x6pjUiGVlrQAgg4VbB6/z/RI5FFP8d9qEW6YgVCC0sfPzUE/9XYiZlhvP6UY9SKrB tb0+KwNmM4XLPOJwy3oryih3gi/5yxpvY/glTrSSZveTRKwxs2EH0hzGi9UpNkW00BMA 5yfrZbvA3qMzugUik4hnRsyhBSLoJcCknLk4X5ZG8hlQ/c1rYUsJa2kVaz2AtdY1+mY5 GbEw== 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=Ga+wTVN34fka+7Z7rwKGC/etQydnjGrs0J/6FL/WWiE=; b=Oid3SKBUHTrpgnHbEV0LLqXsc3aGT07utGm3MuCeqpMoiITjMEFK8tYP8qQU5/Ci5s qV4mv99edRD+zW7inPpLQpzUjMBquq2F7LncCAhyAvztLPPJW/sSK4qth33pmkltcQNz vzFkFqiLHBYdl0uiGq09r6RUtCj4Jlazml4sX6xWeXkgvAdOC3UpwyjdK944robguCrV 9oto9Rjm2Bpf8OoJH1FAiCoZDcqjwBwUEGbo9TMIldN9h/uIOBkkdDH2M1Mnox5S1zzG DokULwmuF+d6DN+mDohtTfxoiY6+ph98ZWCBWLO4YCjyWQhwOxD5GCJlsKyB9sHgK0pa B5kw== X-Gm-Message-State: AMCzsaVY5WzcShtQxkIVqIuEjDYNNqTR9dKMgRLYx0mYGMTsr/TqeZ4a +GuCv6/omh7zfF+ThPyiSfs= X-Google-Smtp-Source: ABhQp+RCRDHKWDXTvCnghKcyJPtHR2Jsi6mGGKRtv6DmDRk6ygulEY9BYNga+bRJf/dakR3NVjI8wQ== X-Received: by 10.28.93.200 with SMTP id r191mr2501805wmb.19.1509644984789; Thu, 02 Nov 2017 10:49:44 -0700 (PDT) Received: from localhost (p200300E41BC8E9001FF851737372D2C2.dip0.t-ipconnect.de. [2003:e4:1bc8:e900:1ff8:5173:7372:d2c2]) by smtp.gmail.com with ESMTPSA id r23sm2187923wrc.93.2017.11.02.10.49.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 02 Nov 2017 10:49:44 -0700 (PDT) From: Thierry Reding To: Linus Walleij Cc: Grygorii Strashko , Jonathan Hunter , linux-gpio@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 01/12] gpio: Introduce struct gpio_irq_chip Date: Thu, 2 Nov 2017 18:49:30 +0100 Message-Id: <20171102174941.3461-2-thierry.reding@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171102174941.3461-1-thierry.reding@gmail.com> References: <20171102174941.3461-1-thierry.reding@gmail.com> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@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 ed04fa2a00a8..36a065521fa0 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h @@ -19,6 +19,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 @@ -176,6 +206,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)