From nobody Mon May 25 06:41:57 2026 Received: from leonov.paulk.fr (leonov.paulk.fr [185.233.101.22]) (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 9BA19327C09; Sun, 17 May 2026 17:14:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.233.101.22 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779038079; cv=none; b=PboJn6B7IxLlqMvQkaOvbH2OTC9JtKD7kY0CHusyKHxMCaUsaPRPJ9SGszV0w/5rL4teFbRS1mF9R09EwsSloXBplKTBl4+9KO9ZfZ2iyJabB+yzmmdTyKhq9gSCyFE/DBqA6qXSuU27XJAXsp7iFjCxbNdm6J4CT8RCydl2txA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779038079; c=relaxed/simple; bh=w5oEMeftLT6dpjH4N6NKR2mi8NlY8HlAmFv9o+3dyb0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=tbydnxgFksOuK8cQtGBtM1WvfgMvAb8lKMxhVkxnC3Rqdo/PoLMr+aWnv6G16x7jrSw4bF7MgUytH6NkMl8QFquHdMXgREjay2vYLms1u9dV2a+GGPM32Ecp+c2eFM24WLoesc2AsaTLEcwSa5AgzQ0pasxSQahLl8jUIL9Tpxc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sys-base.io; spf=pass smtp.mailfrom=sys-base.io; arc=none smtp.client-ip=185.233.101.22 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sys-base.io Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sys-base.io Received: from laika.paulk.fr (12.234.24.109.rev.sfr.net [109.24.234.12]) by leonov.paulk.fr (Postfix) with ESMTPS id 069D61F8004F; Sun, 17 May 2026 17:14:33 +0000 (UTC) Received: by laika.paulk.fr (Postfix, from userid 65534) id 35F9BB4079C; Sun, 17 May 2026 17:14:33 +0000 (UTC) X-Spam-Level: * Received: from collins (unknown [192.168.1.64]) by laika.paulk.fr (Postfix) with ESMTP id CB7A8B4079C; Sun, 17 May 2026 17:14:06 +0000 (UTC) From: Paul Kocialkowski To: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Cc: Andre Przywara , Linus Walleij , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Paul Kocialkowski Subject: [PATCH] pinctrl: sunxi: Implement function_is_gpio Date: Sun, 17 May 2026 19:14:05 +0200 Message-ID: <20260517171405.3697469-1-paulk@sys-base.io> X-Mailer: git-send-email 2.54.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The function_is_gpio pinmux op allows the core to find out whether a GPIO can be safely requested from a pinctrl property and requested as a GPIO at the same time. This is especially useful to request a GPIO with a particular drive strength, which would otherwise not be possible. Signed-off-by: Paul Kocialkowski --- drivers/pinctrl/sunxi/pinctrl-sunxi.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/= pinctrl-sunxi.c index d3042e0c9712..6162f2d86723 100644 --- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c +++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c @@ -821,6 +821,17 @@ static int sunxi_pmx_get_func_groups(struct pinctrl_de= v *pctldev, return 0; } =20 +static bool sunxi_pmx_function_is_gpio(struct pinctrl_dev *pctldev, + unsigned function) +{ + struct sunxi_pinctrl *pctl =3D pinctrl_dev_get_drvdata(pctldev); + + if (!strncmp(pctl->functions[function].name, "gpio", 4)) + return true; + + return false; +} + static void sunxi_pmx_set(struct pinctrl_dev *pctldev, unsigned pin, u8 config) @@ -952,6 +963,7 @@ static const struct pinmux_ops sunxi_pmx_ops =3D { .get_functions_count =3D sunxi_pmx_get_funcs_cnt, .get_function_name =3D sunxi_pmx_get_func_name, .get_function_groups =3D sunxi_pmx_get_func_groups, + .function_is_gpio =3D sunxi_pmx_function_is_gpio, .set_mux =3D sunxi_pmx_set_mux, .gpio_set_direction =3D sunxi_pmx_gpio_set_direction, .request =3D sunxi_pmx_request, --=20 2.54.0