From patchwork Fri Sep 1 18:57:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 808970 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="LOBZISWP"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3xkT9c6B5hz9sPm for ; Sat, 2 Sep 2017 05:01:17 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752360AbdIATBB (ORCPT ); Fri, 1 Sep 2017 15:01:01 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:37055 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752366AbdIAS5u (ORCPT ); Fri, 1 Sep 2017 14:57:50 -0400 Received: by mail-wm0-f66.google.com with SMTP id x189so953537wmg.4; Fri, 01 Sep 2017 11:57:49 -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=1wVlPjQrEkrdROjpqBO9eS9yvsFEwPP7QoCqagPwxnY=; b=LOBZISWPgizhxeiTjByRQ3cmjpPdkWJL+sJdA1Pk3y5fygXRaZ4zzNqJFH+cq+T4T+ MEUjnQpDicWcYV9Ik5li+qg54cbonvwRXlNGApRmQo4ulPgdQ4hWqkreYtQCFxYeBZ6W bM61a9sycifgc3jQdX+Von3lXviGunwXj/4UYIqghsCHWX5rUvWxUlYDg+ayE9wrzEus xbyZMqjl7619xxvVM4QooZMmwyd3dhjuKfp6F0T4Nj0VKnSlTSYNTP2ENOebcUlEF4aE QeV0OSkiFe9iXR6rbYONq0F5bA4aGWQYsOwo+ZyDfEuNjfHSSxV3cuKSGNmcNy5aBYyA miog== 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=1wVlPjQrEkrdROjpqBO9eS9yvsFEwPP7QoCqagPwxnY=; b=g9tUM4DeNYxFJWrwLnl6rsFa6UhJaizl1JBs6HrHk6KFumLmeytQtYFdOLsMtT4LKc MEpfkcO5gxS3MHek57OMmklI7lU22DS0GZjvbkRCGqIToZuv3F1xY2tiobQ43o8/LKpq LSLpDP059ss9lfbJaic25J8Vb3vCtJkoX+9DYOSfV8gki1A4EzVuK+5t6IKzkiz45Zv/ cFhXnagZj+RM8MAHn+7da1IghPkGQ8fpZiV58PaxCD8y7NfLhM3eM5bqnIauuwe1TI4q PuCEvcIeH1o92mb7YbUU42tyLNKzuyX/kvYFJxH7+Bvz4y6nNkInyFAozlQuhyq9hTaX 1Daw== X-Gm-Message-State: AHPjjUgdFewrTSYZDwZCybLoQ6DePLtxkCROvANvDiJNzAXvMoIPonuk pCGRw9UjQCSUaKyu X-Google-Smtp-Source: ADKCNb5CvFQFvh10OwhXD0wCB9VBUYOUmiCF8nSOxoZzvsfOW5Y874SWz6yROAxCgS6VWosVaxihrw== X-Received: by 10.28.175.14 with SMTP id y14mr1054240wme.42.1504292268758; Fri, 01 Sep 2017 11:57:48 -0700 (PDT) Received: from localhost (p200300E41BD6D60076D02BFFFE273F51.dip0.t-ipconnect.de. [2003:e4:1bd6:d600:76d0:2bff:fe27:3f51]) by smtp.gmail.com with ESMTPSA id g106sm1070013wrd.4.2017.09.01.11.57.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Sep 2017 11:57:47 -0700 (PDT) From: Thierry Reding To: Linus Walleij Cc: Jonathan Hunter , linux-gpio@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 06/16] gpio: Move irq_default_type to struct gpio_irq_chip Date: Fri, 1 Sep 2017 20:57:26 +0200 Message-Id: <20170901185736.28051-7-thierry.reding@gmail.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170901185736.28051-1-thierry.reding@gmail.com> References: <20170901185736.28051-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 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 | 10 +++++----- include/linux/gpio/driver.h | 11 ++++++++--- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 75fa734cfa98..774d6047116a 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -1666,8 +1666,8 @@ 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; } @@ -1744,7 +1744,7 @@ static int gpiochip_add_irqchip(struct gpio_chip *gpiochip) return -EINVAL; } - type = gpiochip->irq_default_type; + type = gpiochip->irq.default_type; np = gpiochip->parent->of_node; #ifdef CONFIG_OF_GPIO @@ -1773,7 +1773,7 @@ static int gpiochip_add_irqchip(struct gpio_chip *gpiochip) } gpiochip->to_irq = gpiochip_to_irq; - gpiochip->irq_default_type = type; + gpiochip->irq.default_type = type; if (gpiochip->irq.domain_ops) ops = gpiochip->irq.domain_ops; @@ -1961,7 +1961,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 b1398ea0c32a..bcf93afddfa6 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h @@ -63,6 +63,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: * * The interrupt handler for the GPIO chip's parent interrupts, may be @@ -168,8 +176,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). @@ -245,7 +251,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;