Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2228709/?format=api
{ "id": 2228709, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2228709/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/patch/20260427-asoc-wsa881x-v2-1-9ef965f94624@kernel.org/", "project": { "id": 42, "url": "http://patchwork.ozlabs.org/api/1.1/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": "" }, "msgid": "<20260427-asoc-wsa881x-v2-1-9ef965f94624@kernel.org>", "date": "2026-04-27T08:43:21", "name": "[v2] ASoC: wsa881x: Move custom workaround to gpiolib-of", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "3dbdd2740dc3114c4f342401bf566d882126c8d7", "submitter": { "id": 92050, "url": "http://patchwork.ozlabs.org/api/1.1/people/92050/?format=api", "name": "Linus Walleij", "email": "linusw@kernel.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-gpio/patch/20260427-asoc-wsa881x-v2-1-9ef965f94624@kernel.org/mbox/", "series": [ { "id": 501607, "url": "http://patchwork.ozlabs.org/api/1.1/series/501607/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/list/?series=501607", "date": "2026-04-27T08:43:21", "name": "[v2] ASoC: wsa881x: Move custom workaround to gpiolib-of", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/501607/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2228709/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2228709/checks/", "tags": {}, "headers": { "Return-Path": "\n <linux-gpio+bounces-35539-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=LKv2mHC0;\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-35539-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=\"LKv2mHC0\"", "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)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g3xyk1313z1yJX\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 27 Apr 2026 18:47:26 +1000 (AEST)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id AE82F300CBF5\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 27 Apr 2026 08:43:31 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 5690139D6EA;\n\tMon, 27 Apr 2026 08:43:30 +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 169542C1595;\n\tMon, 27 Apr 2026 08:43:29 +0000 (UTC)", "by smtp.kernel.org (Postfix) with ESMTPSA id 7D3AAC19425;\n\tMon, 27 Apr 2026 08:43:27 +0000 (UTC)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777279410; cv=none;\n b=IhMPGs6utmRHctaKm3AUGUVGz6wkvTuEJ9C9773s6wf5R6U9L7hkCYc0t5sEtabY/I4+DgjXB9qcwe5/NbGOyQ53hW6J8kaeZ9Nl1QfWmgU/COUsw1UxMr5886nxb+X8I74MG8lBYjQDXtff6LzrlTv5/2fcBmK/35BoEfWwGfA=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777279410; c=relaxed/simple;\n\tbh=KCueZmmoHlvP4A3Xk2iIvGya+WKumH5loHUbnb/3clk=;\n\th=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc;\n b=a+NK9thwdS6ljS0l8f/3wmxvwB/u0/LJdMDlgGscRs4nJkhZ2Stf+BrsGsGIiguc5J7qZtwa7h0xCQXV2qj7lJJTQz755X3uKUkbm9cmJq6vKVQhcme5mI7La3AsitehZq+imdMNNSv1vx13HFcSWQD8i3GGZigIwdH/9cC4yNk=", "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=LKv2mHC0; 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=1777279409;\n\tbh=KCueZmmoHlvP4A3Xk2iIvGya+WKumH5loHUbnb/3clk=;\n\th=From:Date:Subject:To:Cc:From;\n\tb=LKv2mHC0JO7umYbDcD8B/P9XEjd3tPBb8ilMV30Zq7u7FdcEyWa3CA4vIBMU6PGge\n\t XpbpxGK+//Ug+K9Bn61GZs0sFA6MYDHhOvPrD859XTPmFHE3oGUqMmnS1A84V+fzaQ\n\t 3gZv6aqL9PoI5V5gLRernrwSqaaVu/1Lf1qZUSvnkf0xfKkYHTc9arkR31Epg9RZav\n\t 37y+COkiWh/W0vuzRRbGRGGTrqpW1oUJisev1GWXWRhlsPbCmwPj7OJfs9JYhhmafs\n\t vIAJHySLW5nnSsJvJK9ZgJTKhkSMfb7sl/V4uovTEsNCZbX/q6dGpW8QKxkQDJkApJ\n\t atgoLT1bS74Zg==", "From": "Linus Walleij <linusw@kernel.org>", "Date": "Mon, 27 Apr 2026 10:43:21 +0200", "Subject": "[PATCH v2] 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": "<20260427-asoc-wsa881x-v2-1-9ef965f94624@kernel.org>", "X-B4-Tracking": "v=1; b=H4sIAAAAAAAC/1XMSwrCMBSF4a2UOzaSB02CI/chHcT0tg1KIjcSK\n yV7NxYcOPwPnG+DjBQww6nbgLCEHFJsIQ8d+MXFGVkYW4PkUnMlNXM5efbKzlqxMq2U92YyXCg\n J7fIgnMK6c5eh9RLyM9F714v4rj/I/ENFMMF6NXreW21QX883pIj3Y6IZhlrrB3TnKsGpAAAA", "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.15.2" }, "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---\nChanges in v2:\n- Property name needs to be \"powerdown-gpios\" not just \"powerdown\".\n- Link to v1: https://lore.kernel.org/r/20260327-asoc-wsa881x-v1-1-53dc05867e6b@kernel.org\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: 254f49634ee16a731174d2ae34bc50bd5f45e731\nchange-id: 20260326-asoc-wsa881x-633cc7f70132\n\nBest regards,\n-- \nLinus Walleij <linusw@kernel.org>", "diff": "diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c\nindex 2c923d17541f..90f6295ab338 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-gpios\", false },\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": [ "v2" ] }