From patchwork Tue Jul 30 23:16:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Blocher X-Patchwork-Id: 13747970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A9AE9C3DA7F for ; Tue, 30 Jul 2024 23:18:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Date:Message-ID:Subject: From:To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=ub6bitsfL2bAe5/YRicKaZIw/i3hZpWx6GHxBHvGEyA=; b=i/zirm7OA4RQ2Q bj9rExWHKaYCT7q+NFXFKivBbz+jZ0UrVKuYDIsE3zEIaT8qQbe1YsjiJ4XDACrBZ0CNQOzrQvuZB KPKR4l0OHyziQutlbZBLgRO2ImyL51RoSLbzUmTtgxTzss0Y0pszPhxxpXLI9DZiQOHKWCnVnEtut i02uwfzyTxStB7nbWeduu7IWICffZRG1m1u54C6kQcc8QGGuJQMUcH4GRHm+Tfe39GmMh5E7o+5FN 9MgdNE0kDZ8CgX8dkXrktefoNq6Mei8YVXPNliD0NAAN9WxVkjPSio91yAEMrrPeHPFP+g3ujtnqz GLrJThIP6BiJloXul4bw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sYw6J-0000000GjBI-0iKn; Tue, 30 Jul 2024 23:17:51 +0000 Received: from server.cpprotect6.de ([185.225.135.100]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sYw5q-0000000Gj7d-2u5q for linux-arm-kernel@lists.infradead.org; Tue, 30 Jul 2024 23:17:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ek-dev.de; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Date: Message-ID:Subject:From:Cc:To:Sender:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=ub6bitsfL2bAe5/YRicKaZIw/i3hZpWx6GHxBHvGEyA=; b=gsmNAw5yg7n9mouaiGJabU+beo KuVmXd10GVhqGE8H2aww3DrUPCBP4cPEc8EOiIdYzRpXKkl2m4sKHiwyuSZ+Lj+YZlym2wwefsca6 NgN/1nRO4tu4Dx9fHpo/vnyqyGvtcrVpt5f85W5sfMjyoT3zKBZk26RrIU6ZC95e5ADbj95ARxLrq LcuTpGx3ClSiCZcFIly7kX/kMySjXZTZG01U2Hw0BJ3oaodFNcrz7Um2OyGRi4D2RQrv3o+cIFVQE j24o5w1Ii7aVSmnh6Hpbk5R9OKeesUutOrAYrHv3C5AomTk1WzUhkA4XkptFwFO6TTz/Qd+CagPu+ 2TdEqTnA==; Received: from p508fb154.dip0.t-ipconnect.de ([80.143.177.84]:50278 helo=[192.168.178.50]) by server.cpprotect6.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.97.1) (envelope-from ) id 1sYw53-00000002x2n-49ST; Wed, 31 Jul 2024 01:16:36 +0200 To: Linus Walleij From: Thomas Blocher Subject: [PATCH] pinctrl: at91: make it work with current gpiolib Message-ID: <5b992862-355d-f0de-cd3d-ff99e67a4ff1@ek-dev.de> Date: Wed, 31 Jul 2024 01:16:26 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server.cpprotect6.de X-AntiAbuse: Original Domain - lists.infradead.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - ek-dev.de X-Get-Message-Sender-Via: server.cpprotect6.de: authenticated_id: thomas.blocher@ek-dev.de X-Authenticated-Sender: server.cpprotect6.de: thomas.blocher@ek-dev.de X-Source: X-Source-Args: X-Source-Dir: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240730_161723_215375_E61757BB X-CRM114-Status: UNSURE ( 9.75 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Belloni , linux-kernel@vger.kernel.org, Claudiu Beznea , linux-gpio@vger.kernel.org, Ludovic Desroches , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org pinctrl-at91 currently does not support the gpio-groups devicetree property and has no pin-range. Because of this at91 gpios stopped working since patch commit 2ab73c6d8323fa1e ("gpio: Support GPIO controllers without pin-ranges") This was discussed in the patches commit fc328a7d1fcce263 ("gpio: Revert regression in sysfs-gpio (gpiolib.c)") commit 56e337f2cf132632 ("Revert "gpio: Revert regression in sysfs-gpio (gpiolib.c)"") As a workaround manually set pin-range via gpiochip_add_pin_range() until a) pinctrl-at91 is reworked to support devicetree gpio-groups b) another solution as mentioned in commit 56e337f2cf132632 ("Revert "gpio: Revert regression in sysfs-gpio (gpiolib.c)"") is found Signed-off-by: Thomas Blocher --- drivers/pinctrl/pinctrl-at91.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) base-commit: c91a7dee0555f6f9d3702d86312382e4c4729d0a diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c index b3c3f5fb2e2e..93ab277d9943 100644 --- a/drivers/pinctrl/pinctrl-at91.c +++ b/drivers/pinctrl/pinctrl-at91.c @@ -1403,8 +1403,11 @@ static int at91_pinctrl_probe(struct platform_device *pdev) /* We will handle a range of GPIO pins */ for (i = 0; i < gpio_banks; i++) - if (gpio_chips[i]) + if (gpio_chips[i]) { pinctrl_add_gpio_range(info->pctl, &gpio_chips[i]->range); + gpiochip_add_pin_range(&gpio_chips[i]->chip, dev_name(info->pctl->dev), 0, + gpio_chips[i]->range.pin_base, gpio_chips[i]->range.npins); + } dev_info(dev, "initialized AT91 pinctrl driver\n");