From patchwork Tue Nov 7 18:15:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 835417 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="Cf88syIv"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yWd3n24skz9s7c for ; Wed, 8 Nov 2017 05:19:01 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755865AbdKGSQO (ORCPT ); Tue, 7 Nov 2017 13:16:14 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:43919 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755528AbdKGSQK (ORCPT ); Tue, 7 Nov 2017 13:16:10 -0500 Received: by mail-wm0-f66.google.com with SMTP id r68so13951948wmr.0; Tue, 07 Nov 2017 10:16:09 -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=VwqU6Yvklx7vekY1eWd69kl2jNoOk8gMjQsql06ZJOo=; b=Cf88syIvdESsHczOruJCp4bK7Vql6Vktv6AOXm+WJDqiEq4oN/R5G23lcORc/I1+ZG yObs/3mcuBI8ZFNChKlCaeR0ImDqTzWKWHGLn802ZvDPDcl/A4aKKdHpOLnh4o+4jyNg cznQeBGbFZ+ohoVZKBPADfMebzV8C9MKfnp/RKBqgBd5DD9cHlJh8AX3lDz5p+/P1neU s/LS86ihr+TEOY2LBACfk0leGeYnmdwTtSg3pVQyDX0YRjEHWne4qMwP7c5eb+aAOx2F +Yv1X27ZzNXh2H7bpTC86S5bS+VwqWtdoL070D9hUIa8ATBA0QRYDzGbibq/spZA2CLJ VpPg== 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=VwqU6Yvklx7vekY1eWd69kl2jNoOk8gMjQsql06ZJOo=; b=jxJDwmOgz3gQHD8zVS58Q5ivYPybJ5sVyuHUi8YRRlL4sIUrOYAV/eJNm3Yy/Uxpge gZ9nR/JFkO6cqAsopI6pXO3Iy1EDwrxoDfpIA+YftrWFbmPXV4l9KlfTiwYdXUTJ/dZA uzzGADF6+pz7pA+cAWKHMcgoX8AMfErGYlDNw+9gPFPkAXGexak1BMeNfu/fUV/Ct0i8 hzQida+AOi0+r4SGn56lMG7P1MukhC84u2UtJgot9dht9RxWFi9orrrfoNc5wIOvU/Ru alzyZnk/jG5beftpBNy4D9sHBY9y+9FOQIdamFfHZCrdA/ZpHbz+knwvfkjTyah5+Evh j4AQ== X-Gm-Message-State: AJaThX7FsPFxaTz//yobCLYs5+M8SOrV4bv1nMjWHKYtYnQIRMx2HVsm +bhR7t+B17ig9r8tO/0RYM8= X-Google-Smtp-Source: ABhQp+TbVHbUliYy6xw1eC3OLUFtqy7wwloJ9wpWP8K4lnfX1rlWYen+H7eLQJawMsSk30lJoYD/xQ== X-Received: by 10.28.23.67 with SMTP id 64mr31990wmx.101.1510078568832; Tue, 07 Nov 2017 10:16:08 -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 o18sm932211wrh.23.2017.11.07.10.16.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Nov 2017 10:16:08 -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 05/15] gpio: Move irq_default_type to struct gpio_irq_chip Date: Tue, 7 Nov 2017 19:15:49 +0100 Message-Id: <20171107181559.6318-6-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-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 | 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 1add11d12ca0..6b0eef375b58 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -1656,8 +1656,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; } @@ -1821,7 +1821,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 5b6ef78cb196..7bafae934112 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h @@ -55,6 +55,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: * @@ -141,8 +149,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). @@ -221,7 +227,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;