From patchwork Fri Apr 26 16:56:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 13645101 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (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 BCD71158D97; Fri, 26 Apr 2024 16:56:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.199 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714150610; cv=none; b=d/5UoUsg4JyEtHLqT1z4yP3TU7oTPBqWq9okHfaUF3zzBGwtDjxOhmDoHsOh6xlbwILfj++MEhxEhBp9lt6ki4tJ5PyKXNj7NPCw8WGiEqwTaS9FGRrWsxEEhDsx2Z7jOSLucKS2AjovHfSfq+/A3Fq28i5Hx1sYm45A3pJTTT4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714150610; c=relaxed/simple; bh=P+1rMsmlu3vZ5B86+d/1krofnxEMi9vT6St9leoKSwE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UW/46w4IUL4XrvwQbAaD5+jAoqWF6eLTZdWN+gBe88dxcGk1/2JYjG+92omx9o2gdobj8h7tYAxTtmF75WTSt9SbzJY+mlFODVeYw0MXKDydxwfF/QcrU1YKd1DtfADwPP5B+DRgpOSByCaFCrQCPbSazmoJGsYUlhHBPAz0qxo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=k8pqd5J0; arc=none smtp.client-ip=217.70.183.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="k8pqd5J0" Received: by mail.gandi.net (Postfix) with ESMTPSA id 39C4AFF808; Fri, 26 Apr 2024 16:56:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1714150606; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0c2iYCYeMf93nelrLleWfSo4CLIYmfO/ZMUay8A7fbg=; b=k8pqd5J0SEnI/Q3NCYNucRHZGWch2GW/mNj40FYSbmu+rvS8sB6mf9AHu2omVxd+oo5mLa T7U2Nue9z6jsqsvt3fXmHXoIGkVTUBQy0yITLp8A18K+cD0j53jwrTclLTd7HuwTAehGkQ bzOZvMmzkZgidTabc6yCsscFkrZiRW9lGcVl2btgdIt6ISod0rYtl3UwUpfLUG6zPtgtzF yYXsrb7NlrHXO1reuPJzgpBxYpLlWaZO3MIswcv/U4AOseebrW0FCODi1FeFWSYs30Gs6/ Ngrrk6SCBbZNSA+GZeOo4T5JbYouq834ob6MztasZobKG/36Vs21QKwJNRKtZw== From: Luca Ceresoli Date: Fri, 26 Apr 2024 18:56:34 +0200 Subject: [PATCH v2 01/12] ASoC: doc: dapm: fix typos Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240426-dapm-docs-v2-1-87b07547eb5b@bootlin.com> References: <20240426-dapm-docs-v2-0-87b07547eb5b@bootlin.com> In-Reply-To: <20240426-dapm-docs-v2-0-87b07547eb5b@bootlin.com> To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Jonathan Corbet Cc: Alexandre Belloni , Bagas Sanjaya , Thomas Petazzoni , linux-sound@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Luca Ceresoli X-Mailer: b4 0.13.0 X-GND-Sasl: luca.ceresoli@bootlin.com Fix various typos. Reviewed-by: Alexandre Belloni Reviewed-by: Bagas Sanjaya Signed-off-by: Luca Ceresoli --- Documentation/sound/soc/dapm.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/sound/soc/dapm.rst b/Documentation/sound/soc/dapm.rst index c3154ce6e1b2..59f65b181828 100644 --- a/Documentation/sound/soc/dapm.rst +++ b/Documentation/sound/soc/dapm.rst @@ -50,7 +50,7 @@ Stream domain All DAPM power switching decisions are made automatically by consulting an audio routing map of the whole machine. This map is specific to each machine and consists of the interconnections between every audio component (including -internal codec components). All audio components that effect power are called +internal codec components). All audio components that affect power are called widgets hereafter. @@ -221,7 +221,7 @@ when the Mic is inserted:-:: Codec (BIAS) Domain ------------------- -The codec bias power domain has no widgets and is handled by the codecs DAPM +The codec bias power domain has no widgets and is handled by the codec DAPM event handler. This handler is called when the codec powerstate is changed wrt to any stream event or by kernel PM events. @@ -236,7 +236,7 @@ a virtual widget - a widget with no control bits e.g. SND_SOC_DAPM_MIXER("AC97 Mixer", SND_SOC_NOPM, 0, 0, NULL, 0), -This can be used to merge to signal paths together in software. +This can be used to merge two signal paths together in software. After all the widgets have been defined, they can then be added to the DAPM subsystem individually with a call to snd_soc_dapm_new_control(). From patchwork Fri Apr 26 16:56:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 13645103 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (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 B8BF4153BD0; Fri, 26 Apr 2024 16:56:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.199 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714150610; cv=none; b=DNC1Q7c0RDueYX15Xpcp83+O0wmbKoV6IzdVthrlM1sN9TmQezQ7OL2ZmcTUcKDQABJA4WcCCc8OyLYifosiN4Yt+cuxGBTU3F07+1pnvJ6T5mTs0Wgecrz1gLvgf+u1IfKSAnBdJutZ0g88HQMmhrkTnertjB9AWbEyKbz26rQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714150610; c=relaxed/simple; bh=62bKvUYE91S2dby28hoHAUGeKknkiUpxhGJ4QHGMds8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PAiHLynT/RwFLrQJ5Y8HcQcqtzjMKztfw28tp3aUb0W9bpUJOE8hxcFpzzGY5elbeH8N9fVrXpH92z9BT5Kqn1E1eNced+MhvmmSQAm21HISyuHHElZzpCALZy8FM87OzbR08OMm6IKvJ23CATra9zjsK+G6V98nFT0fNvGrBig= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=JAaM0W+M; arc=none smtp.client-ip=217.70.183.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="JAaM0W+M" Received: by mail.gandi.net (Postfix) with ESMTPSA id 4AAF4FF809; Fri, 26 Apr 2024 16:56:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1714150607; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wA7CY7GZxU0LmJK2k6Cb1a5Gi/2q8P8/f6Nq8+Ks5JI=; b=JAaM0W+MQEVTc3KdihKxI1ZNHVRMsCDcTQ+5tGA30IdkelmIN+NSiriR0JyVyNg8Dn6GXy 2fhzfOZ+DNhINxiPpSdkSdC73e+XmwDOkzuEQKok+rTPvnHhTyFTVM+gneZRpZ1xJS+z+D ZT9oRyne6mnZslix2v6HvOkqOq00b4ArvqHsqrVdQ2Re+DONWR3FpsbjBp5S9dzOqDZ3tK uEkyEtkbcVz1SfJ8w42sPn+U84CUMc1E+mKmbo9S0CaZj696OzuUhKnsl/yR7bevLBCzsO KdgtqUXce735rXUgTkPKcnOWeSejR23SOKzk3szGznQwQJQwoamXynNPHC75Og== From: Luca Ceresoli Date: Fri, 26 Apr 2024 18:56:35 +0200 Subject: [PATCH v2 02/12] ASoC: doc: dapm: fix struct name Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240426-dapm-docs-v2-2-87b07547eb5b@bootlin.com> References: <20240426-dapm-docs-v2-0-87b07547eb5b@bootlin.com> In-Reply-To: <20240426-dapm-docs-v2-0-87b07547eb5b@bootlin.com> To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Jonathan Corbet Cc: Alexandre Belloni , Bagas Sanjaya , Thomas Petazzoni , linux-sound@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Luca Ceresoli X-Mailer: b4 0.13.0 X-GND-Sasl: luca.ceresoli@bootlin.com struct snd_soc_codec_dai does not exist. Reviewed-by: Alexandre Belloni Signed-off-by: Luca Ceresoli --- Documentation/sound/soc/dapm.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/sound/soc/dapm.rst b/Documentation/sound/soc/dapm.rst index 59f65b181828..68ef79f539f2 100644 --- a/Documentation/sound/soc/dapm.rst +++ b/Documentation/sound/soc/dapm.rst @@ -148,7 +148,7 @@ Stream widgets have the following format:- SND_SOC_DAPM_AIF_IN(name, stream, slot, reg, shift, invert) NOTE: the stream name must match the corresponding stream name in your codec -snd_soc_codec_dai. +snd_soc_dai_driver. e.g. stream widgets for HiFi playback and capture :: From patchwork Fri Apr 26 16:56:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 13645104 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (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 28513159585; Fri, 26 Apr 2024 16:56:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.199 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714150612; cv=none; b=a7l7S1Bhx91EhQd3yXcW11naiE1J+SKYAbAx1cbKgixiDI2RkpnxeAijzONSI4oZ7FgAVNqqvQU3xQxdMB0y582Z5lyPv37Uv0+YCvrCXpcg4oF4f/dDVPln6iLkegfmq5FaBKXGTFt21FH4rc+NSJiTN0Vx3LPP+Eb8KnygQmg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714150612; c=relaxed/simple; bh=YsqwMeqwdDsJ998lyOSvKG5ryC2QIwVYJgZEoDxKO9I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZEyooE3xxsu0tPBvpug71L71eSG6szO2IjHkXzNNmYn32lRfsUYCYhPRnTPXGT6xpzfVH34pzcX9uMCQ4zF/0XF3UJPiNCyjPaSHCz6giBLAoEKjOWV0k9v+fu7gaEQ3AsASYfqP6Vcoz7QLKVGKGlcxrgSFFlwjuho5LfUyP8o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=VwDPhQAJ; arc=none smtp.client-ip=217.70.183.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="VwDPhQAJ" Received: by mail.gandi.net (Postfix) with ESMTPSA id 66482FF80A; Fri, 26 Apr 2024 16:56:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1714150608; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zaY0JG+JOkRcg/2G1AMAYAPG5tJyZY3wQkGIRlf2fd8=; b=VwDPhQAJhNUZ3L//VkgfksMsoW3ToDWgZzlmIe31k/m58a6xlCW6GDPAcGlG0B1zV7iUVP uyHBSBVxfO6zBQk/J0CsJg2C1RXqV7Te1bpF1k3W4Ak8WuYIAWSS1ONXo+ujfmQzJ9kOYk VJ0GWx/qPQSAzifTeMq6iSVfsQVoHGNkscUn2kdRkpihmOIyDdqHErcLrFq9pnEfQvFDmG PA8MKjPp8vsSQOwFkziNv72IC5u6gV7qrB9GpZaNk+Rwqw6J1yRlo3SaB4JSG9qdU8/BEU 9hSXrn4gZOYkJACVB3nIhjanR+eBavaavdGliws8PWofY6oeMvmQCBITFci1Gg== From: Luca Ceresoli Date: Fri, 26 Apr 2024 18:56:36 +0200 Subject: [PATCH v2 03/12] ASoC: doc: dapm: minor rewording Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240426-dapm-docs-v2-3-87b07547eb5b@bootlin.com> References: <20240426-dapm-docs-v2-0-87b07547eb5b@bootlin.com> In-Reply-To: <20240426-dapm-docs-v2-0-87b07547eb5b@bootlin.com> To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Jonathan Corbet Cc: Alexandre Belloni , Bagas Sanjaya , Thomas Petazzoni , linux-sound@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Luca Ceresoli X-Mailer: b4 0.13.0 X-GND-Sasl: luca.ceresoli@bootlin.com Slightly reword for better readability: replace "PM" -> "power management frameworks", add missing comma. Reviewed-by: Alexandre Belloni Reviewed-by: Bagas Sanjaya Signed-off-by: Luca Ceresoli --- Changed in v2: - don't rewrap the whole paragraph (no change to the actual patch content) --- Documentation/sound/soc/dapm.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/sound/soc/dapm.rst b/Documentation/sound/soc/dapm.rst index 68ef79f539f2..479c010d2dac 100644 --- a/Documentation/sound/soc/dapm.rst +++ b/Documentation/sound/soc/dapm.rst @@ -7,8 +7,8 @@ Description Dynamic Audio Power Management (DAPM) is designed to allow portable Linux devices to use the minimum amount of power within the audio -subsystem at all times. It is independent of other kernel PM and as -such, can easily co-exist with the other PM systems. +subsystem at all times. It is independent of other kernel power +management frameworks and, as such, can easily co-exist with them. DAPM is also completely transparent to all user space applications as all power switching is done within the ASoC core. No code changes or From patchwork Fri Apr 26 16:56:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 13645105 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (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 F15E515B55F; Fri, 26 Apr 2024 16:56:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.199 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714150613; cv=none; b=e3uVtxW398I80MRypHvltJWe7ZijFP4DZeps225DwYq/eY8cjgTUGcy4icTh705emoWHhtgEpEBRddTZLeaIVEvTre7XfTGGXv6V7uP12HDskr2K44Ahn/wHN6+NF719YEKQd2HT5Z0O7CCO2rEOS38BbRWgJH5KkInpxlsDxOo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714150613; c=relaxed/simple; bh=iAvdCPOrzIXYffqO3FbcSrYObGd1PeIB+S0uhVk1E6s=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FyTl//b5knA5AII83NwdoSuYds0NasnDjzRVOukYvAvJPMYTX/S9IWabe2CCtl/OrTE265txrd7JeJ5TKlOsgUoiLTJ1KQHKNFyf6/Dsasw8ZXWJg7MPjbwBdJevaejgZNOSBzduA8HLHgQnSOdkkaOp/Mq/GR+2lt/7hDlbCpI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=MrysdL9W; arc=none smtp.client-ip=217.70.183.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="MrysdL9W" Received: by mail.gandi.net (Postfix) with ESMTPSA id 784D7FF80B; Fri, 26 Apr 2024 16:56:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1714150609; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nuJ5K/2010lvsI68FrIzNz+OnkbnxjU46I0ZJTtVqOI=; b=MrysdL9WDgD3EUp66JQXXj4BxGmUw85HntBsatMQPkIEk11fepJsHqXPgD/omPe0UtYvSF uqI4CBc4+3SzYpydB8BLMSm8Zg3TxWkaOk1iHcNNHtW7LUD2FNpkmTj7E59Rldr63Vp8Mg pdIt8sPjb/hHfazpMkIyy+dgHNXC1Xjr2zO/51dLw0NyYFaKyiSy5HStYR/7pycOW6kab8 2ZprB0J1redKN6kiXNi8gqGsy0eSvso6+er+21oyXhDfxZbXdGKXtmg9QksPw62gk5dNtr CNMbtVxnfcxJNFLdxK78U2USz5nhhKFsIHq0aAgduu6k12WNOQH4uzBk5LdwIA== From: Luca Ceresoli Date: Fri, 26 Apr 2024 18:56:37 +0200 Subject: [PATCH v2 04/12] ASoC: doc: dapm: remove dash after colon Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240426-dapm-docs-v2-4-87b07547eb5b@bootlin.com> References: <20240426-dapm-docs-v2-0-87b07547eb5b@bootlin.com> In-Reply-To: <20240426-dapm-docs-v2-0-87b07547eb5b@bootlin.com> To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Jonathan Corbet Cc: Alexandre Belloni , Bagas Sanjaya , Thomas Petazzoni , linux-sound@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Luca Ceresoli X-Mailer: b4 0.13.0 X-GND-Sasl: luca.ceresoli@bootlin.com There is no need for a dash after colons. Also fix an incorrect ":-::" sequence. Reviewed-by: Alexandre Belloni Signed-off-by: Luca Ceresoli --- Documentation/sound/soc/dapm.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Documentation/sound/soc/dapm.rst b/Documentation/sound/soc/dapm.rst index 479c010d2dac..be849879274d 100644 --- a/Documentation/sound/soc/dapm.rst +++ b/Documentation/sound/soc/dapm.rst @@ -20,7 +20,7 @@ DAPM spans the whole machine. It covers power control within the entire audio subsystem, this includes internal codec power blocks and machine level power systems. -There are 4 power domains within DAPM +There are 4 power domains within DAPM: Codec bias domain VREF, VMID (core codec and audio power) @@ -57,7 +57,7 @@ widgets hereafter. DAPM Widgets ============ -Audio DAPM widgets fall into a number of types:- +Audio DAPM widgets fall into a number of types: Mixer Mixes several analog signals into a single analog signal. @@ -141,7 +141,7 @@ Stream Widgets relate to the stream power domain and only consist of ADCs (analog to digital converters), DACs (digital to analog converters), AIF IN and AIF OUT. -Stream widgets have the following format:- +Stream widgets have the following format: :: SND_SOC_DAPM_DAC(name, stream name, reg, shift, invert), @@ -167,7 +167,7 @@ Path Domain Widgets ------------------- Path domain widgets have a ability to control or affect the audio signal or -audio paths within the audio subsystem. They have the following form:- +audio paths within the audio subsystem. They have the following form: :: SND_SOC_DAPM_PGA(name, reg, shift, invert, controls, num_controls) @@ -207,7 +207,7 @@ powered. e.g. A machine widget can have an optional call back. e.g. Jack connector widget for an external Mic that enables Mic Bias -when the Mic is inserted:-:: +when the Mic is inserted:: static int spitz_mic_bias(struct snd_soc_dapm_widget* w, int event) { @@ -271,7 +271,7 @@ connect the destination widget (wrt audio signal) with its source widgets. {"Output Mixer", "HiFi Playback Switch", "DAC"}, {"Output Mixer", "Mic Sidetone Switch", "Mic Bias"}, -So we have :- +So we have : * Destination Widget <=== Path Name <=== Source Widget, or * Sink, Path, Source, or @@ -280,7 +280,7 @@ So we have :- When there is no path name connecting widgets (e.g. a direct connection) we pass NULL for the path name. -Interconnections are created with a call to:- +Interconnections are created with a call to: :: snd_soc_dapm_connect_input(codec, sink, path, source); From patchwork Fri Apr 26 16:56:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 13645106 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (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 E4D1A15E80A; Fri, 26 Apr 2024 16:56:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.199 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714150613; cv=none; b=biHblDqCgnx1VV0XiLaCyWfRRyMSFTCUcwnBM9HHDaOR2vEWme4Ukt9EQ41DCMB5DxRC8N3yhzJdxRxLRbOaVS7/aMuR8DmLY/nJ5NfvrEEYRXSVoU1v11ka/70CZHhrrfKHvFdBocRfamHTqM0IjI5NpuvNiGIOy/XyP/iT/Ck= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714150613; c=relaxed/simple; bh=izH8aN9JbxlJCgVXuJj/T6p5ltAsS+zG4LVColcQa3k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FITZy66yPK9vId1gwtywtA7Y3rcjQ3Ow14+kzzEZPn1gMXQ2U6VhS2BN02xdjgMwgHIo1U0Znswd8beW9VMoIc4MSUGOb5vHHdM1rwFWye27wCmRfrZCnEqKeAxtEEb2izUSCg0PpB4A5UgFaJOt1cXiu8uoWKnNSu8fuyHCcMY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=Nlgah74g; arc=none smtp.client-ip=217.70.183.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="Nlgah74g" Received: by mail.gandi.net (Postfix) with ESMTPSA id 858C6FF804; Fri, 26 Apr 2024 16:56:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1714150610; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xUcsggNakbTjb/NCiIo3V9WybOVWhSaKxz4EMUq9xB8=; b=Nlgah74gBN6VHionFpPM2GzQoDnt2RjjVVCHXoqjF7jSKqOJYdzbsvF4vWSXGaltHDCpXz 9t+Crnsh3EZ0lIeaqTD1nnf0fUQ+k9rtFB/Wav1fgsnT/hRppaYJsEVQRaK0v8oGcgdigD VCA/EPT/78WWNVGg6sPefjZwPHdDPRPplTwG9jc0khLRHZC84heuqlleDp+7zKIgxbyMTN ubniy+fQMol+XvgoYJRhJOCMxMoWovR4LGi5nNMP5+tZ64O2DpKkwAGEQtV2ClhYouZjP1 usu3Wr9pQ4mBiNiAjSP636rpOUyYUBD9SXY1mplO9X/H6vB5aYm11rmu82fG6Q== From: Luca Ceresoli Date: Fri, 26 Apr 2024 18:56:38 +0200 Subject: [PATCH v2 05/12] ASoC: doc: dapm: clarify it's an internal API Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240426-dapm-docs-v2-5-87b07547eb5b@bootlin.com> References: <20240426-dapm-docs-v2-0-87b07547eb5b@bootlin.com> In-Reply-To: <20240426-dapm-docs-v2-0-87b07547eb5b@bootlin.com> To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Jonathan Corbet Cc: Alexandre Belloni , Bagas Sanjaya , Thomas Petazzoni , linux-sound@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Luca Ceresoli X-Mailer: b4 0.13.0 X-GND-Sasl: luca.ceresoli@bootlin.com Clarify DAPM does not expose any API to user space, and adapt the paragraph accordingly. Reviewed-by: Alexandre Belloni Reviewed-by: Bagas Sanjaya Signed-off-by: Luca Ceresoli --- Documentation/sound/soc/dapm.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Documentation/sound/soc/dapm.rst b/Documentation/sound/soc/dapm.rst index be849879274d..f96a32f137aa 100644 --- a/Documentation/sound/soc/dapm.rst +++ b/Documentation/sound/soc/dapm.rst @@ -11,9 +11,10 @@ subsystem at all times. It is independent of other kernel power management frameworks and, as such, can easily co-exist with them. DAPM is also completely transparent to all user space applications as -all power switching is done within the ASoC core. No code changes or -recompiling are required for user space applications. DAPM makes power -switching decisions based upon any audio stream (capture/playback) +all power switching is done internally to the ASoC core. For this reason +DAPM does not expose a kernel API to user space and no code changes or +recompiling are required for user space applications to use it. DAPM makes +power switching decisions based upon any audio stream (capture/playback) activity and audio mixer settings within the device. DAPM spans the whole machine. It covers power control within the entire From patchwork Fri Apr 26 16:56:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 13645107 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (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 CEE0B168AE6; Fri, 26 Apr 2024 16:56:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.199 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714150614; cv=none; b=a2mOG7gktyk2L9hmeIOAIPEtYP2U5wkV+h/PBSmKYAdU6h3zOUBpcmz4pIa3N3jRggMWD2+9hTniNcYlv5EvpDvRDGkx2t/YeTz62th6dfXrTpGROhDodJdSEezgtxmOdOpr2CSEAq61sblzJFbeXqZljivAddFoNgiguGrfzv4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714150614; c=relaxed/simple; bh=Y9CUnck7THjoN6x8IrAFw09G6hJUpUvGCNUaNkYbzZY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=EGsfsf5z06ZWPAxLdxX3YmJGIlIglxKmFSMDyZ5ZT8ETWBXEg/NCCNAx5WZ+pH6KAdjxe8OnIGHxxq1/VLvTsFwVf5C8tLzKIDk8XTVZYP8Nn3+3yxQF5sZFsHz7Xp/PAxna1uvFDHPmpt7AfNg2BLimqVJTyXTco9HIcJi8KSQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=Mbvn6Lit; arc=none smtp.client-ip=217.70.183.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="Mbvn6Lit" Received: by mail.gandi.net (Postfix) with ESMTPSA id 8FF8DFF807; Fri, 26 Apr 2024 16:56:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1714150611; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iSUU7C4Fcf6ZvY0mTm+OdGB1Q5lauGV6mB1GfXERmdg=; b=Mbvn6LitXY8/acwBgzfvXmcLNflwTmAotthAi+skuIcs/SEo6PyF/35YB3sqEZmdlKRRYD InRnupPiBEGpwAiojpf+aCKVS3+TI/JY7D21kI4NmhSD3eTzF6MDN/ylyOasMEKQp4Voke B45kf31txw1sqap7oVgNQABdQJPBJFYfVCo3eCWL0fKMLWfDIu9bbl4wnyMc9DANbZzHUL 3Cg6Pk4qYa+k+8RfbELBTosvISUPGz+6zkkIhcAxDBIPp8wbUjac91WpZ56Uw1/VJGX3Vx RIv2extlaWJhfDLuOMj5GUTamE+Ewdhu5+6U7lD8HDZTK0N1KdyavYPnpYcKuQ== From: Luca Ceresoli Date: Fri, 26 Apr 2024 18:56:39 +0200 Subject: [PATCH v2 06/12] ASoC: doc: dapm: replace "map" with "graph" Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240426-dapm-docs-v2-6-87b07547eb5b@bootlin.com> References: <20240426-dapm-docs-v2-0-87b07547eb5b@bootlin.com> In-Reply-To: <20240426-dapm-docs-v2-0-87b07547eb5b@bootlin.com> To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Jonathan Corbet Cc: Alexandre Belloni , Bagas Sanjaya , Thomas Petazzoni , linux-sound@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Luca Ceresoli X-Mailer: b4 0.13.0 X-GND-Sasl: luca.ceresoli@bootlin.com DAPM is actually based on a graph, so use this specific term instead of the more generic "map". Reviewed-by: Alexandre Belloni Signed-off-by: Luca Ceresoli --- Documentation/sound/soc/dapm.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/sound/soc/dapm.rst b/Documentation/sound/soc/dapm.rst index f96a32f137aa..11f7f2f685af 100644 --- a/Documentation/sound/soc/dapm.rst +++ b/Documentation/sound/soc/dapm.rst @@ -49,7 +49,7 @@ Stream domain stopped respectively. e.g. aplay, arecord. All DAPM power switching decisions are made automatically by consulting an audio -routing map of the whole machine. This map is specific to each machine and +routing graph of the whole machine. This graph is specific to each machine and consists of the interconnections between every audio component (including internal codec components). All audio components that affect power are called widgets hereafter. @@ -230,7 +230,7 @@ to any stream event or by kernel PM events. Virtual Widgets --------------- -Sometimes widgets exist in the codec or machine audio map that don't have any +Sometimes widgets exist in the codec or machine audio graph that don't have any corresponding soft power control. In this case it is necessary to create a virtual widget - a widget with no control bits e.g. :: @@ -248,7 +248,7 @@ Codec/DSP Widget Interconnections Widgets are connected to each other within the codec, platform and machine by audio paths (called interconnections). Each interconnection must be defined in -order to create a map of all audio paths between widgets. +order to create a graph of all audio paths between widgets. This is easiest with a diagram of the codec or DSP (and schematic of the machine audio system), as it requires joining widgets together via their audio signal From patchwork Fri Apr 26 16:56:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 13645108 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (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 024D4153BD0; Fri, 26 Apr 2024 16:56:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.199 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714150617; cv=none; b=p9rOnYrTBXpEO+g0DKWndUOqrbUezkmvup5LAqgN7g0t7kS7h8XiOm++eWSWxFwfhqOSbNlqvV1t+0YmaSG4ayj0ckxuH9D3ccXHhYLR96OWpKwLyrQsS3eph6yvY7BmaXnbnk8Zy4iEIh0Oywple6uazHaqKCs8gFeSAT7bh3w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714150617; c=relaxed/simple; bh=6z5GFSwflrOusQM1x4eHHSr4jUByevrOUsU8sVqOir8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oZoDKQM2r41zHbJAy0OmdNPrtH+GU1j6T3bHTqTWngPpxc4FdJ4bvJ7Zo1uXbG0VnT3B9FAPT9VHSiSCNuKMRXx6jrJ3EQi38nB2VaWY315a+TbT1KF1i+DfdCFQkpM/RTHYQHBYLxH4eLf2fie0oHNzCkfgHQXgcL0U582XZCc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=KLBjqaDD; arc=none smtp.client-ip=217.70.183.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="KLBjqaDD" Received: by mail.gandi.net (Postfix) with ESMTPSA id 9D800FF802; Fri, 26 Apr 2024 16:56:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1714150612; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=05gZeJQSHsZrIshFB3NI1Um+lR28IX40e/lD/576N3k=; b=KLBjqaDDCu4YyjNbk/wiY/p+UI/OybK6aPhMM9Mo3tlO3LC0/FzDTmVEcbKHlxh7nmofI2 0J7gPAu25t1Cm5JL0CLnMN0tzS5j+Jid+zGQtYXTrSi3xIi5l3KEyqarp/+pnwQ1lIa3i+ OOO52w5HHSVDGiVuXw+bo00YgI+ZW788LGE/5wDTparNQqL2egQwUbCH5FtdPNxCPZ7fmZ fhnAWywe2wJTMwhEM0kovx68WLTLSiWY2LQFN1EGhg1izmr5jVA5BQWx9zIlIAmosZDJo8 lxfxrfBn+1IzJ180Ptu1ZJjKFe4KhwLjYsQM0zXfqmEGJob3+Rn3MTgovd8+qA== From: Luca Ceresoli Date: Fri, 26 Apr 2024 18:56:40 +0200 Subject: [PATCH v2 07/12] ASoC: doc: dapm: extend initial descrption Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240426-dapm-docs-v2-7-87b07547eb5b@bootlin.com> References: <20240426-dapm-docs-v2-0-87b07547eb5b@bootlin.com> In-Reply-To: <20240426-dapm-docs-v2-0-87b07547eb5b@bootlin.com> To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Jonathan Corbet Cc: Alexandre Belloni , Bagas Sanjaya , Thomas Petazzoni , linux-sound@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Luca Ceresoli X-Mailer: b4 0.13.0 X-GND-Sasl: luca.ceresoli@bootlin.com Extend the initial description providing clearer definitions of "widget" and "route", and to stop using the word "component" to mean "widget". Give more details and clarify wording and add a picture representing a real DAPM graph. Group all the introductory paragraphs before the "DAPM power domains", and split the latter to a specific section. Reviewed-by: Alexandre Belloni Reviewed-by: Bagas Sanjaya Signed-off-by: Luca Ceresoli --- Documentation/sound/soc/dapm-graph.svg | 375 +++++++++++++++++++++++++++++++++ Documentation/sound/soc/dapm.rst | 30 ++- 2 files changed, 396 insertions(+), 9 deletions(-) diff --git a/Documentation/sound/soc/dapm-graph.svg b/Documentation/sound/soc/dapm-graph.svg new file mode 100644 index 000000000000..d783672db815 --- /dev/null +++ b/Documentation/sound/soc/dapm-graph.svg @@ -0,0 +1,375 @@ + + + + + + +G + + +ROOT + +ROOT + + +4000b000.audio-controller + +4000b000.audio-controller + + +cs42l51.0-004a + +cs42l51.0-004a + + +hdmi-audio-codec.1.auto + +hdmi-audio-codec.1.auto + + + +ROOT_Amplifier + +Amplifier +[out_drv] + + + +4000b000.audio-controller_capture + +capture +[dai_out] + + + +4000b000.audio-controller_playback + +playback +[dai_in] + + + +hdmi-audio-codec.1.auto_I2S Playback + +I2S Playback +[dai_in] + + + +4000b000.audio-controller_playback->hdmi-audio-codec.1.auto_I2S Playback + + + + + +hdmi-audio-codec.1.auto_Capture + +Capture +[dai_out] + + + +hdmi-audio-codec.1.auto_Capture->4000b000.audio-controller_capture + + + + + +cs42l51.0-004a_AIN1L + +AIN1L +[input] + + + +cs42l51.0-004a_PGA-ADC Mux Left + +PGA-ADC Mux Left +[mux] + + + +cs42l51.0-004a_AIN1L->cs42l51.0-004a_PGA-ADC Mux Left + + + + + +cs42l51.0-004a_AIN1R + +AIN1R +[input] + + + +cs42l51.0-004a_PGA-ADC Mux Right + +PGA-ADC Mux Right +[mux] + + + +cs42l51.0-004a_AIN1R->cs42l51.0-004a_PGA-ADC Mux Right + + + + + +cs42l51.0-004a_AIN2L + +AIN2L +[input] + + + +cs42l51.0-004a_AIN2R + +AIN2R +[input] + + + +cs42l51.0-004a_Capture + +Capture +[dai_out] + + + +cs42l51.0-004a_DAC Mux + +DAC Mux +[mux] + + + +cs42l51.0-004a_Left DAC + +Left DAC +[dac] + + + +cs42l51.0-004a_DAC Mux->cs42l51.0-004a_Left DAC + + + + + +cs42l51.0-004a_Right DAC + +Right DAC +[dac] + + + +cs42l51.0-004a_DAC Mux->cs42l51.0-004a_Right DAC + + + + + +cs42l51.0-004a_HPL + +HPL +[output] + + + +cs42l51.0-004a_HPR + +HPR +[output] + + + +cs42l51.0-004a_Left ADC + +Left ADC +[adc] + + + +cs42l51.0-004a_Left ADC->cs42l51.0-004a_Capture + + + + + +cs42l51.0-004a_Left DAC->cs42l51.0-004a_HPL + + + + + +cs42l51.0-004a_Left PGA + +Left PGA +[pga] + + + +cs42l51.0-004a_Left PGA->cs42l51.0-004a_Left ADC + + + + + +cs42l51.0-004a_MCLK + +MCLK +[supply] + + + +cs42l51.0-004a_MCLK->cs42l51.0-004a_Capture + + + + + +cs42l51.0-004a_Playback + +Playback +[dai_in] + + + +cs42l51.0-004a_MCLK->cs42l51.0-004a_Playback + + + + + +cs42l51.0-004a_MICL + +MICL +[input] + + + +cs42l51.0-004a_Mic Preamp Left + +Mic Preamp Left +[mixer] + + + +cs42l51.0-004a_MICL->cs42l51.0-004a_Mic Preamp Left + + + + + +cs42l51.0-004a_MICR + +MICR +[input] + + + +cs42l51.0-004a_Mic Preamp Right + +Mic Preamp Right +[mixer] + + + +cs42l51.0-004a_MICR->cs42l51.0-004a_Mic Preamp Right + + + + + +cs42l51.0-004a_Mic Bias + +Mic Bias +[supply] + + + +cs42l51.0-004a_Mic Bias->cs42l51.0-004a_MICL + + + + + +cs42l51.0-004a_PGA-ADC Mux Left->cs42l51.0-004a_Left PGA + + + + + +cs42l51.0-004a_Right PGA + +Right PGA +[pga] + + + +cs42l51.0-004a_PGA-ADC Mux Right->cs42l51.0-004a_Right PGA + + + + + +cs42l51.0-004a_Playback->cs42l51.0-004a_DAC Mux + + + + + +cs42l51.0-004a_Right ADC + +Right ADC +[adc] + + + +cs42l51.0-004a_Right ADC->cs42l51.0-004a_Capture + + + + + +cs42l51.0-004a_Right DAC->cs42l51.0-004a_HPR + + + + + +cs42l51.0-004a_Right PGA->cs42l51.0-004a_Right ADC + + + + + +hdmi-audio-codec.1.auto_TX + +TX +[output] + + + +hdmi-audio-codec.1.auto_I2S Playback->hdmi-audio-codec.1.auto_TX + + + + + +hdmi-audio-codec.1.auto_RX + +RX +[output] + + + +hdmi-audio-codec.1.auto_RX->hdmi-audio-codec.1.auto_Capture + + + + + diff --git a/Documentation/sound/soc/dapm.rst b/Documentation/sound/soc/dapm.rst index 11f7f2f685af..58ef880ac8b6 100644 --- a/Documentation/sound/soc/dapm.rst +++ b/Documentation/sound/soc/dapm.rst @@ -17,9 +17,27 @@ recompiling are required for user space applications to use it. DAPM makes power switching decisions based upon any audio stream (capture/playback) activity and audio mixer settings within the device. -DAPM spans the whole machine. It covers power control within the entire -audio subsystem, this includes internal codec power blocks and machine -level power systems. +DAPM is based on two basic elements, called widgets and routes: + + * a **widget** is every part of the audio hardware that can be enabled by + software when in use and disabled to save power when not in use + * a **route** is an interconnection between widgets that exists when sound + can flow from one widget to the other + +All DAPM power switching decisions are made automatically by consulting an +audio routing graph. This graph is specific to each sound card and spans +the whole sound card, so some DAPM routes connect two widgets belonging to +different components (e.g. the LINE OUT pin of a CODEC and the input pin of +an amplifier). + +The graph for the STM32MP1-DK1 sound card is shown in picture: + +.. kernel-figure:: dapm-graph.svg + :alt: Example DAPM graph + :align: center + +DAPM power domains +================== There are 4 power domains within DAPM: @@ -48,12 +66,6 @@ Stream domain Enabled and disabled when stream playback/capture is started and stopped respectively. e.g. aplay, arecord. -All DAPM power switching decisions are made automatically by consulting an audio -routing graph of the whole machine. This graph is specific to each machine and -consists of the interconnections between every audio component (including -internal codec components). All audio components that affect power are called -widgets hereafter. - DAPM Widgets ============ From patchwork Fri Apr 26 16:56:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 13645109 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (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 7F71816F271; Fri, 26 Apr 2024 16:56:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.199 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714150617; cv=none; b=uCnO/n7ZIsWIE5963NUWDo2MiDiJC51yWMtdPRqrqJxTpzOI2wsJTRTXDOqfn6rqtJZh1+wQDorkHA9h5o963XlxlrbBwc+fsvEFqmfsisf+nTodc3mRB/wyJBSL6FK5G4DXTN2LDWFOy+wC0igh4oNeUo1KpRefwNdAIrMQGF4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714150617; c=relaxed/simple; bh=XYFPk3FkQ7DoDucDYSBcdACRbcapzxVltYw2E7kA37Q=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oMbqtthrEzusFLvGqR1M2Kfa550F2FcaqCIrGBChfZ+l09jmrsxOUiC9GvX/rA8tJxO2f6FI3Ahu28QQqsTx9+kfLnRADGNFE7MPYcGK930bHIIP59P87uVYlvBG0A1zAhOHbwTudsrjFTUfyFrDyDSC/qgF2UrcNWsgcXteJRU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=d6pd9TaQ; arc=none smtp.client-ip=217.70.183.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="d6pd9TaQ" Received: by mail.gandi.net (Postfix) with ESMTPSA id C2FD7FF80A; Fri, 26 Apr 2024 16:56:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1714150613; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+UBvOzoqMa/jwSCZa3hO8uAMEhEb6gozqHJClVGlszs=; b=d6pd9TaQuiuO7ZYfLMgtn/1ztB6l8swWyCQvdAauc0eBgcA+oRBNRToKsNVxgQ0accHkIT Cwb+PvKNffPxwIQsme96rvglK88wwQT1lo2thCadQl2mi3IcSxVnV0YSDj1KTF3PTUvBj4 qlUmQN206+nBU6/6IwNj/nsvuuS6h460WjevvaUdX96wYt/BUN0gRqPWVLOOY1esiRhY7Y QHDwco4JT4uOd0RQaqawrhXRLS5A8k7dupvyGRi+IJd9pxLg9rSZUYy2QMVdVIXva4so61 xrZ8GsFHyk8az3E2Q+txwh30BZckK8aMey1nqpyEhowROuswDIUNKvUf/kPohA== From: Luca Ceresoli Date: Fri, 26 Apr 2024 18:56:41 +0200 Subject: [PATCH v2 08/12] ASoC: doc: dapm: describe how widgets and routes are registered Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240426-dapm-docs-v2-8-87b07547eb5b@bootlin.com> References: <20240426-dapm-docs-v2-0-87b07547eb5b@bootlin.com> In-Reply-To: <20240426-dapm-docs-v2-0-87b07547eb5b@bootlin.com> To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Jonathan Corbet Cc: Alexandre Belloni , Bagas Sanjaya , Thomas Petazzoni , linux-sound@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Luca Ceresoli X-Mailer: b4 0.13.0 X-GND-Sasl: luca.ceresoli@bootlin.com The small paragraph describing how to register widgets is incomplete (does not mention routes) and mentions snd_soc_dapm_new_control() which is not really used. Moreover it appears as a part of the "Virtual Widgets" subsection. Replace it with a detailed and current description of how widgets and routes are registered, mentioning both static declaration and runtime registration. Also make this a section on its own. Reviewed-by: Alexandre Belloni Reviewed-by: Bagas Sanjaya Signed-off-by: Luca Ceresoli --- Documentation/sound/soc/dapm.rst | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/Documentation/sound/soc/dapm.rst b/Documentation/sound/soc/dapm.rst index 58ef880ac8b6..4b094c3d7942 100644 --- a/Documentation/sound/soc/dapm.rst +++ b/Documentation/sound/soc/dapm.rst @@ -251,8 +251,42 @@ a virtual widget - a widget with no control bits e.g. This can be used to merge two signal paths together in software. -After all the widgets have been defined, they can then be added to the DAPM -subsystem individually with a call to snd_soc_dapm_new_control(). +Registering DAPM controls +========================= + +In many cases the DAPM widgets implemented statically in a ``static const +struct snd_soc_dapm_widget`` array and the routes connecting them in a +``static const struct snd_soc_dapm_route`` array in a codec driver, and +simply declared via the ``dapm_widgets`` and ``num_dapm_widgets`` fields of +the ``struct snd_soc_component_driver`` so the driver registration will +take care of populating them:: + + static const struct snd_soc_dapm_widget wm2000_dapm_widgets[] = { + SND_SOC_DAPM_OUTPUT("SPKN"), + SND_SOC_DAPM_OUTPUT("SPKP"), + ... + }; + + /* Target, Path, Source */ + static const struct snd_soc_dapm_route wm2000_audio_map[] = { + { "SPKN", NULL, "ANC Engine" }, + { "SPKP", NULL, "ANC Engine" }, + ... + }; + + static const struct snd_soc_component_driver soc_component_dev_wm2000 = { + ... + .dapm_widgets = wm2000_dapm_widgets, + .num_dapm_widgets = ARRAY_SIZE(wm2000_dapm_widgets), + ... + }; + +In more complex cases the list of DAPM widgets and/or routes can be only +known at build time. This happens for example when a driver supports +different models having a different set of features. In those cases +separate widgets and routes arrays implementing the case-specific features +can be registered programmatically by calling snd_soc_dapm_new_controls() +and snd_soc_dapm_add_routes(). Codec/DSP Widget Interconnections From patchwork Fri Apr 26 16:56:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 13645110 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (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 3BA0016F29E; Fri, 26 Apr 2024 16:56:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.199 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714150618; cv=none; b=tYIk1DEZxsNwUzeL/6ZKJWkZhwXu573H0L1PenV9ccI4lW9LL5/4OEGE9MxDE3vLVHfuXRab7xvdY5GLGKlwUSvKGOjredkgSwYWp96ZXmFLbDrt/JXq87e6rpE5xrRlbNFAPF8MyoXEBEeY9LuCGU2MqtTGTPnGns87UpM1bn8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714150618; c=relaxed/simple; bh=F1LZ4pXZailW1WmBflpQvbjndxGmhq/MZOPOp9kXDC0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Eca3LBNr7LzuD2f3xCdEPC71TF5/QxLuZfo0h6qicw8mz1y8bSsYfBYUORSXW57gjDE1mCNo0pTKS76oUfsw2aja2s0mkobB1KgavQG7WA1BmQIhm0lpn2sFmW1yxdWVdG4OdhXGasj0w+EhM7WoyT9Mf/k2qxi9wE/hQkcRZzU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=AoRbk68P; arc=none smtp.client-ip=217.70.183.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="AoRbk68P" Received: by mail.gandi.net (Postfix) with ESMTPSA id D38D4FF806; Fri, 26 Apr 2024 16:56:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1714150614; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JNUYmNaDXVi05G13rtiLP/bMLMXkxWa7NktFe/M9xNQ=; b=AoRbk68PHj29FzrNYrmhF6dXOHnoZfHOTsV54igW6QYX6jg0Cz1IjUBWKueOghDwBB1l3D d+gFh6BsDvwD01DMhwuKko3VGm2t6I+RuZ2uwFquLyb/qo5KRZCOUPn98t/Ff53v5qHGkA 8bmAlhiOTUEQbaM6K5iQlrpbtAStOaPIvrTZa2eGulmByD4ZrKVMN2OdE3m72Xxt6HuSh6 z4Xr2gKxvXcn1pjyLkuKl9OFvEoVpBdektcbMaKNya/u2itmAqznSQ+6sWk1SRYQJ/KTXL y4yVOnv3lh0m0KOXiB9fy3CAFh1TwDDNwRNBEaSf/jmUzbC47nZ4FskwINZ+LA== From: Luca Ceresoli Date: Fri, 26 Apr 2024 18:56:42 +0200 Subject: [PATCH v2 09/12] ASoC: doc: dapm: fix and improve section "Registering DAPM controls" Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240426-dapm-docs-v2-9-87b07547eb5b@bootlin.com> References: <20240426-dapm-docs-v2-0-87b07547eb5b@bootlin.com> In-Reply-To: <20240426-dapm-docs-v2-0-87b07547eb5b@bootlin.com> To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Jonathan Corbet Cc: Alexandre Belloni , Bagas Sanjaya , Thomas Petazzoni , linux-sound@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Luca Ceresoli X-Mailer: b4 0.13.0 X-GND-Sasl: luca.ceresoli@bootlin.com Extend the first paragraph to mention the {,num_}dapm_routes fields just like the widget conterparts. Mention the route fields also in the code example. Fix "at build time", this really means "at probe time". Reviewed-by: Alexandre Belloni Reviewed-by: Bagas Sanjaya Signed-off-by: Luca Ceresoli --- Documentation/sound/soc/dapm.rst | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/Documentation/sound/soc/dapm.rst b/Documentation/sound/soc/dapm.rst index 4b094c3d7942..2831b00ae4e2 100644 --- a/Documentation/sound/soc/dapm.rst +++ b/Documentation/sound/soc/dapm.rst @@ -254,12 +254,17 @@ This can be used to merge two signal paths together in software. Registering DAPM controls ========================= -In many cases the DAPM widgets implemented statically in a ``static const -struct snd_soc_dapm_widget`` array and the routes connecting them in a -``static const struct snd_soc_dapm_route`` array in a codec driver, and -simply declared via the ``dapm_widgets`` and ``num_dapm_widgets`` fields of -the ``struct snd_soc_component_driver`` so the driver registration will -take care of populating them:: +In many cases the DAPM widgets are implemented statically in a ``static +const struct snd_soc_dapm_widget`` array in a codec driver, and simply +declared via the ``dapm_widgets`` and ``num_dapm_widgets`` fields of the +``struct snd_soc_component_driver``. + +Similarly, routes connecting them are implemented statically in a ``static +const struct snd_soc_dapm_route`` array and declared via the +``dapm_routes`` and ``num_dapm_routes`` fields of the same struct. + +With the above declared, the driver registration will take care of +populating them:: static const struct snd_soc_dapm_widget wm2000_dapm_widgets[] = { SND_SOC_DAPM_OUTPUT("SPKN"), @@ -278,11 +283,13 @@ take care of populating them:: ... .dapm_widgets = wm2000_dapm_widgets, .num_dapm_widgets = ARRAY_SIZE(wm2000_dapm_widgets), + .dapm_routes = wm2000_audio_map, + .num_dapm_routes = ARRAY_SIZE(wm2000_audio_map), ... }; In more complex cases the list of DAPM widgets and/or routes can be only -known at build time. This happens for example when a driver supports +known at probe time. This happens for example when a driver supports different models having a different set of features. In those cases separate widgets and routes arrays implementing the case-specific features can be registered programmatically by calling snd_soc_dapm_new_controls() From patchwork Fri Apr 26 16:56:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 13645111 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (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 4DC7A16F914; Fri, 26 Apr 2024 16:56:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.199 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714150619; cv=none; b=d9IIGYXRQue+DztGWE0H2ZuYD9h9VZtUESKkhT03kO603yuvLPIl3Nc9kXrecFufDjmnEbQ7pI5IAaVNzLnLfygZGxIxny+DvUwTXK6k4B27WaiVn0Eqv1uhq3hQzAWapJcxZJEUy67ff8kJgoPfOE52Ops81mJ4YrX7QtmhpAo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714150619; c=relaxed/simple; bh=/jnaUB3Eb1FdwMsrUXBpAK6Q7IzWpVBENDZQ5igeM7I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HwHSbUyKxsMyZiPBImB+M8FRV5JYmwgh7IM6v24GVJtiq3qiqc8AK6x8V0wik4C0OeztD2fGybv7nkC5e+l4yANO3G4V/sEic0lmzLRDl9VXir6U1nra26zzrB9XeZsFchKYOOKU+SYq3fN1Y7K2FMb2touiXyNt4MCk+DkJzbM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=ghnuW8yd; arc=none smtp.client-ip=217.70.183.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="ghnuW8yd" Received: by mail.gandi.net (Postfix) with ESMTPSA id E0A8DFF80B; Fri, 26 Apr 2024 16:56:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1714150615; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=usivvK38WjvktYZbpdXlYorFChab9V2d8xiA3hJZNWc=; b=ghnuW8yddFB5QeT64qP1THlBFvvFHnib3MohbVWg3GBJyymnSPlCdGuUPNSTW/HydQf9n+ W4a2jQEhK/hU090tJ8CUAQLkJXDJOYlgJMj//OtNZCuxsue4tiRJ4wstUIiLnWIc1Hqe/R I+hRr0UVqAhD7XEwOXmfDT1KcsZtMyBSa5Pia+neDpAG0KRCwoJ9mbXUoqVdxkX/Hcw3bx L5q3/PH2/8Kp6VNf/cdDDq9oCxPXCdHYSA2919fT46ABrsUGU2VYn7AC9kk9FicElV0Z26 Js3R7Rpf86lzokAMjZLry/Yq5jqkLSzAvOQgx85hfeVC8HT3drRVR0UB+EXF0A== From: Luca Ceresoli Date: Fri, 26 Apr 2024 18:56:43 +0200 Subject: [PATCH v2 10/12] ASoC: doc: dapm: improve section "Codec/DSP Widget Interconnections" Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240426-dapm-docs-v2-10-87b07547eb5b@bootlin.com> References: <20240426-dapm-docs-v2-0-87b07547eb5b@bootlin.com> In-Reply-To: <20240426-dapm-docs-v2-0-87b07547eb5b@bootlin.com> To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Jonathan Corbet Cc: Alexandre Belloni , Bagas Sanjaya , Thomas Petazzoni , linux-sound@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Luca Ceresoli X-Mailer: b4 0.13.0 X-GND-Sasl: luca.ceresoli@bootlin.com Improve wording in a few places, cleanup ReST colon syntax, remove space before colon, and remove the "codec" parameter in the parentheses of snd_soc_dapm_new_widgets() (there should be no parameters in the docs, and that function takes a card, not a codec). Reviewed-by: Alexandre Belloni Signed-off-by: Luca Ceresoli --- Documentation/sound/soc/dapm.rst | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/Documentation/sound/soc/dapm.rst b/Documentation/sound/soc/dapm.rst index 2831b00ae4e2..6096334226c0 100644 --- a/Documentation/sound/soc/dapm.rst +++ b/Documentation/sound/soc/dapm.rst @@ -307,25 +307,23 @@ This is easiest with a diagram of the codec or DSP (and schematic of the machine audio system), as it requires joining widgets together via their audio signal paths. -e.g., from the WM8731 output mixer (wm8731.c) - -The WM8731 output mixer has 3 inputs (sources) +For example the WM8731 output mixer (wm8731.c) has 3 inputs (sources): 1. Line Bypass Input 2. DAC (HiFi playback) 3. Mic Sidetone Input -Each input in this example has a kcontrol associated with it (defined in example -above) and is connected to the output mixer via its kcontrol name. We can now -connect the destination widget (wrt audio signal) with its source widgets. -:: +Each input in this example has a kcontrol associated with it (defined in +the example above) and is connected to the output mixer via its kcontrol +name. We can now connect the destination widget (wrt audio signal) with its +source widgets. :: /* output mixer */ {"Output Mixer", "Line Bypass Switch", "Line Input"}, {"Output Mixer", "HiFi Playback Switch", "DAC"}, {"Output Mixer", "Mic Sidetone Switch", "Mic Bias"}, -So we have : +So we have: * Destination Widget <=== Path Name <=== Source Widget, or * Sink, Path, Source, or @@ -334,12 +332,11 @@ So we have : When there is no path name connecting widgets (e.g. a direct connection) we pass NULL for the path name. -Interconnections are created with a call to: -:: +Interconnections are created with a call to:: snd_soc_dapm_connect_input(codec, sink, path, source); -Finally, snd_soc_dapm_new_widgets(codec) must be called after all widgets and +Finally, snd_soc_dapm_new_widgets() must be called after all widgets and interconnections have been registered with the core. This causes the core to scan the codec and machine so that the internal DAPM state matches the physical state of the machine. From patchwork Fri Apr 26 16:56:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 13645112 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (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 8BB8416FF39; Fri, 26 Apr 2024 16:56:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.199 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714150620; cv=none; b=SsNe8qPy7OXjBdF1gH3XJQ3ZuUq3xsBwcjtXJ/+D0vBVzzSzMW/KiZMwIwn7MrhhmG6nh3J6pl1+D62X/FlyzZHSbfOd4umobSNGN85IHZObvy9szDMJXfajoAsnGdlb7BDORIWTvflvwo1SvyUrqse7GDf3loryGSCqwYDXKCs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714150620; c=relaxed/simple; bh=ZFg7sIJ9crczjv/BDIte8s7MP3nZeUb9WTkFeJyccUg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=YouiLkQfVayO+S5VI/ukOsndo3eiREscKNBO4rEhlpAwgtppY0TK6Tku4VYAItbeSXusrA3/hqFza7xe2xChpNk2fTHNbxdhyw/cRBTQurKbQNGaHI7sYP98WQ5b+buLmiW/g6L2f/W1+1I/+/RV9c50/Q+irbJ9J5oiBXB1wzQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=esdeqpag; arc=none smtp.client-ip=217.70.183.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="esdeqpag" Received: by mail.gandi.net (Postfix) with ESMTPSA id 0228AFF807; Fri, 26 Apr 2024 16:56:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1714150616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Yg5gNzFKL5u/fDNdHuMLTH3QOE35rAIDeXoigKMZYRQ=; b=esdeqpagdxcHH+IWfmoEI0xxDBZHisgParjZBUZTnM44mSB+BWPdr8e7ko1fzn1lAQr2Ba ukp78m25sAYeLdaSpFexfnBVjATKfnXxa4oTlMgx9nxmWXH1n+AfHdWxPSzkKlY5t0yygL p4A819tOAaAcstBzJftM4AWupRmCDkIXSWJKgJMmi5bzB2VHicmlktamcnkWPZXKuT5pXT jtoJFsBKRt2iGwcjZPabvHur2J8j1a3b/lqVb54VDIsfohnJ5kK67fFILl4qik31pxdOgr DIGokBGPugPAFcf8+gD20W+2c3zJUiiLKbaRhQAqCNUHwlpePjcrPaCrqMEYDA== From: Luca Ceresoli Date: Fri, 26 Apr 2024 18:56:44 +0200 Subject: [PATCH v2 11/12] ASoC: doc: dapm: update section "DAPM Widget Events" Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240426-dapm-docs-v2-11-87b07547eb5b@bootlin.com> References: <20240426-dapm-docs-v2-0-87b07547eb5b@bootlin.com> In-Reply-To: <20240426-dapm-docs-v2-0-87b07547eb5b@bootlin.com> To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Jonathan Corbet Cc: Alexandre Belloni , Bagas Sanjaya , Thomas Petazzoni , linux-sound@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Luca Ceresoli X-Mailer: b4 0.13.0 X-GND-Sasl: luca.ceresoli@bootlin.com The example in this section is not in the kernel sources anymore. Replace it with an up to date code fragment. Reword the initial paragraph. Remove "Please" which is not standard practice in documentation. Reviewed-by: Alexandre Belloni Signed-off-by: Luca Ceresoli --- Documentation/sound/soc/dapm.rst | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/Documentation/sound/soc/dapm.rst b/Documentation/sound/soc/dapm.rst index 6096334226c0..da9313e10fd4 100644 --- a/Documentation/sound/soc/dapm.rst +++ b/Documentation/sound/soc/dapm.rst @@ -377,23 +377,29 @@ jacks can also be switched OFF. DAPM Widget Events ================== -Some widgets can register their interest with the DAPM core in PM events. -e.g. A Speaker with an amplifier registers a widget so the amplifier can be -powered only when the spk is in use. -:: +Widgets needing to implement a more complex behaviour than what DAPM can do +can set a custom "event handler" by setting a function pointer. An example +is a power supply needing to enable a GPIO:: - /* turn speaker amplifier on/off depending on use */ - static int corgi_amp_event(struct snd_soc_dapm_widget *w, int event) + static int sof_es8316_speaker_power_event(struct snd_soc_dapm_widget *w, + struct snd_kcontrol *kcontrol, int event) { - gpio_set_value(CORGI_GPIO_APM_ON, SND_SOC_DAPM_EVENT_ON(event)); - return 0; + if (SND_SOC_DAPM_EVENT_ON(event)) + gpiod_set_value_cansleep(gpio_pa, true); + else + gpiod_set_value_cansleep(gpio_pa, false); + + return 0; } - /* corgi machine dapm widgets */ - static const struct snd_soc_dapm_widget wm8731_dapm_widgets = - SND_SOC_DAPM_SPK("Ext Spk", corgi_amp_event); + static const struct snd_soc_dapm_widget st_widgets[] = { + ... + SND_SOC_DAPM_SUPPLY("Speaker Power", SND_SOC_NOPM, 0, 0, + sof_es8316_speaker_power_event, + SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU), + }; -Please see soc-dapm.h for all other widgets that support events. +See soc-dapm.h for all other widgets that support events. Event types From patchwork Fri Apr 26 16:56:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 13645113 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (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 8CAEA16FF50; Fri, 26 Apr 2024 16:56:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.199 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714150621; cv=none; b=GkZlafysaXj+nDS56Neroa4ATyS0vKNs2qqrpuYJfE2XYNJkeO38LUHRRNUr88i6aHtDtdJpIKQcKKN8bSMJQrRg8QkNvTgesFAYF/nU6QKLzbWe74mGPe/TVHI/aC+RclpOPneOMYFXEH8r+M1fikogE7GU96xKLlVmk+1sdEo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714150621; c=relaxed/simple; bh=wnFgu9dI3D2py+XrxISiUUb14iuf8bUF3qAQUXBua9Q=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=eQbmxGz6GKCDMEZyfWHfPW0jRbyL9/RcUlB2881qcBMIThH/Qhzr/gtQXq/eM9fRlR8R9/RyGzQHBt6ydNFKw4+n0q04tpzsVV4W4LWBlX1OlZziExg6cyQ2MwM88CTjM5+N8jTqIb8d2zy+XrYoN1FuqVGNjhCWBWwSxmJwK6w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=iF2KkeQB; arc=none smtp.client-ip=217.70.183.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="iF2KkeQB" Received: by mail.gandi.net (Postfix) with ESMTPSA id 139A4FF80C; Fri, 26 Apr 2024 16:56:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1714150618; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=50K17wTh30wqpE0frf03Mw6JWq1YiGmGGG3UJIVv2+c=; b=iF2KkeQBRDLsiVMmuXwQZSZExzcC31z+QcrhaeQ9K6rmeSEdpFAKFgiu5ZoSJeGmk6bD5g KO5C9RUJrb28v3De1uJT0SyYBhHYYiyLWBYAQPX5YPuWmpPi3tbHKzwyxe2wvute8oGuMI 2LVucLcjOe7DPfsk+uEBxMw0w42XClDduTxfy3B8v3m7KmBwWuyZTbccsaaikw3OUQ97kR Spu2ksyCasIUr/NmWz9ciC4pwRRWJ00b+kWDS31rp6EEiX7CM07E9U51r4RXaqm1IfDDRE Mzr2FHYIB6qlh6h6g/qwFITJH6eUnFNOWAZSlvAPLZ9r6HXCp66YcovtSpEq+Q== From: Luca Ceresoli Date: Fri, 26 Apr 2024 18:56:45 +0200 Subject: [PATCH v2 12/12] ASoC: doc: dapm: update event types Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240426-dapm-docs-v2-12-87b07547eb5b@bootlin.com> References: <20240426-dapm-docs-v2-0-87b07547eb5b@bootlin.com> In-Reply-To: <20240426-dapm-docs-v2-0-87b07547eb5b@bootlin.com> To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Jonathan Corbet Cc: Alexandre Belloni , Bagas Sanjaya , Thomas Petazzoni , linux-sound@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Luca Ceresoli X-Mailer: b4 0.13.0 X-GND-Sasl: luca.ceresoli@bootlin.com Some new event types now exist, so update the code fragment. Reviewed-by: Alexandre Belloni Signed-off-by: Luca Ceresoli --- Documentation/sound/soc/dapm.rst | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Documentation/sound/soc/dapm.rst b/Documentation/sound/soc/dapm.rst index da9313e10fd4..574667f3aabe 100644 --- a/Documentation/sound/soc/dapm.rst +++ b/Documentation/sound/soc/dapm.rst @@ -405,13 +405,16 @@ See soc-dapm.h for all other widgets that support events. Event types ----------- -The following event types are supported by event widgets. -:: +The following event types are supported by event widgets:: /* dapm event types */ - #define SND_SOC_DAPM_PRE_PMU 0x1 /* before widget power up */ - #define SND_SOC_DAPM_POST_PMU 0x2 /* after widget power up */ - #define SND_SOC_DAPM_PRE_PMD 0x4 /* before widget power down */ - #define SND_SOC_DAPM_POST_PMD 0x8 /* after widget power down */ - #define SND_SOC_DAPM_PRE_REG 0x10 /* before audio path setup */ - #define SND_SOC_DAPM_POST_REG 0x20 /* after audio path setup */ + #define SND_SOC_DAPM_PRE_PMU 0x1 /* before widget power up */ + #define SND_SOC_DAPM_POST_PMU 0x2 /* after widget power up */ + #define SND_SOC_DAPM_PRE_PMD 0x4 /* before widget power down */ + #define SND_SOC_DAPM_POST_PMD 0x8 /* after widget power down */ + #define SND_SOC_DAPM_PRE_REG 0x10 /* before audio path setup */ + #define SND_SOC_DAPM_POST_REG 0x20 /* after audio path setup */ + #define SND_SOC_DAPM_WILL_PMU 0x40 /* called at start of sequence */ + #define SND_SOC_DAPM_WILL_PMD 0x80 /* called at start of sequence */ + #define SND_SOC_DAPM_PRE_POST_PMD (SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD) + #define SND_SOC_DAPM_PRE_POST_PMU (SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU)