Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2230088/?format=api
{ "id": 2230088, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2230088/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/patch/20260429074356.118420-9-herve.codina@bootlin.com/", "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": "<20260429074356.118420-9-herve.codina@bootlin.com>", "date": "2026-04-29T07:43:44", "name": "[v2,08/17] ASoC: simple-amplifier: Remove DAPM widgets and routes from the ASoC component driver", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "e70fe34be8f8a156e740623599d6d1db2e0beaf9", "submitter": { "id": 81983, "url": "http://patchwork.ozlabs.org/api/1.1/people/81983/?format=api", "name": "Herve Codina", "email": "herve.codina@bootlin.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-gpio/patch/20260429074356.118420-9-herve.codina@bootlin.com/mbox/", "series": [ { "id": 502009, "url": "http://patchwork.ozlabs.org/api/1.1/series/502009/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/list/?series=502009", "date": "2026-04-29T07:43:41", "name": "ASoC: Add support for GPIOs driven amplifiers", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/502009/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2230088/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2230088/checks/", "tags": {}, "headers": { "Return-Path": "\n <linux-gpio+bounces-35765-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=bootlin.com header.i=@bootlin.com header.a=rsa-sha256\n header.s=dkim header.b=AT29UGus;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=linux-gpio+bounces-35765-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com\n header.b=\"AT29UGus\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=185.246.84.56", "smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=bootlin.com", "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=bootlin.com" ], "Received": [ "from tor.lore.kernel.org (tor.lore.kernel.org\n [IPv6:2600:3c04:e001:36c::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 4g58YD5lmzz1yHv\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 29 Apr 2026 17:48:00 +1000 (AEST)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id 822493079713\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 29 Apr 2026 07:45:20 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 9AA3E3A783B;\n\tWed, 29 Apr 2026 07:44:37 +0000 (UTC)", "from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56])\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 B3C763AEF5A;\n\tWed, 29 Apr 2026 07:44:32 +0000 (UTC)", "from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233])\n\tby smtpout-02.galae.net (Postfix) with ESMTPS id 40AA31A347B;\n\tWed, 29 Apr 2026 07:44:31 +0000 (UTC)", "from mail.galae.net (mail.galae.net [212.83.136.155])\n\tby smtpout-01.galae.net (Postfix) with ESMTPS id 15C14601DF;\n\tWed, 29 Apr 2026 07:44:31 +0000 (UTC)", "from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon)\n with ESMTPSA id 22AB51072989D;\n\tWed, 29 Apr 2026 09:44:28 +0200 (CEST)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777448677; cv=none;\n b=aCRWItzxjXvA5Uiucr/2963iGfjewIfXz3lX4FG6s6uKmBrLSE6M5TtsSLVoSCqE4r2z9V8p4Qa7t2YiCa8xil8uMB+vsj/WRMBEwF8Xar2iBSzGBXNmk/LeDFO/Eqh5AYHFTXfTxxmk/B8gVETAzT5vs78krvsfF2pC9RDqcp4=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777448677; c=relaxed/simple;\n\tbh=vVKKVyKp/qwA8AdVso5ibgvuvR7GBzwqC4CkNXDx9wg=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=FSh1La/ZGeB2IVWavECg5BXKoZ349ON6dZ0X2iORrJ+WUkvnvUHwrptMH+Gnvg48i6BJRl4IkEkgax6PFf9rAFSiZ5N7y69Y127CfdVLfdgpxTz8P6DK1lw+FNZY7rPIQg2OxXYjpyhC9m3I+PksJZZHaXB3BLFaJUdgyVXedHM=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=bootlin.com;\n spf=pass smtp.mailfrom=bootlin.com;\n dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com\n header.b=AT29UGus; arc=none smtp.client-ip=185.246.84.56", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim;\n\tt=1777448670; h=from:subject:date:message-id:to:cc:mime-version:\n\t content-transfer-encoding:in-reply-to:references;\n\tbh=IImuxyRt4AUe1c5zMGGQ7zAe+xjD+QDQeQvNd5COxME=;\n\tb=AT29UGusHqPwkfJDaIZCZYwes3PUpu85Q+HtryPhqc4Gl4PSZR7+J9xvkUG18/JbzKPXp+\n\tvKioYCc0VghPxQd9SGYXucl7ULQusW0q49O9BUmRiqq36sJS7wPvs48fgZws+A8RZiEyr+\n\tUgevavtRFab0NWneW2W6jxkBs8mcPKyizBvrmGU7EUpKZyUvRp4NZ2Qo9PQuyubIhp8I/a\n\tkrSCDxNXSn8wJm6j+t4xfrNknz68ESSg55WAC+mtljrreuDmdyZrMiFmexl36hpPJveguq\n\tu1aW7vs2GFxPcJfsjaLGbea7kpbzEfMd9hIlnJcIsSc9JIBqcjHf6SFNd4SgDA==", "From": "Herve Codina <herve.codina@bootlin.com>", "To": "Herve Codina <herve.codina@bootlin.com>,\n\tBartosz Golaszewski <brgl@kernel.org>,\n\tLinus Walleij <linusw@kernel.org>,\n\tLiam Girdwood <lgirdwood@gmail.com>,\n\tMark Brown <broonie@kernel.org>,\n\tRob Herring <robh@kernel.org>,\n\tKrzysztof Kozlowski <krzk+dt@kernel.org>,\n\tConor Dooley <conor+dt@kernel.org>,\n\tSaravana Kannan <saravanak@kernel.org>,\n\tJaroslav Kysela <perex@perex.cz>,\n\tTakashi Iwai <tiwai@suse.com>", "Cc": "linux-sound@vger.kernel.org,\n\tlinux-gpio@vger.kernel.org,\n\tdevicetree@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org,\n\tChristophe Leroy <christophe.leroy@csgroup.eu>,\n\tThomas Petazzoni <thomas.petazzoni@bootlin.com>", "Subject": "[PATCH v2 08/17] ASoC: simple-amplifier: Remove DAPM widgets and\n routes from the ASoC component driver", "Date": "Wed, 29 Apr 2026 09:43:44 +0200", "Message-ID": "<20260429074356.118420-9-herve.codina@bootlin.com>", "X-Mailer": "git-send-email 2.53.0", "In-Reply-To": "<20260429074356.118420-1-herve.codina@bootlin.com>", "References": "<20260429074356.118420-1-herve.codina@bootlin.com>", "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-Transfer-Encoding": "8bit", "X-Last-TLS-Session-Version": "TLSv1.3" }, "content": "The simple-amplifier set the DAPM wigets and routes table in the ASoC\ncomponent driver. This is perfectly fine when the component has well\nknown DAPM tables.\n\nThe simple-amplifier is going to handle several kind of components based\non the driver compatible string. The DAPM table will not be the same for\nall components supported by the driver.\n\nIn order to have different DAPM table based on matching compatible\nstrings, move those tables from the ASoC component driver to the device\ncompatible string matching data.\n\nAdd those DAPM widgets and routes dynamically during the ASoC component\nprobe operation.\n\nSigned-off-by: Herve Codina <herve.codina@bootlin.com>\n---\n sound/soc/codecs/simple-amplifier.c | 59 ++++++++++++++++++++++++++---\n 1 file changed, 53 insertions(+), 6 deletions(-)", "diff": "diff --git a/sound/soc/codecs/simple-amplifier.c b/sound/soc/codecs/simple-amplifier.c\nindex 231e84ab4c0e..a70f70566340 100644\n--- a/sound/soc/codecs/simple-amplifier.c\n+++ b/sound/soc/codecs/simple-amplifier.c\n@@ -11,7 +11,15 @@\n #include <linux/regulator/consumer.h>\n #include <sound/soc.h>\n \n+struct simple_amp_data {\n+\tconst struct snd_soc_dapm_widget *dapm_widgets;\n+\tunsigned int num_dapm_widgets;\n+\tconst struct snd_soc_dapm_route *dapm_routes;\n+\tunsigned int num_dapm_routes;\n+};\n+\n struct simple_amp {\n+\tconst struct simple_amp_data *data;\n \tstruct gpio_desc *gpiod_enable;\n };\n \n@@ -58,11 +66,39 @@ static const struct snd_soc_dapm_route simple_amp_dapm_routes[] = {\n \t{ \"OUTR\", NULL, \"DRV\" },\n };\n \n+static int simple_amp_add_basic_dapm(struct snd_soc_component *component)\n+{\n+\tstruct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component);\n+\tstruct simple_amp *simple_amp = snd_soc_component_get_drvdata(component);\n+\tstruct device *dev = component->dev;\n+\tint ret;\n+\n+\t/* Add basic dapm widgets and routes */\n+\tret = snd_soc_dapm_new_controls(dapm, simple_amp->data->dapm_widgets,\n+\t\t\t\t\tsimple_amp->data->num_dapm_widgets);\n+\tif (ret) {\n+\t\tdev_err(dev, \"Failed to add basic dapm widgets (%d)\\n\", ret);\n+\t\treturn ret;\n+\t}\n+\n+\tret = snd_soc_dapm_add_routes(dapm, simple_amp->data->dapm_routes,\n+\t\t\t\t simple_amp->data->num_dapm_routes);\n+\tif (ret) {\n+\t\tdev_err(dev, \"Failed to basic dapm routes (%d)\\n\", ret);\n+\t\treturn ret;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static int simple_amp_component_probe(struct snd_soc_component *component)\n+{\n+\t/* Add basic dapm widgets and routes */\n+\treturn simple_amp_add_basic_dapm(component);\n+}\n+\n static const struct snd_soc_component_driver simple_amp_component_driver = {\n-\t.dapm_widgets\t\t= simple_amp_dapm_widgets,\n-\t.num_dapm_widgets\t= ARRAY_SIZE(simple_amp_dapm_widgets),\n-\t.dapm_routes\t\t= simple_amp_dapm_routes,\n-\t.num_dapm_routes\t= ARRAY_SIZE(simple_amp_dapm_routes),\n+\t.probe = simple_amp_component_probe,\n };\n \n static int simple_amp_probe(struct platform_device *pdev)\n@@ -75,6 +111,10 @@ static int simple_amp_probe(struct platform_device *pdev)\n \t\treturn -ENOMEM;\n \tplatform_set_drvdata(pdev, simple_amp);\n \n+\tsimple_amp->data = of_device_get_match_data(dev);\n+\tif (!simple_amp->data)\n+\t\treturn -EINVAL;\n+\n \tsimple_amp->gpiod_enable = devm_gpiod_get_optional(dev, \"enable\",\n \t\t\t\t\t\t\t GPIOD_OUT_LOW);\n \tif (IS_ERR(simple_amp->gpiod_enable))\n@@ -86,9 +126,16 @@ static int simple_amp_probe(struct platform_device *pdev)\n \t\t\t\t\t NULL, 0);\n }\n \n+static const struct simple_amp_data simple_audio_amplifier_data = {\n+\t.dapm_widgets\t\t= simple_amp_dapm_widgets,\n+\t.num_dapm_widgets\t= ARRAY_SIZE(simple_amp_dapm_widgets),\n+\t.dapm_routes\t\t= simple_amp_dapm_routes,\n+\t.num_dapm_routes\t= ARRAY_SIZE(simple_amp_dapm_routes),\n+};\n+\n static const struct of_device_id simple_amp_ids[] = {\n-\t{ .compatible = \"dioo,dio2125\", },\n-\t{ .compatible = \"simple-audio-amplifier\", },\n+\t{ .compatible = \"dioo,dio2125\",\t\t .data = &simple_audio_amplifier_data},\n+\t{ .compatible = \"simple-audio-amplifier\", .data = &simple_audio_amplifier_data},\n \t{ }\n };\n MODULE_DEVICE_TABLE(of, simple_amp_ids);\n", "prefixes": [ "v2", "08/17" ] }