Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2216612/?format=api
{ "id": 2216612, "url": "http://patchwork.ozlabs.org/api/patches/2216612/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/patch/20260327-asoc-wsa881x-v1-1-53dc05867e6b@kernel.org/", "project": { "id": 42, "url": "http://patchwork.ozlabs.org/api/projects/42/?format=api", "name": "Linux GPIO development", "link_name": "linux-gpio", "list_id": "linux-gpio.vger.kernel.org", "list_email": "linux-gpio@vger.kernel.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260327-asoc-wsa881x-v1-1-53dc05867e6b@kernel.org>", "list_archive_url": null, "date": "2026-03-26T23:10:46", "name": "ASoC: wsa881x: Move custom workaround to gpiolib-of", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "d32a7c534779fc293753fcc4c7d89188e08bf011", "submitter": { "id": 92050, "url": "http://patchwork.ozlabs.org/api/people/92050/?format=api", "name": "Linus Walleij", "email": "linusw@kernel.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-gpio/patch/20260327-asoc-wsa881x-v1-1-53dc05867e6b@kernel.org/mbox/", "series": [ { "id": 497666, "url": "http://patchwork.ozlabs.org/api/series/497666/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/list/?series=497666", "date": "2026-03-26T23:10:46", "name": "ASoC: wsa881x: Move custom workaround to gpiolib-of", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/497666/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2216612/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2216612/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linux-gpio+bounces-34227-incoming=patchwork.ozlabs.org@vger.kernel.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "linux-gpio@vger.kernel.org" ], "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=MwcYaqRP;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-gpio+bounces-34227-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=\"MwcYaqRP\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201" ], "Received": [ "from sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fhfmF4m5rz1y1j\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 27 Mar 2026 10:16:29 +1100 (AEDT)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 8A970308FE50\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 26 Mar 2026 23:10:51 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 9EBFB34EF0C;\n\tThu, 26 Mar 2026 23:10:50 +0000 (UTC)", "from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org\n [10.30.226.201])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 4D1AA346A1D;\n\tThu, 26 Mar 2026 23:10:50 +0000 (UTC)", "by smtp.kernel.org (Postfix) with ESMTPSA id 02993C116C6;\n\tThu, 26 Mar 2026 23:10:47 +0000 (UTC)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774566650; cv=none;\n b=Sk2FrY27xCREYq1sI1CuG6iI0WqIXzLxLA28uuvZI4vao30aGpWwKeZIBjvaMLNDwuiAJiUhcYTBczAf3N3/7mcm6t5sS+kmEt3nnO7T3D0sJptfKCRspTcp9sCgbIY1YZHJ+BFQrcLgUNiEhWn6JczYw6tdSNB8Dz7rGo4ynaQ=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774566650; c=relaxed/simple;\n\tbh=LFk1wAs4FKcW9griZHevwjzZHHkLSKzVhryrwFOnxvU=;\n\th=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc;\n b=YgBDAUG6Vx8uX7YslXj/0yfnkCBM7HwYHCIgmCREhWd46f3xYiX6u6F/szuUShOX3qbFbqICREPZN+sGkJN/LKnCuWk7+jfCB70FqYwAz7Tt3HQJIFYNLufpZRHMpuvuH+hWEc7xMztO5sWIsn2lF0p8tfKK/ekmFXGT1NA8SQA=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=MwcYaqRP; arc=none smtp.client-ip=10.30.226.201", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1774566649;\n\tbh=LFk1wAs4FKcW9griZHevwjzZHHkLSKzVhryrwFOnxvU=;\n\th=From:Date:Subject:To:Cc:From;\n\tb=MwcYaqRPw/8nhCry3tpgyZEvpGcZxGi35s+iy53G/8j1K2s9Vygwi7S6YnDtMefAg\n\t AZE//bIixrb/WykCIrXE9K1bknanZmtEIRmo5b3OA48nq9OsjXauHTrtfF/3CFv2Ry\n\t JfTsVhH5aPtIe5job4m3yC/NiiWS9eOQuE5w4zq7r/hJDVqduVbFCvneCBNBpzNSQx\n\t c3PVhFsTO0HntlmqIY1zoC91/MyO/DzFu8M011oGSz4bULM4ITzVsjD0dhAwD3pLNW\n\t Bxip6cpjr2wDc5DgyrByYtbHu9RsN225yIaA1cbPbbAdnrWpCmoKvTLmFyXjXmmlEf\n\t YCKw5AUQXPxSw==", "From": "Linus Walleij <linusw@kernel.org>", "Date": "Fri, 27 Mar 2026 00:10:46 +0100", "Subject": "[PATCH] ASoC: wsa881x: Move custom workaround to gpiolib-of", "Precedence": "bulk", "X-Mailing-List": "linux-gpio@vger.kernel.org", "List-Id": "<linux-gpio.vger.kernel.org>", "List-Subscribe": "<mailto:linux-gpio+subscribe@vger.kernel.org>", "List-Unsubscribe": "<mailto:linux-gpio+unsubscribe@vger.kernel.org>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "7bit", "Message-Id": "<20260327-asoc-wsa881x-v1-1-53dc05867e6b@kernel.org>", "X-B4-Tracking": "v=1; b=H4sIAAAAAAAC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE\n vPSU3UzU4B8JSMDIzMDYyMz3cTi/GTd8uJECwvDCl0zY+PkZPM0cwNDYyMloJaCotS0zAqwcdG\n xtbUAaZevp14AAAA=", "X-Change-ID": "20260326-asoc-wsa881x-633cc7f70132", "To": "Bartosz Golaszewski <brgl@kernel.org>,\n Srinivas Kandagatla <srini@kernel.org>, Liam Girdwood <lgirdwood@gmail.com>,\n Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,\n Takashi Iwai <tiwai@suse.com>", "Cc": "linux-gpio@vger.kernel.org, linux-sound@vger.kernel.org,\n linux-arm-msm@vger.kernel.org, Linus Walleij <linusw@kernel.org>", "X-Mailer": "b4 0.14.3" }, "content": "The WSA881x codec driver has a local workaround for old device\ntrees that have the \"powerdown\" GPIO flagged as active high,\ndespite it is active low.\n\nThis quirk can be replaced by a single quirk entry in\ngpiolib-of.c\n\nDrop all polarity inversion code and drop the surplus\ngpiod_direction_output() call in probe() since we now set up\nthe line correctly when getting the GPIO.\n\nAlso drop the inclusion of the unused <linux/gpio.h>.\n\nSigned-off-by: Linus Walleij <linusw@kernel.org>\n---\nPerhaps this can be applied to ASoC directly we seldom add\nthings to these quirks so I think it'll be fine.\n\nI was thinking of adding Fixes: but the current code is fine,\nwe don't really fix anything we just make it simpler.\n---\n drivers/gpio/gpiolib-of.c | 8 ++++++++\n sound/soc/codecs/wsa881x.c | 35 ++++-------------------------------\n 2 files changed, 12 insertions(+), 31 deletions(-)\n\n\n---\nbase-commit: 6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f\nchange-id: 20260326-asoc-wsa881x-633cc7f70132\n\nBest regards,", "diff": "diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c\nindex ef1ac68b94b7..d498b2918179 100644\n--- a/drivers/gpio/gpiolib-of.c\n+++ b/drivers/gpio/gpiolib-of.c\n@@ -240,6 +240,14 @@ static void of_gpio_try_fixup_polarity(const struct device_node *np,\n \t\t * treats it as \"active low\".\n \t\t */\n \t\t{ \"ti,tsc2005\",\t\t\"reset-gpios\",\tfalse },\n+#endif\n+#if IS_ENABLED(CONFIG_SND_SOC_WSA881X)\n+\t\t/*\n+\t\t * WSA881 powerdown is always active low, but some device trees\n+\t\t * missed this when first contributed. It also has a very strange\n+\t\t * compatible.\n+\t\t */\n+\t\t{ \"sdw10217201000\",\t\"powerdown\",\tfalse },\n #endif\n \t};\n \tunsigned int i;\ndiff --git a/sound/soc/codecs/wsa881x.c b/sound/soc/codecs/wsa881x.c\nindex 2fc234adca5f..d15fda648dad 100644\n--- a/sound/soc/codecs/wsa881x.c\n+++ b/sound/soc/codecs/wsa881x.c\n@@ -3,7 +3,6 @@\n // Copyright (c) 2019, Linaro Limited\n \n #include <linux/bitops.h>\n-#include <linux/gpio.h>\n #include <linux/gpio/consumer.h>\n #include <linux/module.h>\n #include <linux/regmap.h>\n@@ -672,11 +671,6 @@ struct wsa881x_priv {\n \tstruct sdw_stream_runtime *sruntime;\n \tstruct sdw_port_config port_config[WSA881X_MAX_SWR_PORTS];\n \tstruct gpio_desc *sd_n;\n-\t/*\n-\t * Logical state for SD_N GPIO: high for shutdown, low for enable.\n-\t * For backwards compatibility.\n-\t */\n-\tunsigned int sd_n_val;\n \tint active_ports;\n \tbool hw_init;\n \tbool port_prepared[WSA881X_MAX_SWR_PORTS];\n@@ -1121,31 +1115,11 @@ static int wsa881x_probe(struct sdw_slave *pdev,\n \tif (!wsa881x)\n \t\treturn -ENOMEM;\n \n-\twsa881x->sd_n = devm_gpiod_get_optional(dev, \"powerdown\", 0);\n+\twsa881x->sd_n = devm_gpiod_get_optional(dev, \"powerdown\", GPIOD_OUT_LOW);\n \tif (IS_ERR(wsa881x->sd_n))\n \t\treturn dev_err_probe(dev, PTR_ERR(wsa881x->sd_n),\n \t\t\t\t \"Shutdown Control GPIO not found\\n\");\n \n-\t/*\n-\t * Backwards compatibility work-around.\n-\t *\n-\t * The SD_N GPIO is active low, however upstream DTS used always active\n-\t * high. Changing the flag in driver and DTS will break backwards\n-\t * compatibility, so add a simple value inversion to work with both old\n-\t * and new DTS.\n-\t *\n-\t * This won't work properly with DTS using the flags properly in cases:\n-\t * 1. Old DTS with proper ACTIVE_LOW, however such case was broken\n-\t * before as the driver required the active high.\n-\t * 2. New DTS with proper ACTIVE_HIGH (intended), which is rare case\n-\t * (not existing upstream) but possible. This is the price of\n-\t * backwards compatibility, therefore this hack should be removed at\n-\t * some point.\n-\t */\n-\twsa881x->sd_n_val = gpiod_is_active_low(wsa881x->sd_n);\n-\tif (!wsa881x->sd_n_val)\n-\t\tdev_warn(dev, \"Using ACTIVE_HIGH for shutdown GPIO. Your DTB might be outdated or you use unsupported configuration for the GPIO.\");\n-\n \tdev_set_drvdata(dev, wsa881x);\n \twsa881x->slave = pdev;\n \twsa881x->dev = dev;\n@@ -1158,7 +1132,6 @@ static int wsa881x_probe(struct sdw_slave *pdev,\n \tpdev->prop.sink_dpn_prop = wsa_sink_dpn_prop;\n \tpdev->prop.scp_int1_mask = SDW_SCP_INT1_BUS_CLASH | SDW_SCP_INT1_PARITY;\n \tpdev->prop.clk_stop_mode1 = true;\n-\tgpiod_direction_output(wsa881x->sd_n, !wsa881x->sd_n_val);\n \n \twsa881x->regmap = devm_regmap_init_sdw(pdev, &wsa881x_regmap_config);\n \tif (IS_ERR(wsa881x->regmap))\n@@ -1181,7 +1154,7 @@ static int wsa881x_runtime_suspend(struct device *dev)\n \tstruct regmap *regmap = dev_get_regmap(dev, NULL);\n \tstruct wsa881x_priv *wsa881x = dev_get_drvdata(dev);\n \n-\tgpiod_direction_output(wsa881x->sd_n, wsa881x->sd_n_val);\n+\tgpiod_direction_output(wsa881x->sd_n, 1);\n \n \tregcache_cache_only(regmap, true);\n \tregcache_mark_dirty(regmap);\n@@ -1196,13 +1169,13 @@ static int wsa881x_runtime_resume(struct device *dev)\n \tstruct wsa881x_priv *wsa881x = dev_get_drvdata(dev);\n \tunsigned long time;\n \n-\tgpiod_direction_output(wsa881x->sd_n, !wsa881x->sd_n_val);\n+\tgpiod_direction_output(wsa881x->sd_n, 0);\n \n \ttime = wait_for_completion_timeout(&slave->initialization_complete,\n \t\t\t\t\t msecs_to_jiffies(WSA881X_PROBE_TIMEOUT));\n \tif (!time) {\n \t\tdev_err(dev, \"Initialization not complete, timed out\\n\");\n-\t\tgpiod_direction_output(wsa881x->sd_n, wsa881x->sd_n_val);\n+\t\tgpiod_direction_output(wsa881x->sd_n, 1);\n \t\treturn -ETIMEDOUT;\n \t}\n \n", "prefixes": [] }