From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6CEA61E0B92; Tue, 3 Sep 2024 20:44:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725396244; cv=none; b=El/gfVqACK5fgaez51tQLO1ydEFiRMIbYp21qaoVBcRJBhaqoMVFg09ydQXWgC9SvOdMSo2qoTuCb7QUCXxwJEGwYrWzzs3yoJQLlwweCKYSPkYHoexozl3098eWNCRTzLH3B/tCctzD5xkzzbK3N0JHf2cRrY4U8qBU3XNJPro= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725396244; c=relaxed/simple; bh=OjCBct6utP0eiJi0kbYF5FvJLWxEVq+ao5PMjpG0pW0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dTpUutLzFYBBBspG6xeAhN1e4cMeWWDWRMrMdscZITGiQC5uA2cjbcBtt3szbxdyUxWIkLwKovG2KzNtChX65pkg9BaJGq3AuZsk7PZ6zoT4K7QQ70KgWkxKWJv5/+L/+EyxHPWYvDs/Sd9YMvaV9Q2unXRHCqldXvpPSAajEig= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Ws1gx/jr; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Ws1gx/jr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB8DEC4CEC8; Tue, 3 Sep 2024 20:44:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725396244; bh=OjCBct6utP0eiJi0kbYF5FvJLWxEVq+ao5PMjpG0pW0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ws1gx/jrEyIqFxkAJt77I7V/3UZHw8+djXldpHhKzddx9o4QD7dF4ssvVKhlDIztW S9C3x7Y0ueDEzFWxfqUPOwJsTmVOhYw1JyqOU5NNfmrQDtIXUv5EVdjM9pIpM7QkzE e25pn2oJc4uvsvdVR0aJNoSC/yERzZcTB4cP4XkGoj3TPOEox+mdXzJzzymUUnjG2K Rx8B/20k1BmSEwvCxrw7nFTj2ErIFw5iPNocfFZ69Ki1yQAJXj5QzAx1ykrdxkX4SU OqjCyMXxHXrxxCkuLPHIQVPf58lO27uek2Kmzo2bWosVMDwxt8xxAh8zbYRbtlA/ta SAsHw0yYIehIw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Thomas Blocher , Linus Walleij , Sasha Levin , ludovic.desroches@microchip.com, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, claudiu.beznea@tuxon.dev, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org Subject: [PATCH AUTOSEL 6.6 08/20] pinctrl: at91: make it work with current gpiolib Date: Tue, 3 Sep 2024 15:23:40 -0400 Message-ID: <20240903192425.1107562-8-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903192425.1107562-1-sashal@kernel.org> References: <20240903192425.1107562-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.6.48 Content-Transfer-Encoding: 8bit From: Thomas Blocher [ Upstream commit 752f387faaae0ae2e84d3f496922524785e77d60 ] 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 Link: https://lore.kernel.org/5b992862-355d-f0de-cd3d-ff99e67a4ff1@ek-dev.de Signed-off-by: Linus Walleij Signed-off-by: Sasha Levin --- drivers/pinctrl/pinctrl-at91.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c index 608f55c5ba5fe..ad30fd47a4bb0 100644 --- a/drivers/pinctrl/pinctrl-at91.c +++ b/drivers/pinctrl/pinctrl-at91.c @@ -1410,8 +1410,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"); -- 2.43.0 From mboxrd@z Thu Jan 1 00:00:00 1970 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 8A67BCD37AE for ; Tue, 3 Sep 2024 20:48: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:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:To:From:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Vu6Kz1y+8+SOGivDv2GRu4gplscN0SGXgFXqu7tJUdk=; b=VSPO7pq8BHD8Mj vMv7LtVv2QbZAhx9/LKP1P/4u6EyTk7HFIbhc3a+fPJZ4F63G/X8YKoCrWEBm89fHdCRYfsUBnwwa J6QGelUD7sjiaR8Nq1opzzdqMTwKZF7dP3FtVE6ZETbyqJXbMnOndVmgJO54ALNu4F81x0agrgBW9 skFd41JvytAB7uhCDLqEdzCc33PgLHq5KFOa4jjraBTCnVDFgojwxbccy7WP5BSwXYa6Hf6Zl7qfq nSHyQqnBDlz5bmucW6kOYT+rBvAAs5B+KfK02NLFvpzfNkZbW5OilDyc4gwjU5scdfJDfXkvnve6C 8bj8O4hC1eBcO6rwQ3jA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1slaRP-00000001qX0-3tsa; Tue, 03 Sep 2024 20:47:55 +0000 Received: from nyc.source.kernel.org ([147.75.193.91]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1slaNh-00000001pAv-1wSa for linux-arm-kernel@lists.infradead.org; Tue, 03 Sep 2024 20:44:07 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 49437A43E83; Tue, 3 Sep 2024 20:43:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB8DEC4CEC8; Tue, 3 Sep 2024 20:44:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725396244; bh=OjCBct6utP0eiJi0kbYF5FvJLWxEVq+ao5PMjpG0pW0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ws1gx/jrEyIqFxkAJt77I7V/3UZHw8+djXldpHhKzddx9o4QD7dF4ssvVKhlDIztW S9C3x7Y0ueDEzFWxfqUPOwJsTmVOhYw1JyqOU5NNfmrQDtIXUv5EVdjM9pIpM7QkzE e25pn2oJc4uvsvdVR0aJNoSC/yERzZcTB4cP4XkGoj3TPOEox+mdXzJzzymUUnjG2K Rx8B/20k1BmSEwvCxrw7nFTj2ErIFw5iPNocfFZ69Ki1yQAJXj5QzAx1ykrdxkX4SU OqjCyMXxHXrxxCkuLPHIQVPf58lO27uek2Kmzo2bWosVMDwxt8xxAh8zbYRbtlA/ta SAsHw0yYIehIw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 6.6 08/20] pinctrl: at91: make it work with current gpiolib Date: Tue, 3 Sep 2024 15:23:40 -0400 Message-ID: <20240903192425.1107562-8-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903192425.1107562-1-sashal@kernel.org> References: <20240903192425.1107562-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.6.48 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240903_134405_594235_BA847419 X-CRM114-Status: GOOD ( 14.85 ) 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: Sasha Levin , alexandre.belloni@bootlin.com, Linus Walleij , claudiu.beznea@tuxon.dev, linux-gpio@vger.kernel.org, ludovic.desroches@microchip.com, linux-arm-kernel@lists.infradead.org, Thomas Blocher Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Thomas Blocher [ Upstream commit 752f387faaae0ae2e84d3f496922524785e77d60 ] 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 Link: https://lore.kernel.org/5b992862-355d-f0de-cd3d-ff99e67a4ff1@ek-dev.de Signed-off-by: Linus Walleij Signed-off-by: Sasha Levin --- drivers/pinctrl/pinctrl-at91.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c index 608f55c5ba5fe..ad30fd47a4bb0 100644 --- a/drivers/pinctrl/pinctrl-at91.c +++ b/drivers/pinctrl/pinctrl-at91.c @@ -1410,8 +1410,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"); -- 2.43.0