Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp732234ybe; Fri, 6 Sep 2019 06:32:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqx1H8JiOBCNZiecLM+yhybdxT+1gJvrZitZKVf5ILNZmuPIuuOjtdLgkIgp/LetJwebgCGT X-Received: by 2002:a63:534d:: with SMTP id t13mr8005615pgl.313.1567776756571; Fri, 06 Sep 2019 06:32:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567776756; cv=none; d=google.com; s=arc-20160816; b=eUlreAljalQAaS4ugtd7FbP3W4Mlthdj3ngPkMUg5nj8OD/Vzelqo/D58aXxckSwea 0a2T9PF6beP8qbSFMTn5ljGRHq2Gz6WBtKuT64mlBfDl6W0xQin051MEBtCC/gyoOF3t c1WyORzRtFBqCpA1v1rlDsZQM8vmTTDJn1wdfUFV6sk1Hp6qv1u9G7M4y1csOQ6YXooo dA0oPfXS92cxoKRaBfrNpI1sdCREhN/Q1BadH4GNaxt6Pd0/zF9FT8l6VW6fwbbGcK+v Pxmq8XySqYyf/G7MD+Tb4jB9536IC2fUQxPnfHrj70vMOszB0FRH+0/tx7nrj1EpCJVp 7KJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=nBz/Nw09bo2+Nxy27B6Bnst72+LgNmbIsMhxAo7ybD0=; b=DpNrigg3E/hlTGLLX9K6Hq+zgcTE+GkaBhOsOg70MNlOonw1vP+DVHZR1TFp8/oizE cMJoVO2P48JA9HuRD44up9CWL7yhGnDjPud6HTl4+LRj7x+ygfgQ02B4KRJsFUtIu+74 R97qcyUHNmsCv42BE8s/fHDZmySLqh5/B38i6+wKtN+9pCjKARm+Rsu49v9sxrI3PceK j7LJ3GDgbEFDKbKQs/HG9itRQgVqPXcnUHYFbXnMegICpNBNLUM4GazhsDNRGdWfxvyQ AW+JG4TUcFl02F44tc4bp+b/eG+rOVLAmjNPqSAkaO18QMV24dBvCU3h7josgW3pDZR0 f02A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aUMqxfSd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v16si4704880pjn.83.2019.09.06.06.32.19; Fri, 06 Sep 2019 06:32:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aUMqxfSd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392117AbfIFG0z (ORCPT + 99 others); Fri, 6 Sep 2019 02:26:55 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:45271 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727970AbfIFG0y (ORCPT ); Fri, 6 Sep 2019 02:26:54 -0400 Received: by mail-pg1-f196.google.com with SMTP id 4so2873049pgm.12; Thu, 05 Sep 2019 23:26:54 -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:mime-version :content-transfer-encoding; bh=nBz/Nw09bo2+Nxy27B6Bnst72+LgNmbIsMhxAo7ybD0=; b=aUMqxfSdSnkuwGPqLRjheiUFzikOfV2fc0xU5mynUICbJ06VKhxLcszMC7XIGhR+9a LCox84h/CIDLKI1gSOXrLAHb3iR6w4VFUPCGACcdJ6Ma0OQwvRE2K/M2jl30aGnGEUHh qtdsJvleLml70aYLbf52MZduXl+OBtmnBO7lfJ5+23BRakN9poArHpHZ7Vp3xIAEP4Ip IKpv9txRDkokW+UwGti5JJzeptzCSA4SXd8fNu4C6HaAUyOdEMbrrwRHBDnX2D1FweAj 5DG0jbewwAw/rv0ZkvJaoVxtqR6FcgG8OKwBRl3aqO1YWYoIVxWHLYc9xe36ZLlCKuq8 nnWQ== 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:mime-version :content-transfer-encoding; bh=nBz/Nw09bo2+Nxy27B6Bnst72+LgNmbIsMhxAo7ybD0=; b=LD0Dgs7/gCXWkOHszPhgTgmBJ2OpQRIJrPLu0v58olzYWkz9991zilQHdXZwDDiKuM vGGCYzwWZ/mM33ro1czNCBD63dJlOSZJdn6bWaMA5/CbTZOfSLriXd+jHaHupWtQW4iC Zv23bG+S3gMkdaoPK8DxkBG4SOFyvQSRT5EUH58EHiQYQgQrRbZOI1WAICJfQC6n+zkd 9/AUozEIv5QZLyD2+GY2bDt8GCPTlC1gohy1jXBXcM8oS9jjbji6h5CHrorcjM0F1ICW 37HJPukQe/chlHSpGlQg2a5utqX8HBnCAbaxq5jM6q61mcZRyQvlHfkzi9t5wwdjRlf1 MpRA== X-Gm-Message-State: APjAAAXRQTGMAyg+YzTGONA03fPAobCFV3+18yaJY9zY3gBlR8D8kzlf wKaK0ZE9nRNZzP9QY3Ztkjg= X-Received: by 2002:a63:6904:: with SMTP id e4mr6538279pgc.321.1567751214158; Thu, 05 Sep 2019 23:26:54 -0700 (PDT) Received: from rashmica.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id a20sm3109704pfo.33.2019.09.05.23.26.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2019 23:26:53 -0700 (PDT) From: Rashmica Gupta To: linus.walleij@linaro.org Cc: Rashmica Gupta , Bartosz Golaszewski , Joel Stanley , Andrew Jeffery , linux-gpio@vger.kernel.org (open list:GPIO SUBSYSTEM), linux-arm-kernel@lists.infradead.org (moderated list:ARM/ASPEED MACHINE SUPPORT), linux-aspeed@lists.ozlabs.org (moderated list:ARM/ASPEED MACHINE SUPPORT), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v3 3/5] gpio/aspeed: Setup irqchip dynamically Date: Fri, 6 Sep 2019 16:26:44 +1000 Message-Id: <20190906062644.13445-1-rashmica.g@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is in preparation for adding ast2600 support. The ast2600 SoC requires two instances of the GPIO driver as it has two GPIO controllers. Each instance needs it's own irqchip. Signed-off-by: Rashmica Gupta --- drivers/gpio/gpio-aspeed.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/gpio/gpio-aspeed.c b/drivers/gpio/gpio-aspeed.c index b83e23aecd18..16c6eaf70857 100644 --- a/drivers/gpio/gpio-aspeed.c +++ b/drivers/gpio/gpio-aspeed.c @@ -52,6 +52,7 @@ struct aspeed_gpio_config { */ struct aspeed_gpio { struct gpio_chip chip; + struct irq_chip irqc; spinlock_t lock; void __iomem *base; int irq; @@ -681,14 +682,6 @@ static void aspeed_gpio_irq_handler(struct irq_desc *desc) chained_irq_exit(ic, desc); } -static struct irq_chip aspeed_gpio_irqchip = { - .name = "aspeed-gpio", - .irq_ack = aspeed_gpio_irq_ack, - .irq_mask = aspeed_gpio_irq_mask, - .irq_unmask = aspeed_gpio_irq_unmask, - .irq_set_type = aspeed_gpio_set_type, -}; - static void set_irq_valid_mask(struct aspeed_gpio *gpio) { const struct aspeed_bank_props *props = gpio->config->props; @@ -1192,7 +1185,12 @@ static int __init aspeed_gpio_probe(struct platform_device *pdev) gpio->irq = rc; girq = &gpio->chip.irq; - girq->chip = &aspeed_gpio_irqchip; + girq->chip = &gpio->irqc; + girq->chip->name = dev_name(&pdev->dev); + girq->chip->irq_ack = aspeed_gpio_irq_ack; + girq->chip->irq_mask = aspeed_gpio_irq_mask; + girq->chip->irq_unmask = aspeed_gpio_irq_unmask; + girq->chip->irq_set_type = aspeed_gpio_set_type; girq->parent_handler = aspeed_gpio_irq_handler; girq->num_parents = 1; girq->parents = devm_kcalloc(&pdev->dev, 1, -- 2.20.1