From patchwork Thu Nov 2 17:49:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 833461 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="cdBa2OTv"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3ySXl84SP4z9sMN for ; Fri, 3 Nov 2017 04:53:56 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933558AbdKBRxl (ORCPT ); Thu, 2 Nov 2017 13:53:41 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:43147 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933553AbdKBRtx (ORCPT ); Thu, 2 Nov 2017 13:49:53 -0400 Received: by mail-wr0-f193.google.com with SMTP id w105so343586wrc.0; Thu, 02 Nov 2017 10:49:52 -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=FKvVdlvTMZTs2ZaYgXp18OqI+wfsvxQZH/U24DHTjbs=; b=cdBa2OTvNs+IZVNqczOuWf6XCnEhB40NwdllPi9NPI01ZSLG3Zv8H4v456QJazXt7B OXgAJyhBpdyNGutrdBH70edXCglO/TYfj/A1f1mTdudYnzw8+vfzETJAe8X9Uh+RRiNV MwiS0Q+N8vqFa/X30q3Qsab1oQw7RAATjwvGyKRn5JBcxugI3AMqixUKLx46kIEGj3La lTOZ+VFyahrO7TngGEcQmxToeVJEEmTE2vmSpv8CcHZVshT9C6qcaUNH2MfwlM7Q5hTo 0PJjNdTOsNEnD9tejKM2NBOb3fNzU4J4B7qki7Vogybmfd23ecvaWxWuWzMJPfIMOaKu R9Ow== 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=FKvVdlvTMZTs2ZaYgXp18OqI+wfsvxQZH/U24DHTjbs=; b=YQuem1KjgzWxJCq/xDQNxIRs3lW7JyvVyNQ+1avrIy0oJckYzGeSMBdg9ya+lw5mlM 9c28X6FR9EFiE/uq3K/7NHAibRtQET8fKaUk5PNh+rpt7XP12k0itPzngv6UbzolyMIf KLmfrh0xR0m8XkIenQamrlDiAQACLvmMZJgtDmLv3ezWeFAzTiY7QBglTJnAUqCT0Rin S1+RmQEmUa2FHT2amKsiit7tgR2R+eJL3u9xORuNqGm1K/h1JyOys0uSlnPbT/Ur3ypX nVcbYAr/TLOj9wF9bU+uPSOdZLIxUiBEzlyLdNemJKCpbZ3Ph4qoLSERkiG1UDerZsQY nrsA== X-Gm-Message-State: AMCzsaUb5IT2l5kg6CwsM1eZNI0s7fictTGTcUmSofmExsIMHGyvRRi8 nDKqP7q2tbP+QAzoXiqD58U= X-Google-Smtp-Source: ABhQp+T6bMh/dyajYEfagp0esmeSfdAbdOIQfvjyfi05/BysMOhHjlAqBQae8ACGVq1WVS6mqdYUBA== X-Received: by 10.223.153.234 with SMTP id y97mr3592914wrb.165.1509644991405; Thu, 02 Nov 2017 10:49:51 -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 m37sm6286448wrm.4.2017.11.02.10.49.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 02 Nov 2017 10:49:50 -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 05/12] gpio: Move irq_default_type to struct gpio_irq_chip Date: Thu, 2 Nov 2017 18:49:34 +0100 Message-Id: <20171102174941.3461-6-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 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 dafbca12c4ca..d3608cf511de 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 864f507e859b..1367fa94105f 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h @@ -54,6 +54,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: * @@ -140,8 +148,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). @@ -220,7 +226,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;