From patchwork Tue Jun 23 19:50:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 223043 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9521C433DF for ; Tue, 23 Jun 2020 21:44:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 814042078A for ; Tue, 23 Jun 2020 21:44:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592948643; bh=vcR6LGpfOhI4Idz/XKhdS9SIlKJ7a5xE9PmNr/VcKAo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=VnEB+q5X4RkqbTqaFpqtqcMmyIC552nhOhy6fEhyUJk8Sx6QSb3qZQWhuGHUhDUNl KAxI5W0m1qR6499zKrKfl4yvvSEUfOzEgax4r5eyPncWpXJQXP+mmW/d4YUmhRAcnp zqZHd0h3mfaHbfODukeNbi23RFR3lD+aS1v1ugcQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387942AbgFWUCz (ORCPT ); Tue, 23 Jun 2020 16:02:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:40344 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387933AbgFWUCz (ORCPT ); Tue, 23 Jun 2020 16:02:55 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4990A2078A; Tue, 23 Jun 2020 20:02:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592942573; bh=vcR6LGpfOhI4Idz/XKhdS9SIlKJ7a5xE9PmNr/VcKAo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NqsDH3qjpJ4gR+usDjc7YQLnS+Pso15JStp0THhhN2rqoQBA1/nFbtP0DI69nvwXd WZ13gER3yy/RyljExGn9hPm9jXgWCpf2HkNwL0uhubt+a34toTtfJgtWRDs4gAXGIq 5PjjgINKwNKhnPSecmLOeS5wO6vn6ycTWbq3lWNo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexandre Belloni , Lars Povlsen , Linus Walleij , Sasha Levin Subject: [PATCH 5.7 052/477] pinctrl: ocelot: Fix GPIO interrupt decoding on Jaguar2 Date: Tue, 23 Jun 2020 21:50:49 +0200 Message-Id: <20200623195410.066417371@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200623195407.572062007@linuxfoundation.org> References: <20200623195407.572062007@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Lars Povlsen [ Upstream commit 0b47afc65453a70bc521e251138418056f65793f ] This fixes a problem with using the GPIO as an interrupt on Jaguar2 (and similar), as the register layout of the platforms with 64 GPIO's are pairwise, such that the original offset must be multiplied with the platform stride. Fixes: da801ab56ad8 pinctrl: ocelot: add MSCC Jaguar2 support. Reviewed-by: Alexandre Belloni Signed-off-by: Lars Povlsen Link: https://lore.kernel.org/r/20200513125532.24585-4-lars.povlsen@microchip.com Signed-off-by: Linus Walleij Signed-off-by: Sasha Levin --- drivers/pinctrl/pinctrl-ocelot.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/pinctrl/pinctrl-ocelot.c b/drivers/pinctrl/pinctrl-ocelot.c index ed8eac6c14944..4b99922d6c7e7 100644 --- a/drivers/pinctrl/pinctrl-ocelot.c +++ b/drivers/pinctrl/pinctrl-ocelot.c @@ -714,11 +714,12 @@ static void ocelot_irq_handler(struct irq_desc *desc) struct irq_chip *parent_chip = irq_desc_get_chip(desc); struct gpio_chip *chip = irq_desc_get_handler_data(desc); struct ocelot_pinctrl *info = gpiochip_get_data(chip); + unsigned int id_reg = OCELOT_GPIO_INTR_IDENT * info->stride; unsigned int reg = 0, irq, i; unsigned long irqs; for (i = 0; i < info->stride; i++) { - regmap_read(info->map, OCELOT_GPIO_INTR_IDENT + 4 * i, ®); + regmap_read(info->map, id_reg + 4 * i, ®); if (!reg) continue;