{"id":2230094,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2230094/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-gpio/patch/20260429074356.118420-10-herve.codina@bootlin.com/","project":{"id":42,"url":"http://patchwork.ozlabs.org/api/1.1/projects/42/?format=json","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-10-herve.codina@bootlin.com>","date":"2026-04-29T07:43:45","name":"[v2,09/17] ASoC: simple-amplifier: Introduce support for gpio-audio-amp","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"90e40d1731ee2801442ea0396eb1c9414a4f9521","submitter":{"id":81983,"url":"http://patchwork.ozlabs.org/api/1.1/people/81983/?format=json","name":"Herve Codina","email":"herve.codina@bootlin.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-gpio/patch/20260429074356.118420-10-herve.codina@bootlin.com/mbox/","series":[{"id":502009,"url":"http://patchwork.ozlabs.org/api/1.1/series/502009/?format=json","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/2230094/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2230094/checks/","tags":{},"headers":{"Return-Path":"\n <linux-gpio+bounces-35766-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=XLEEuTe/;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.234.253.10; helo=sea.lore.kernel.org;\n envelope-from=linux-gpio+bounces-35766-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=\"XLEEuTe/\"","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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])\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 4g58cX58c2z1xqf\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 29 Apr 2026 17:50:52 +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 0217D30F1344\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 29 Apr 2026 07:45:21 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id AEF5A3B27F5;\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 760803A784D;\n\tWed, 29 Apr 2026 07:44:35 +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 2D4781A347C;\n\tWed, 29 Apr 2026 07:44:34 +0000 (UTC)","from mail.galae.net (mail.galae.net [212.83.136.155])\n\tby smtpout-01.galae.net (Postfix) with ESMTPS id 023DF601DF;\n\tWed, 29 Apr 2026 07:44:34 +0000 (UTC)","from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon)\n with ESMTPSA id 9BEA7107298A1;\n\tWed, 29 Apr 2026 09:44:30 +0200 (CEST)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777448677; cv=none;\n b=UHYfG6ev/EwexPKmgei4NS6lWzYIPFbRoknCuDT4FJYmJ2RGy+Lc8HIajx7XABjp6O7LaVY32wJkovP1JQivdrsOYwxW1G6bxXnJ4wPOc+rJelcM33m+Af0FmX8pUZbYWPTx56HOpjiy9Ch+T1FffuPp3ejBJBJ+LEF7YriMWsI=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777448677; c=relaxed/simple;\n\tbh=qG4JoL193VppkbzCeHx7J7tia7prNvgEynGydiAdJB8=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=fD0fumzQp0iLYdVzYs8FNtYhePkKl0CZX9TUszfkD9nYr09hzOXgMQWMevhpE5gSbVc0KzKICAV8JAq+FDLamDkjJL5TWMX3k6In3NGxHs7uCwQ7MVnhc8vJpa0qCtrvjSbxijuGfkc0iGXjzaVUuYzKJGLYCHvBRZFxKQkwRnw=","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=XLEEuTe/; 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=1777448672; h=from:subject:date:message-id:to:cc:mime-version:\n\t content-transfer-encoding:in-reply-to:references;\n\tbh=luaVjD7OW5gT2xj48rg1oNvZJhOyOblcokl5JE/AWQY=;\n\tb=XLEEuTe/IjF0b/Y4jPrtn+/VwYvruqQ5l8nZg4Dqe2tQSgkChhlw3CCC+7JWa2yQkiRbiA\n\tFgt8RtLTOpDklcO4DGI4+pm6K8py9EFbjvNIxanizBpSmU28ptVMKx1Ae2fHuBzKqXMFT2\n\tZd0HfrRJRF7eGr0OISC9JwSHFbGV76G5q1gpiRqxtDLZ/GrmQ0Ehc2a5scJ/UygQ7kK/rO\n\tKpgg0vPKZEQ42z4dIt4MSoMeM3B+F7tEkhxO3RbOeCPxzZ1C56Gu46RBgl52WxyzBTvItQ\n\tNKQ67oKSsrToRNhOHBuAjX9GBnM6vVs+TlUikVd1+sXskZf1JMXSP5+8Fn27gA==","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 09/17] ASoC: simple-amplifier: Introduce support for\n gpio-audio-amp","Date":"Wed, 29 Apr 2026 09:43:45 +0200","Message-ID":"<20260429074356.118420-10-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":"Improve the simple-amplifier introducing preliminary support for\ngpio-audio-amp.\n\nThose amplifiers are amplifiers driven by gpios.\n\nThis support introduction doesn't handle any GPIO yet but introduces\nthe compatible strings and the related DAPM table.\n\nTwo gpio-audio-amp are available: A mono and a stereo version.\n\nThe mono version has only one audio channel and gpio settings impact\nfeatures such as the gain or mute of this sole channel.\n\nThe stereo version has two channels (left and right). Gpio settings\nimpact both channels in the same manner and at the same time. For\ninstance, the gain setting set the gain of both channels as well as\nthe mute setting mutes both channels.\n\nSigned-off-by: Herve Codina <herve.codina@bootlin.com>\n---\n sound/soc/codecs/simple-amplifier.c | 54 +++++++++++++++++++++++++++++\n 1 file changed, 54 insertions(+)","diff":"diff --git a/sound/soc/codecs/simple-amplifier.c b/sound/soc/codecs/simple-amplifier.c\nindex a70f70566340..ab4fa074603e 100644\n--- a/sound/soc/codecs/simple-amplifier.c\n+++ b/sound/soc/codecs/simple-amplifier.c\n@@ -4,6 +4,7 @@\n  * Author: Jerome Brunet <jbrunet@baylibre.com>\n  */\n \n+#include <linux/bits.h>\n #include <linux/gpio/consumer.h>\n #include <linux/mod_devicetable.h>\n #include <linux/module.h>\n@@ -12,6 +13,9 @@\n #include <sound/soc.h>\n \n struct simple_amp_data {\n+\tunsigned int supports;\n+#define SIMPLE_AUDIO_SUPPORT_PGA\t\tBIT(0)\n+\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@@ -66,6 +70,38 @@ static const struct snd_soc_dapm_route simple_amp_dapm_routes[] = {\n \t{ \"OUTR\", NULL, \"DRV\" },\n };\n \n+static const struct snd_soc_dapm_widget simple_amp_mono_pga_dapm_widgets[] = {\n+\tSND_SOC_DAPM_INPUT(\"IN\"),\n+\tSND_SOC_DAPM_OUTPUT(\"OUT\"),\n+\tSND_SOC_DAPM_PGA_E(\"PGA\", SND_SOC_NOPM, 0, 0, NULL, 0, simple_amp_power_event,\n+\t\t\t   (SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD)),\n+\tSND_SOC_DAPM_REGULATOR_SUPPLY(\"vdd\", 0, 0),\n+};\n+\n+static const struct snd_soc_dapm_route simple_amp_mono_pga_dapm_routes[] = {\n+\t{ \"PGA\", NULL, \"IN\" },\n+\t{ \"PGA\", NULL, \"vdd\" },\n+\t{ \"OUT\", NULL, \"PGA\" },\n+};\n+\n+static const struct snd_soc_dapm_widget simple_amp_stereo_pga_dapm_widgets[] = {\n+\tSND_SOC_DAPM_INPUT(\"INL\"),\n+\tSND_SOC_DAPM_INPUT(\"INR\"),\n+\tSND_SOC_DAPM_OUTPUT(\"OUTL\"),\n+\tSND_SOC_DAPM_OUTPUT(\"OUTR\"),\n+\tSND_SOC_DAPM_PGA_E(\"PGA\", SND_SOC_NOPM, 0, 0, NULL, 0, simple_amp_power_event,\n+\t\t\t   (SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD)),\n+\tSND_SOC_DAPM_REGULATOR_SUPPLY(\"vdd\", 0, 0),\n+};\n+\n+static const struct snd_soc_dapm_route simple_amp_stereo_pga_dapm_routes[] = {\n+\t{ \"PGA\", NULL, \"INL\" },\n+\t{ \"PGA\", NULL, \"INR\" },\n+\t{ \"PGA\", NULL, \"vdd\" },\n+\t{ \"OUTL\", NULL, \"PGA\" },\n+\t{ \"OUTR\", NULL, \"PGA\" },\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@@ -133,9 +169,27 @@ static const struct simple_amp_data simple_audio_amplifier_data = {\n \t.num_dapm_routes\t= ARRAY_SIZE(simple_amp_dapm_routes),\n };\n \n+static const struct simple_amp_data simple_audio_mono_pga_data = {\n+\t.supports\t\t= SIMPLE_AUDIO_SUPPORT_PGA,\n+\t.dapm_widgets\t\t= simple_amp_mono_pga_dapm_widgets,\n+\t.num_dapm_widgets\t= ARRAY_SIZE(simple_amp_mono_pga_dapm_widgets),\n+\t.dapm_routes\t\t= simple_amp_mono_pga_dapm_routes,\n+\t.num_dapm_routes\t= ARRAY_SIZE(simple_amp_mono_pga_dapm_routes),\n+};\n+\n+static const struct simple_amp_data simple_audio_stereo_pga_data = {\n+\t.supports\t\t= SIMPLE_AUDIO_SUPPORT_PGA,\n+\t.dapm_widgets\t\t= simple_amp_stereo_pga_dapm_widgets,\n+\t.num_dapm_widgets\t= ARRAY_SIZE(simple_amp_stereo_pga_dapm_widgets),\n+\t.dapm_routes\t\t= simple_amp_stereo_pga_dapm_routes,\n+\t.num_dapm_routes\t= ARRAY_SIZE(simple_amp_stereo_pga_dapm_routes),\n+};\n+\n static const struct of_device_id simple_amp_ids[] = {\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{ .compatible = \"gpio-audio-amp-mono\",\t  .data = &simple_audio_mono_pga_data},\n+\t{ .compatible = \"gpio-audio-amp-stereo\",  .data = &simple_audio_stereo_pga_data},\n \t{ }\n };\n MODULE_DEVICE_TABLE(of, simple_amp_ids);\n","prefixes":["v2","09/17"]}