From patchwork Fri Oct 13 15:49:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 825538 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="vW9NQlg/"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yDC0Z6342z9sRm for ; Sat, 14 Oct 2017 02:52:46 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751772AbdJMPwZ (ORCPT ); Fri, 13 Oct 2017 11:52:25 -0400 Received: from mail-qt0-f195.google.com ([209.85.216.195]:49387 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758611AbdJMPtd (ORCPT ); Fri, 13 Oct 2017 11:49:33 -0400 Received: by mail-qt0-f195.google.com with SMTP id k31so20367446qta.6; Fri, 13 Oct 2017 08:49:33 -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=bYTtqB6NgM1I8nu9ItrGjmyJZZiDmTUzHXEqCy4f0YE=; b=vW9NQlg/i4izTRHWwV2pD73vjaOa1FcE6tsacccuI6eb6hY5+iGc2IrHBVgYh+2Mrg 6KabfEjnojTIEmEzuEawc5ZdI8L2QaZf7aWmCdyCljjvaeQeb/3tByuaKb67ECvw9ptX WnmGLVM9EA6vjjTAEZPNSxY/qpjjOGWLgqcJiyUPCVBlh2MglZJoIcSdBSEW4ExkenaB cg0d+IZyOcAJVH7wJhu49cZqmrg+elGA+x51XIUsVJKiZE8WW4XMLawYm1fZp+GJS/ch fRelmIlV89d6XIEsBdI5kiSt7TJdSoG77eWWEXnWkVX8zBxuW98Jh6cv2W9U0gaoteCz Q5ug== 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=bYTtqB6NgM1I8nu9ItrGjmyJZZiDmTUzHXEqCy4f0YE=; b=cFmkcf+v3Zy/vgllBBFOkgzrpb0Udi3eWSUNb8pezzSCZjNeSjJFs3QEGeLButyn5+ fllN5vqrLEkJq/3C2W0M/ha/4jqq63xN+kHq5ncaWNbyB3KJk5l1ebOWF7JQJbO3BKBA 4DHKt7goy3hcyobGJDXxKmHvhF80vuoB9N2y50gCtonSXCihSSzi6Nznki90eRJfG6hW +VX4N75d/yW/O/4ktSbHMcrrUMa8lAmSAcPkQg/1fIKt/daG1DZAA2A75t2W0JAr7utv PJ1t7PgYmhW1eI6Kmkga5QjZz2sCfhRw+rzXw+F2gN5x22wfLI5zJUVKT8X3joc1VmF+ OXoA== X-Gm-Message-State: AMCzsaXI7MIYoCpXFnRA4IRw8qjVxWfQFgwA2PBFfT/DdAVz4UhdhA9I wx+54kMroW0WI8UHDmL+rCc= X-Google-Smtp-Source: AOwi7QCxkz7BGXsF6Opn3KTAwJVD8UidWyfGa9wK91fS5R9rlRtcRfTUDgBE05Fw5i9o/F1UhrLaiQ== X-Received: by 10.237.38.36 with SMTP id z33mr2626119qtc.258.1507909772699; Fri, 13 Oct 2017 08:49:32 -0700 (PDT) Received: from localhost (p200300E41BE4FD00CEAD5B94E1CFD280.dip0.t-ipconnect.de. [2003:e4:1be4:fd00:cead:5b94:e1cf:d280]) by smtp.gmail.com with ESMTPSA id s6sm748052qtg.34.2017.10.13.08.49.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Oct 2017 08:49:32 -0700 (PDT) From: Thierry Reding To: Linus Walleij Cc: Jonathan Hunter , Grygorii Strashko , linux-gpio@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 06/13] gpio: Move irq_default_type to struct gpio_irq_chip Date: Fri, 13 Oct 2017 17:49:06 +0200 Message-Id: <20171013154913.29448-7-thierry.reding@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171013154913.29448-1-thierry.reding@gmail.com> References: <20171013154913.29448-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 In order to consolidate the multiple ways to associate an IRQ chip with a GPIO chip, move more fields into the new struct gpio_irq_chip. Signed-off-by: Thierry Reding --- drivers/gpio/gpiolib.c | 6 +++--- include/linux/gpio/driver.h | 11 ++++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 249db95d6181..70b33cfebf4f 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -1650,8 +1650,8 @@ static int gpiochip_irq_map(struct irq_domain *d, unsigned int irq, * No set-up of the hardware will happen if IRQ_TYPE_NONE * is passed as default type. */ - if (chip->irq_default_type != IRQ_TYPE_NONE) - irq_set_irq_type(irq, chip->irq_default_type); + if (chip->irq.default_type != IRQ_TYPE_NONE) + irq_set_irq_type(irq, chip->irq.default_type); return 0; } @@ -1815,7 +1815,7 @@ int gpiochip_irqchip_add_key(struct gpio_chip *gpiochip, gpiochip->irq.chip = irqchip; gpiochip->irq.handler = handler; - gpiochip->irq_default_type = type; + gpiochip->irq.default_type = type; gpiochip->to_irq = gpiochip_to_irq; gpiochip->lock_key = lock_key; gpiochip->irq.domain = irq_domain_add_simple(of_node, diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index d1ca06bfed3f..be856f003895 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h @@ -62,6 +62,14 @@ struct gpio_irq_chip { */ irq_flow_handler_t handler; + /** + * @default_type: + * + * Default IRQ triggering type applied during GPIO driver + * initialization, provided by GPIO driver. + */ + unsigned int default_type; + /** * @parent_handler: * @@ -146,8 +154,6 @@ static inline struct gpio_irq_chip *to_gpio_irq_chip(struct irq_chip *chip) * safely. * @bgpio_dir: shadowed direction register for generic GPIO to clear/set * direction safely. - * @irq_default_type: default IRQ triggering type applied during GPIO driver - * initialization, provided by GPIO driver * @irq_chained_parent: GPIO IRQ chip parent/bank linux irq number, * provided by GPIO driver for chained interrupt (not for nested * interrupts). @@ -223,7 +229,6 @@ struct gpio_chip { * With CONFIG_GPIOLIB_IRQCHIP we get an irqchip inside the gpiolib * to handle IRQs for most practical cases. */ - unsigned int irq_default_type; unsigned int irq_chained_parent; bool irq_nested; bool irq_need_valid_mask;