From patchwork Sat Feb 23 00:50:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 159083 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2369040jaa; Fri, 22 Feb 2019 16:51:34 -0800 (PST) X-Google-Smtp-Source: AHgI3IbZq5z1muFRsgQBzqdYx+CJtPiI6gle6UwzpYMalO9rkLn86hta4raGtS5c71VVO4N+j5E7 X-Received: by 2002:a63:144:: with SMTP id 65mr6720213pgb.38.1550883094066; Fri, 22 Feb 2019 16:51:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550883094; cv=none; d=google.com; s=arc-20160816; b=HOCJcuSXu/hitlV9BEaGwZ9oKjUA7L4tBeUv+5j9gBp9F6eLjo2dLAnZ04woaB/79p F4BpOnttVVygXM4WXoktCje6uQSn6KMK9nHhXwubwO0YhmvSiRPm+LrxLTJqNsPaBpKu 4MkptHhSDXksA03lFSZrhoJAR3Bify6m1wxK0AD/r190C5T4mvs2HwMNdCjsSLpOMbvZ UOqWe8O/3WiaEdlS4MLTNhwAdFt5pdXwge7yFgpULyss0jV6QJtGGqnzPxbXxN/0xBVu J2uj6Ntqwal3iCaPeeHeL5vmEl67ciPDZGzbjn3+W8Q7VEJGUqYsT1mohvUxIVuWlu3u bCbA== 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=4FNvZuK6UIkuGwlX1UNm9fphxASPuUMwfURY50qQi24=; b=yAVe8yxUmgINMTL/0tFGxiW3kjBRyLCxEU4lJH1mwl/pGfuvq6O9eFA1sDAPxxqwqC c3eACYIZM3fpwHMoyXDdjWDCofpVTYVhEQyMOcaxhk0lsEKZScufJGfrN3gbK7D9pX5E WP5/3xAlRvdeLEcP4q7JEkuAd/fQOINYhJGFyPRQi1kmtKPUgK0Y3jAq/3SK8P3A/EsY s/OhqOSgTdcZ+W9FcbtWvi6MKPGMTWIpSBeJ6LXVU9y8UvoM/Orq7nlM2O89l4Bs/AR3 j4pWF/lBpmqKDrgauvllFSt82N872ra1wc6kS4x7CCNsvJbPqQo0Iv08I7wNKKlVFRKA a+JA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=r5LTJE2K; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gn10si2602898plb.94.2019.02.22.16.51.33; Fri, 22 Feb 2019 16:51:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-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=@linaro.org header.s=google header.b=r5LTJE2K; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725900AbfBWAvd (ORCPT + 5 others); Fri, 22 Feb 2019 19:51:33 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:32970 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725774AbfBWAvd (ORCPT ); Fri, 22 Feb 2019 19:51:33 -0500 Received: by mail-lj1-f196.google.com with SMTP id z7so2889188lji.0 for ; Fri, 22 Feb 2019 16:51:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4FNvZuK6UIkuGwlX1UNm9fphxASPuUMwfURY50qQi24=; b=r5LTJE2KsvPKuzoRgNMFMIsjsYUKKPeOx6dn9r+Iqj4vVec7vfP40sxowagerZDbls /iKBeZ5z2AxKS5AECgyKuFKg/gTR+SIv8E3w3LEkHf8pytLdJv/mmxtubvuzywt7DJsU G50izCG46bqrIA2t5sbhozX245wNm5xcUE8pUZPDp8hSYLIm3IJ4hmJlRYMTJyZl4PUN 2AptY6FFDpwPjrJCrpbb0V4TrE5zlv90HkxsAcOnfCm6KW1aAGcgHUylmKc4EANi2FZc AkUhv5CKcovfXV9POD81lHCCpiMothF/Ry0g0F7URwCGhdKKCD6CBA//Pt4ItQmsiwFb 0c/g== 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=4FNvZuK6UIkuGwlX1UNm9fphxASPuUMwfURY50qQi24=; b=ngeqSo3xt+PIaaImia6AIT8gFJRfUE+KEtNXmDf+LdYMFfaPmZ8XeknswrFNW+0pul zWeEa1x+gOMNJybnlMOlBvPNAMONb6szD0Sy7m+CdeC5RBalBMkiPyGgqxJp3J8NkAp2 rSTX8euyQ46lXwHstMwvMnXPxDr6ZAAiRuJFiCV75EJwWjhsgDseK0k1u9ScOhIVkoIU cmcO5hnoFE+L+syuOjr4BWQ06ZJA+4WdoKeltoffVJl2P71hfkHXjz4AvUPEUnma7eLz 2SQ9/ozmyLxfXVvpD5LiR4SJm0CeBDIP52liDGM/xzZUYDn+AGvA+5YfKxpmp3A1ksVC WNnA== X-Gm-Message-State: AHQUAubfsEtFUKVjdc168mVZQVNPYfU9RpsW0s1iIguPNDoMMcEvPgiz u7DMcryWXeUR2bT1djDo7RX0TDwrBmg= X-Received: by 2002:a2e:5357:: with SMTP id t23mr3719745ljd.8.1550883090523; Fri, 22 Feb 2019 16:51:30 -0800 (PST) Received: from localhost.bredbandsbolaget (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id x2sm799915ljj.79.2019.02.22.16.51.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 22 Feb 2019 16:51:27 -0800 (PST) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Bartosz Golaszewski , Linus Walleij Subject: [PATCH] gpio: ftgpio: Register per-instance irqchip Date: Sat, 23 Feb 2019 01:50:48 +0100 Message-Id: <20190223005048.4657-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org This augments the FTGPIO010 to register one irqchip per instance instead of using a static definition. Signed-off-by: Linus Walleij --- drivers/gpio/gpio-ftgpio010.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) -- 2.20.1 diff --git a/drivers/gpio/gpio-ftgpio010.c b/drivers/gpio/gpio-ftgpio010.c index 95f578804b0e..45fe125823a8 100644 --- a/drivers/gpio/gpio-ftgpio010.c +++ b/drivers/gpio/gpio-ftgpio010.c @@ -41,12 +41,14 @@ * struct ftgpio_gpio - Gemini GPIO state container * @dev: containing device for this instance * @gc: gpiochip for this instance + * @irq: irqchip for this instance * @base: remapped I/O-memory base * @clk: silicon clock */ struct ftgpio_gpio { struct device *dev; struct gpio_chip gc; + struct irq_chip irq; void __iomem *base; struct clk *clk; }; @@ -134,14 +136,6 @@ static int ftgpio_gpio_set_irq_type(struct irq_data *d, unsigned int type) return 0; } -static struct irq_chip ftgpio_gpio_irqchip = { - .name = "FTGPIO010", - .irq_ack = ftgpio_gpio_ack_irq, - .irq_mask = ftgpio_gpio_mask_irq, - .irq_unmask = ftgpio_gpio_unmask_irq, - .irq_set_type = ftgpio_gpio_set_irq_type, -}; - static void ftgpio_gpio_irq_handler(struct irq_desc *desc) { struct gpio_chip *gc = irq_desc_get_handler_data(desc); @@ -297,14 +291,20 @@ static int ftgpio_gpio_probe(struct platform_device *pdev) /* Clear any use of debounce */ writel(0x0, g->base + GPIO_DEBOUNCE_EN); - ret = gpiochip_irqchip_add(&g->gc, &ftgpio_gpio_irqchip, + g->irq.name = "FTGPIO010"; + g->irq.irq_ack = ftgpio_gpio_ack_irq; + g->irq.irq_mask = ftgpio_gpio_mask_irq; + g->irq.irq_unmask = ftgpio_gpio_unmask_irq; + g->irq.irq_set_type = ftgpio_gpio_set_irq_type; + + ret = gpiochip_irqchip_add(&g->gc, &g->irq, 0, handle_bad_irq, IRQ_TYPE_NONE); if (ret) { dev_info(dev, "could not add irqchip\n"); goto dis_clk; } - gpiochip_set_chained_irqchip(&g->gc, &ftgpio_gpio_irqchip, + gpiochip_set_chained_irqchip(&g->gc, &g->irq, irq, ftgpio_gpio_irq_handler); platform_set_drvdata(pdev, g);