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 9EC341E410D; Tue, 3 Sep 2024 20:45:35 +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=1725396335; cv=none; b=CppQ9xGKKxXC0CwGRnQPE1KRdZku2aX5yx8neqaBGPfIec/k2aKnXAfevHqTPU0Su/C7ltVuhm3NW/1aOfOpcj23OqWd7TUe2NfOg7/XbwL3HBUMfmHN4ORapMAXkvK2uqBze9wXegF0cSzW98B5ZPZ7Bj1ZcED2I1xpqKq+pLs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725396335; c=relaxed/simple; bh=EXJ5tIqYx2d5HUlqX/rUKbbqFPLaR29YltOoP6OggNY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=T5iMwe2iOC9ebwrlKKirNWKDWhmz2K+ewEo0bMEMXfapij5Q5sJUKx6UVyYxUBhx1zQ9z7dR+GqZwtHYNsa5AYzrmZyPMzjrCnZyMiFdw3aG04oOktXSoiE3F7Niv2FLK0+kLu+eszw4qcQVxXJkBTd3yBz69BPjWO13uNXUZyc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=c0aHLluh; 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="c0aHLluh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC841C4CEC9; Tue, 3 Sep 2024 20:45:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725396335; bh=EXJ5tIqYx2d5HUlqX/rUKbbqFPLaR29YltOoP6OggNY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c0aHLluh7pOwOqc5PKtbpPnG00xeY07Eyuyo1kaX7lNGo/TmA/yym0SFfZQbvpRAQ E/wSqBuN6u13Sdq+E/fzNgfFKVq2XDCQURR2g4xu69gct8ggC+opnB/8fosGfdXpS3 fN49ajpIIPzSNQvnIPXp2dFzHNvCf8KZbdafPXu1gaYQVUs6YMuw281SUVm3OO48Cv krU/5jy5FmPcvTnuMKLSeBAN2qg+q8PHl2/t9rL3eof9TOv0q/W7nBOKdsR5xmERgU gII07LIx657nzf9/xJ2KnEOVKmA6th2Aoy+nTudHHN2YwtKec3mR1gk8hlXr8+exlY LlEt+JSPtRgWA== 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.1 07/17] pinctrl: at91: make it work with current gpiolib Date: Tue, 3 Sep 2024 15:25:21 -0400 Message-ID: <20240903192600.1108046-7-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903192600.1108046-1-sashal@kernel.org> References: <20240903192600.1108046-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@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.1.107 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 ff3b6a8a0b170..333f9d70c7f48 100644 --- a/drivers/pinctrl/pinctrl-at91.c +++ b/drivers/pinctrl/pinctrl-at91.c @@ -1420,8 +1420,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(&pdev->dev, "initialized AT91 pinctrl driver\n"); -- 2.43.0