From patchwork Tue Apr 16 05:56:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 13631299 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (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 573B03BBE6; Tue, 16 Apr 2024 05:56:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.193 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713246988; cv=none; b=HDakRmmUAFsEXIAKgJBT+VpgyeMkoDnqdGRrLez1VKbZKIrReyWQVt0eq9sMCytM3uy7coVTZ8qeq70xHmMC4wBmCxGfnER8aKbDh3bBYazA/GcmrV8DqCZN3A86R1MsfGZ7Bumdm3evNrCNsIxD2036nzAj4LPfNNAQK0QYJG8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713246988; c=relaxed/simple; bh=+vFkaCXux8xbUp0bJJl+WstJMViKzoR2BQBfL9gJnDk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mXYwUB6z32dloi4Oid4cwV0scGxia9oJi8uPXLZcY91RM5aZs7+DKRcW+RS6m5QFitaiErNdS9PcjfbyZG4wsui5uqdAWmsUlvi3CpnYfY1j0HgkNsvEy5tcX0b9qNUSQYsQjSPhXOpUGCMaOaGBG4N7z6Jd19fe0SBTTXOso1I= 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=nDl7OTtD; arc=none smtp.client-ip=217.70.183.193 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="nDl7OTtD" Received: by mail.gandi.net (Postfix) with ESMTPSA id 4FB30240002; Tue, 16 Apr 2024 05:56:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1713246979; 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=KozsKZqPxFJ6j8vO37CaaASxd2O7CRf2GFzV36+uNwM=; b=nDl7OTtD7SScN0Kdi+kj+8JL7ReAshegQeVDEA1xDqdJywV0PNzzThKT67Q0dX8x+PQeYk Q5FOCxPNPiOcefn430KMfRr5UDibAUXB0zsd4ZXuHoVkop8kucJKybPwmcI73YJxHsOSZl zAh3Rl+MdmGH91dqltNC1mLwpeALAer9dJ3zUV/H2C3S8Nh42SjR9wsrNuP619ySHuVkSa qcxXmD4gmQtbUBVQrlqTHCbPW8Hvp3gAf5/TVplSXPPEBh6NtvPE784aq1DmSpDlCt3dEi /HmYy9LgKXP0BgBN9TcMSSW6PBfRDbkb9OhmSvZKke0eEV5um65bof2WaSmlBA== From: Luca Ceresoli Date: Tue, 16 Apr 2024 07:56:07 +0200 Subject: [PATCH 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: <20240416-dapm-docs-v1-1-a818d2819bf6@bootlin.com> References: <20240416-dapm-docs-v1-0-a818d2819bf6@bootlin.com> In-Reply-To: <20240416-dapm-docs-v1-0-a818d2819bf6@bootlin.com> To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Jonathan Corbet Cc: Alexandre Belloni , 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. Signed-off-by: Luca Ceresoli Reviewed-by: Bagas Sanjaya --- 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 Tue Apr 16 05:56:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 13631298 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (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 501FE3BB27; Tue, 16 Apr 2024 05:56:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.193 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713246987; cv=none; b=sx/dVpzGdV1AByGA1iHyNFlMCPo+Qr8a9ahZtiNf0Hi4JOcSY/eN1+7vMz/KBqP0lt8xI1m6tv4YU6m6RhWv0bJyFOexYngvfSPdeml3srnUnnSPa1n3JrMlgk+uEit1bYQg9L/KXQiUq+oHEIaD/s0yXg9J6JnXO5TvS6GT95A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713246987; c=relaxed/simple; bh=sIDZ37omvPJlr1EjoCNsy3gXk5EP2o3QL2zoRZT03vY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TnvYTU6RF8uCa0x/KCJ+exWiFZ1eGONdQh4ckbvbNTwtw2zqx+HETTx2zCCQb/uJ5rSN/W8UYnB1uYnGFC1Q225ZyQQJzY4eebp+rSpXpXGgHhl2ooogwjkbIUmeAibpJKmaRwX5P1+PCuAdQ0sFdeFmCgejsSbyjqFXoJK3urA= 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=kCdRT8w1; arc=none smtp.client-ip=217.70.183.193 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="kCdRT8w1" Received: by mail.gandi.net (Postfix) with ESMTPSA id 05E68240004; Tue, 16 Apr 2024 05:56:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1713246983; 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=SU60F/TtVpw5iTA/baQhbWO9BMLZGG+/I93Pm7TH4/w=; b=kCdRT8w1LfTfm22mtG7FCETZkPMVycuqCY4yymiPxXb0PIvzCXwy7pzZSOynySdoF6+Foh CcyjzsrEsCSQpBzkXEiw7OCtPIbArjbVP0EqtZBd8MvZ3NiT0wenTdwqeD7PT5EyJOZwer xvX9C3F8OQ5UT0lTFV7azmJiHk0qGv+lQ+iZ/KuSXLsahQtPyYdd32F1fjADEfT6dZVCf1 sW/h4z/fMlNpRQpICG2mIWehKf0jWcEyHlqWEiMDXgypd7zLzfnUJ/e/C4ZfxACtp7gT9D 9+KiGLiGiAO7pBC6yhmXUfm/+UN1FOr1hys/dUEloRKcv8X8h7obXX5lq0p9mg== From: Luca Ceresoli Date: Tue, 16 Apr 2024 07:56:08 +0200 Subject: [PATCH 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: <20240416-dapm-docs-v1-2-a818d2819bf6@bootlin.com> References: <20240416-dapm-docs-v1-0-a818d2819bf6@bootlin.com> In-Reply-To: <20240416-dapm-docs-v1-0-a818d2819bf6@bootlin.com> To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Jonathan Corbet Cc: Alexandre Belloni , 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. 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 Tue Apr 16 05:56:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 13631300 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (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 75C3043AC5; Tue, 16 Apr 2024 05:56:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.193 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713246992; cv=none; b=Go2zn7Hf2NkdaM+kqI6YCmC6dedYDZksMi+Bt8wkq5V0k3R6I/j6Dn/XBeecX8GrVN8FNqB0LgvuNpElpSH/CFnyfA053OkGrHvd0DXC5VG/l8Z5HXpLfx+rRWCqGW1pF7+o2NQL4vsfErsskVTZZSCetqjYxzClDHH6pTd/dac= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713246992; c=relaxed/simple; bh=o1+BbMEAnndRJzN+2AGSS8a1mhi8hNTsayce2MzKW0M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lwjVOc9O+w8RQgb/wF5SlPgRbpu7tFap2t+Zw+5g08Ke8lSxxviNkOXgDSBfR8SbHEzdME7JFxCd0+6fdOGTi+5a1QYnuP/wKREvN7EFasOiQgayOaKT9ZD7uS0668qTt4yxyfano7HgZ+kfpXW/aXoexdeaoiaRFCkPG8X7PeM= 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=RAB5hRuU; arc=none smtp.client-ip=217.70.183.193 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="RAB5hRuU" Received: by mail.gandi.net (Postfix) with ESMTPSA id 6CFB1240005; Tue, 16 Apr 2024 05:56:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1713246988; 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=xM8NmtQy3wO27koXzOqV907oXOLGnVKvQRVLtX2MIUk=; b=RAB5hRuUIhnf4B1Kg6AkW3Qb79F/NtYviknZrYUHCSJoELxAUCnsZ2OvAFn9j5r9d/xilp CgpoCPXJM7TOBbrlJNuFIhMJvH7hBXHL15Uk/ooxanIH4qI4sEaOyErQ6zjnyu+hCYiUvU PXAgUXxGV1DYfTGYsPwQkWJeIJqDHxD7u+ov8Ak8PROHjvbAGt4c590w/xHuOpK7jWFnhv bWz53xHN9xFYlXY6afwfD3Fy3vpZY/mNcycxV237TXuItZuPgJlOhxXAfWZy7foTbc5FxE +ENl6vhT3lsCGN8FHW79V9DurC+hEhVfrQKrAH1IquMA3k2z5LHuXU/JbN8X/g== From: Luca Ceresoli Date: Tue, 16 Apr 2024 07:56:09 +0200 Subject: [PATCH 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: <20240416-dapm-docs-v1-3-a818d2819bf6@bootlin.com> References: <20240416-dapm-docs-v1-0-a818d2819bf6@bootlin.com> In-Reply-To: <20240416-dapm-docs-v1-0-a818d2819bf6@bootlin.com> To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Jonathan Corbet Cc: Alexandre Belloni , 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. Signed-off-by: Luca Ceresoli Reviewed-by: Bagas Sanjaya --- Documentation/sound/soc/dapm.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation/sound/soc/dapm.rst b/Documentation/sound/soc/dapm.rst index 68ef79f539f2..4dfa60519a76 100644 --- a/Documentation/sound/soc/dapm.rst +++ b/Documentation/sound/soc/dapm.rst @@ -5,10 +5,10 @@ Dynamic Audio Power Management for Portable Devices 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. +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 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 Tue Apr 16 05:56:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 13631301 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (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 87CF043AC5; Tue, 16 Apr 2024 05:56:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.193 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713246997; cv=none; b=QosHWqcJAnnHKD7eCzyjTLH45b6Ylw5ev+AN+xoh5I2/JfuRNPiFGPFCJsQZjEV/24kkVbIjVRAUISYlMavwGO5C02dgjMV+Un3vuczuQ+eaDrueLabHjRIPfr11ke7e1cJLKZ+c3E6y1LdEXayP/A8hVCfWkabxIO16QAblr84= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713246997; c=relaxed/simple; bh=7ZjW2KJGMgthacCzmck+UsU4PwyYoeHyxRSrQibBUH8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZGxqpODmO33M4kj2saHPpAsmt2l+Zk7NiOzYegdgig0Nb+2NRNtCZxVqQMjpJroTRt01E5DNyYphYgM/1JEs3jsNzuh7O7DrDAxFeb7QuvmWHSTw2xDxVc5LvwYbaRX/4JnHTtWNgCSpp8D6WP/MXjzKP8leFhyw9eZ2nhdK0Ko= 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=EbpO9AWa; arc=none smtp.client-ip=217.70.183.193 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="EbpO9AWa" Received: by mail.gandi.net (Postfix) with ESMTPSA id A498C240002; Tue, 16 Apr 2024 05:56:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1713246994; 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=6zQrjhE+ysI5UolYk4pQvlwu+OCbM1GWYYOSbnnp/xU=; b=EbpO9AWa2pPcu0DQI3GEe9ItG8QCwPF7KqyZXtMQ8a4XAySjx5nS2ygYlFQ4CpYXhAnrE9 Yf108b4hvIAXfI/XbIJ8D7MO/W8UfP8fu031Sc4/+T2TpjcEvrUZTP8akSmsm1YGzGUaQc dSSIxrX2dCE7qrJl/iXB9xgxKtDyBbJCw3o38Am3y7cmJQ/ps+RUMTNe4Oqvd+TRw4SQx/ +IPeb8zvb+6gdn22n5NKIqYwWIjOOlG0fkjBN2YM5uvtrkYuICz2s8ChhxlR+TjlOPKRVl IiwoTOvvANlyXmh0d7d5p2sb9YmJw+wXz+7lz5ieb8jvsEfMMFh7AS47y08jHA== From: Luca Ceresoli Date: Tue, 16 Apr 2024 07:56:10 +0200 Subject: [PATCH 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: <20240416-dapm-docs-v1-4-a818d2819bf6@bootlin.com> References: <20240416-dapm-docs-v1-0-a818d2819bf6@bootlin.com> In-Reply-To: <20240416-dapm-docs-v1-0-a818d2819bf6@bootlin.com> To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Jonathan Corbet Cc: Alexandre Belloni , 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. 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 4dfa60519a76..e3b399201622 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 Tue Apr 16 05:56:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 13631302 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (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 6D3065BACB; Tue, 16 Apr 2024 05:56:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.193 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713247002; cv=none; b=fIFBdZ2hUwD5z904/LQeoQYID4zEPKIG3m8tkHVjcFozfqw3gOa4TssZI67YZOfcr12VfHq5xLbC74wDLpC/X3+Uzf5CdkXEO6ECDVLkrEId+Qmybx6bWJi+lK5lCEgCu+BXD3Bd62y+O7nD5xg3zyLt+otFy8bsBGjgTV/JShY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713247002; c=relaxed/simple; bh=/q9wubkivGEbctuzAxXEJE9bOlNQjNL2qpWg+Go76xY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oS0nUYsTHoPHaXOCQ9k4FARw5FvBun4vt5QItIm8h8K7QDKi+whFWD8jyeyFRZHeN9Q1C0DnhUvrJYzhUdZd8InmmHGcfFUeoaJoBx64ZxpI2oPKH9FlyPeH8sUEEG6V/s4UUikfU5623aNP0ynA137DaZgnV4/U4nUEIVcR4nY= 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=grZHN6ot; arc=none smtp.client-ip=217.70.183.193 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="grZHN6ot" Received: by mail.gandi.net (Postfix) with ESMTPSA id BF71D240008; Tue, 16 Apr 2024 05:56:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1713246999; 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=p1gKTZTbM5i3YvX9k1E5G0MG67ZU6ZM1oZhyfUs3KBw=; b=grZHN6otZdV8BZ2w2M9XxruzuXiGs8WriPq9tTCjr2I1vdJA1K0sYa85xkF3tA84pc2HdS QbzsVQ+NOi0ardeCRxbmqHnNA7WHkWqr+1KmVxsAkTz8AaYBJgL+QVKZYJgi6n4VXb7rHl vs2cGfCd7yo6Z6EHULsEoFRpXgGgDGdqHOCA8vh+j/A/CJe/0Yn9X6VMsnwT2XpyphSc6D Vzzd882SIXLOGeFZ0sOjAxpagCjbi8vAkCDDGjrPiECnLlk9dsLC536R+Jp1RcdYEDHhDG 6OQLNy365ivTXAhJ8z08g4jrYFvALOWJVT4OjfcXrTrE7I+IDl9AP5hUH/A+8w== From: Luca Ceresoli Date: Tue, 16 Apr 2024 07:56:11 +0200 Subject: [PATCH 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: <20240416-dapm-docs-v1-5-a818d2819bf6@bootlin.com> References: <20240416-dapm-docs-v1-0-a818d2819bf6@bootlin.com> In-Reply-To: <20240416-dapm-docs-v1-0-a818d2819bf6@bootlin.com> To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Jonathan Corbet Cc: Alexandre Belloni , 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. Signed-off-by: Luca Ceresoli Reviewed-by: Bagas Sanjaya --- 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 e3b399201622..4200bcf18fcd 100644 --- a/Documentation/sound/soc/dapm.rst +++ b/Documentation/sound/soc/dapm.rst @@ -11,9 +11,10 @@ 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 Tue Apr 16 05:56:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 13631303 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (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 8F4623D0AD; Tue, 16 Apr 2024 05:56:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.193 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713247007; cv=none; b=TQc9Q3uxEOrYVqA+Vc3wuxq84oLiXeeY52RlA7j5NF5QSfIF024xv2T56R2THUbnB7kfyxyjyoEbesokxyjwqW6nST8s48yUXb2oa+LvSX2441oVj855VmS1RmHFsAOLjz+cES9nzoreVav/zlmv75+10DIpLwHwSBPHOzgxHOM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713247007; c=relaxed/simple; bh=NzF9WSm5hjJeV8VjR/dtbCVCV5aw4bi9iF0cHO7hxl4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HD17yPKhzsgjU4n9AtH6hEqoUe8/JcaxTtxkIaGlxALo1drm0HYfb8Hjy5pBrq4q7wMb4aORYhlIcaZladV/Jj7iVPofFo6/8ncOg5be7AN71RxNgBLcbb9B23tlYcvCyKzRg8HcJdXKg1C3VNKFCQKsAly7bCs0CZkreuYDpCw= 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=HlNqpEe1; arc=none smtp.client-ip=217.70.183.193 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="HlNqpEe1" Received: by mail.gandi.net (Postfix) with ESMTPSA id DFA8F240005; Tue, 16 Apr 2024 05:56:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1713247004; 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=kTeg2Oy81IFfigKGZfw4tgkhOc4F2FX2VCyGvP0yTvA=; b=HlNqpEe1v55AmdcpuA3VCelMAXy+zU4JujAIXBjjidaCB+1Ck2rzllzaqWUNRcCa66+xea x4g7m3SAhYoVoG9j7FGDzO42NZMyBMxFDjZrfmIsZym/p2LfBcHP8VzsDkiEq76hA7BeVC AOuOgoohJSIIUhkg14tkUC5uJdam7ZbVp0+5Zu0gZAatEOBxWFI0A0SRKSkZK9+Vu58t2+ eJAT7DU7ff05nQ+zcsBx0Jpwdmg4ABRhG3m5OIQnjLSkVYwR8md546JpPTsxvDMhwarNqw n0R2GXr1Weh08oxCsdSB9RsEjm4gsMB2OiJoLtq0oOtw4JRkIysnKZvMgFBpSg== From: Luca Ceresoli Date: Tue, 16 Apr 2024 07:56:12 +0200 Subject: [PATCH 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: <20240416-dapm-docs-v1-6-a818d2819bf6@bootlin.com> References: <20240416-dapm-docs-v1-0-a818d2819bf6@bootlin.com> In-Reply-To: <20240416-dapm-docs-v1-0-a818d2819bf6@bootlin.com> To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Jonathan Corbet Cc: Alexandre Belloni , 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". 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 4200bcf18fcd..cab40a6b4c96 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 Tue Apr 16 05:56:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 13631304 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (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 3F8503D0AD; Tue, 16 Apr 2024 05:56:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.193 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713247014; cv=none; b=XwnUfj5t+GGDoptp0wweW/xD5dOQdtdIPIjxv1yLwWcfZ1fM6kNAobU41I7XsjS3n3v9nocyxam0EmvnTxjRV61jIhY5FYbQaAIpY6yU2vy2VNYC8HeYevFXa9mZNGAmWmmnuBCEAErTp89mXDE6L1CZSah+EkfCBjUJ05Au0m8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713247014; c=relaxed/simple; bh=QSttxf2tdQ8YO22IswUuFFPjaAZvLWVVjPYsQMuF3DQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=EN7MStxhDxQMw0jmBQiE6euz+ZcyiQzVHnt4aBMgJmbCxOYSbjbIo6MHBBME72Jk3tn0Y6dxtlFPFkGrPUgO2JXLpfC0betDoUp61OP0K4LLdFQlu/L7AD4iPeMfFnmp/xras3uM4LKL+fsSD9KSJrUo5SaDRR3EN1xeLx2lyQA= 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=kTgvdK/P; arc=none smtp.client-ip=217.70.183.193 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="kTgvdK/P" Received: by mail.gandi.net (Postfix) with ESMTPSA id 053BB24000A; Tue, 16 Apr 2024 05:56:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1713247009; 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=Abaex5aksLB1anO0DJAYWX8f1sHqRSGhAgoBmASUQT8=; b=kTgvdK/P72DnqbMQcPPVZ4IDlJ136cKuA6OL2zq1ej3PAIfZ3kawf/L6W+nfxhpmbqRSvC mF5BpNcBbMws/b0F5VxLrATwEs6wQIRSnxEzq8HJaS2bkZDBJJr6PlDy769ZmoJ+myI3iQ MsXAjAeGvi1qYuVT/0GG5mfwIam+IdDeR2OaoQfOqE8i+wRJo4q+RC2d4KjxhUZs0nzQUW 7jB0Pk9H8bBDHRV5mMzSFbNmZszfKVJ/is3plE2mC2myMGLiPA7Stzgc1+Dk7licWAQu5h 4OjZ7ncD2vLZrGhXo2aQOmrh40+7hXHlNdJeeKjl0LaIuQFqTy8I0wGQ/J6Tlw== From: Luca Ceresoli Date: Tue, 16 Apr 2024 07:56:13 +0200 Subject: [PATCH 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: <20240416-dapm-docs-v1-7-a818d2819bf6@bootlin.com> References: <20240416-dapm-docs-v1-0-a818d2819bf6@bootlin.com> In-Reply-To: <20240416-dapm-docs-v1-0-a818d2819bf6@bootlin.com> To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Jonathan Corbet Cc: Alexandre Belloni , 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. Signed-off-by: Luca Ceresoli Reviewed-by: Bagas Sanjaya --- 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 cab40a6b4c96..3a2fde1d31bf 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 Tue Apr 16 05:56:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 13631305 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (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 34EA84084C; Tue, 16 Apr 2024 05:56:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.193 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713247018; cv=none; b=QCGjz1L8sDq+1q4OOaWzXwV4+qa74la/S0yfWZ1W9i9BYRCOfR/S3pNH66M9vKhjJV+UFGGhy4EuzrCK0pMBoiNE6YfXEnXNWKcTO9VnJgsZmz3B7FX6pFPIumlwu1mpjbu9OMf+SqyNda6WDnE84zIkx7rNrMkknA7pSzcd/Tw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713247018; c=relaxed/simple; bh=L4Q8h5qQWx5dAIva59g5Es5n92kkIF6x/3ausbyFZko=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CgUS40SN1SIh4qwfGS+TX8zvlc4+kcvk5HPL5hTrzgEG0lokbJ/oIWqB32O5JAMHbQgjCr214+mdqYHozrvM7FS+Vj2I2V+gfRzCp6a85bM/mHASZsNN7vOoo+1DVB8Ug7Vj3xVLy5XSabSIkphSbiAK9tcY1Vms32MKN8+irGU= 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=iLYz7/9Z; arc=none smtp.client-ip=217.70.183.193 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="iLYz7/9Z" Received: by mail.gandi.net (Postfix) with ESMTPSA id 6C331240002; Tue, 16 Apr 2024 05:56:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1713247014; 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=d+odmWYEPbcdsslwrc46eJVEfN2ipmnpIcCgFwF/F7w=; b=iLYz7/9ZMvkCIMM2/BvfJiic6TwvoeyW5nuMh1JFFsjoL3KJyP/yAep3On8eLo3npWV0ar nsdV8tG4Q9bzKBeN6LlbfyaMpM6qwZGMq9oVOXu1ZxK/q8TrrCebmRDioL/n3QgttsUCDm h5YLKoPwpoEzWUhGdjihTT4F7q7XxBre+ST+qM8gueuyqHRx7DMKLg1VYIjzND/pS2Vtof PdUbjEuGyR5sjSZywQ4CYQSWKtWZV6DTzASbDU9YkkLaAu9jp9VVVHhwU7pVsJVze41oLz o0alzmfKMXovN1wiLR0ttIrY5QyJh1/ihdkcPflXWDfvjVnN9EFp27R4hy3C/Q== From: Luca Ceresoli Date: Tue, 16 Apr 2024 07:56:14 +0200 Subject: [PATCH 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: <20240416-dapm-docs-v1-8-a818d2819bf6@bootlin.com> References: <20240416-dapm-docs-v1-0-a818d2819bf6@bootlin.com> In-Reply-To: <20240416-dapm-docs-v1-0-a818d2819bf6@bootlin.com> To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Jonathan Corbet Cc: Alexandre Belloni , 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. Signed-off-by: Luca Ceresoli Reviewed-by: Bagas Sanjaya --- 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 3a2fde1d31bf..3aca913c99fc 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 Tue Apr 16 05:56:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 13631306 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (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 5BEC26DCE8; Tue, 16 Apr 2024 05:57:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.193 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713247023; cv=none; b=fKC9ZOOM3mv7/AD4+tvejjtieeZrhEJdR1wSMgqOIL7sFTcdh7JouuWut4Qx+0aurJlTkykhAXOfpicmWLE0a3pfM3h5Wf7h6QuG0o6FG4og2eSzM1BAvM4UxREDQPIO0nKjXCRlj/I9r/xTLe27Q3D/QPgu/BqaAGmcPNO+jGU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713247023; c=relaxed/simple; bh=E4bs6D2WzBCW42I+wQm2fzSFtQ625oFSJYrPB7We/yw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZwqpKvjaQBPx60so+I/BVfGG9gobswm7mjXiW55rfzPXtn54iayTtp9wKHUPSjYZSCrb8r3y5/LenUW/BxuyvMUyMHiRHyMTLvoaaJNVbPtdVTCFt2PECWcqs8c7QJpe26VWxB+w4YmNPEokZJ7LdiLFIggEP3G9sruCbubdoqY= 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=NFsDFNyM; arc=none smtp.client-ip=217.70.183.193 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="NFsDFNyM" Received: by mail.gandi.net (Postfix) with ESMTPSA id 90430240004; Tue, 16 Apr 2024 05:56:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1713247020; 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=qLJKrvNE+JVwjBwnhmV7Me6gL52MTFx+b3V59KJSZ7c=; b=NFsDFNyMIBFnu/LnirCOKyLbxq9OfcXkRUU6aTiloDL/laEzbVEAsBVYKNXoc5/IIROO6I nbsDxyOo4IrQbO6J5F7v6v0wT3uWm0M/3yCM2t/KrKVEyqh3A7Vg7tKO0UdUFUvoDXF2QM uc86okzR4E4x6T4KNjsmu8T0s6t5KK8ldfy+bW8b0djxIMVQjHouB4Wpgv7RBrU2ugAhIL UqvASR+ZbRQPtQUEWCDE0qwrsTQSq67nYxOcHbWLr6JqrVAek7R3H7LstxC+r8y/wCcLeg SIDwX9eML5OT5jhLdAraC93EMwrvnvZaSkqHoCMeDMtwHA3Id0fc9tJrmjj+zw== From: Luca Ceresoli Date: Tue, 16 Apr 2024 07:56:15 +0200 Subject: [PATCH 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: <20240416-dapm-docs-v1-9-a818d2819bf6@bootlin.com> References: <20240416-dapm-docs-v1-0-a818d2819bf6@bootlin.com> In-Reply-To: <20240416-dapm-docs-v1-0-a818d2819bf6@bootlin.com> To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Jonathan Corbet Cc: Alexandre Belloni , 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". Signed-off-by: Luca Ceresoli Reviewed-by: Bagas Sanjaya --- 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 3aca913c99fc..ab7d48582cf7 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 Tue Apr 16 05:56:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 13631307 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (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 519806EB40; Tue, 16 Apr 2024 05:57:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.193 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713247028; cv=none; b=JGaMecHgiFU/HzmoT5Aur58hU7+Miv7otq9NeYragZNDZ8LYfRMQ063FvyAClcYq2iqbFhVEwqDWK6g44wtsgqE0pvm67ljo2bcKFZkRlzlM6NCo42rop8YCavO4+LLIR8zYKeKGjNd7aaIr5d7B3DCUGsIZnGe6sXrY5CFo/hc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713247028; c=relaxed/simple; bh=W8ieXiaD2grKULBZH7ePr2myf5pDYSuRFVZ/zf5MH6A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=q/OaxgkTnF95xMBNkw/0XMctc0Gw+7Z56SocQu7oItpPuYCHw0Q9ljvnDKoaJokZvL5vDk5Kt4lqH1qjITsxm/2cSyuMJjUnT4+ZBJ2STx6ZQJn/FLIwc/vpP3kYKKo8dxHAlcMyXitz9rSHE5hoMYY8+5qeU9MzCwt05paAJl0= 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=dwr5zFGc; arc=none smtp.client-ip=217.70.183.193 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="dwr5zFGc" Received: by mail.gandi.net (Postfix) with ESMTPSA id C043F240002; Tue, 16 Apr 2024 05:57:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1713247024; 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=zT3Lgqr0SCMtCE+J3QwZUIXvFEw2cInrlnSEqndvvJQ=; b=dwr5zFGcBS4gT+fOWoysA7oZgILPzpnWccGCOPfIXFpfKbPeWI9eciGTnzXy3hA07G9+jm Z2K+ys9ma9v2iY94IKMRnc0eamYxWJD/MDBbO6wbcMMA1Ajv+NhKu7mC9rlOyGdAzf8G2s qRpRWM+4ZioG02byZPwYlQzrA73y4rcaX3skuK7Bz67SO12A1czPYDlI3KvGt8rbhIW7ja RX8QtX2u0VwRDCItxDsLxg1Yg2Slfh8dWuVM65Sl4+lVP7XVOW2LLF/VHdcvJ44CY1oRxb gcqueTpKxDcANYRgJ1nWxuYZTEqVrC1Bxsn+RQbDFJSKMBZLXe8tGzeHG3twWQ== From: Luca Ceresoli Date: Tue, 16 Apr 2024 07:56:16 +0200 Subject: [PATCH 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: <20240416-dapm-docs-v1-10-a818d2819bf6@bootlin.com> References: <20240416-dapm-docs-v1-0-a818d2819bf6@bootlin.com> In-Reply-To: <20240416-dapm-docs-v1-0-a818d2819bf6@bootlin.com> To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Jonathan Corbet Cc: Alexandre Belloni , 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). 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 ab7d48582cf7..5b370daed499 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 Tue Apr 16 05:56:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 13631308 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (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 0DBD63BB30; Tue, 16 Apr 2024 05:57:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.193 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713247032; cv=none; b=r2CtdZ3OBf6/52XHPZS71LP6pJfARFEF5tctgDfK000mNFd17HfIjG06U2yzcl1BL8g48nY6R4ylJMcBMlc0MHv/rkCwae/fPqZf2haQPV0fX3EtrT3YxIOD8Nz4Q1NBgrJOQIsj4IKJgQ1VfIwwL6xQ6yjXy4T6nlg8U9e5XmY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713247032; c=relaxed/simple; bh=qy57PegXWwkF2OifUn6/ndmkGcmkMysm1NDH1Ak9Umg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=h7cTTeyH/SZc3GqxqwnhVygyVu4w4Np4h/YuXfVlJwBeFvKXAtQs8X64cKGaTQUgWhG01EcQqTALKX2XHfqcnEjkGSh3gpPUoWp+CXClS0hRtcDqXPInSqK+WWWMX7efRaRTDY3tOYfHC1wXIZEZMeLOezgkVn7F8wdJPDXH8mY= 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=CaXF5lPZ; arc=none smtp.client-ip=217.70.183.193 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="CaXF5lPZ" Received: by mail.gandi.net (Postfix) with ESMTPSA id 81AE3240004; Tue, 16 Apr 2024 05:57:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1713247029; 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=SgZ6ZmxXz+RjUHsnpzM+2vkjxQTQsCHjp6Cpzx/OORg=; b=CaXF5lPZYHdYVhvVPyuD8aMBOVAjsJWCaNcjtfseuSsEHF8wnIoUHLKDw7anH7UMkWLoLZ OHPgyZZBYRRq+LyrGLHr57ISdeR/SnY1eUJezQ2UEi9+yX0THsUxZk9Snp7JsMEslVUpOL dvciB5FgocZ+2+CPL8GLmYpOv/HOqNpfhibuxYA4q3LhvJ+GF44Q6z+z7VG/jaJue/eJsG YMob+z0WULtxzEwpz5tT+gN32QdVRUUKK/RQLcVrfbi/hcIcp9G5cjPF6wCwlVYTHzwidf UiBOl4OGbnDXfsDZ3dGADQML7fTAZaUhPnLly9etzJJrji6DoY+6XG9Yflm9JA== From: Luca Ceresoli Date: Tue, 16 Apr 2024 07:56:17 +0200 Subject: [PATCH 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: <20240416-dapm-docs-v1-11-a818d2819bf6@bootlin.com> References: <20240416-dapm-docs-v1-0-a818d2819bf6@bootlin.com> In-Reply-To: <20240416-dapm-docs-v1-0-a818d2819bf6@bootlin.com> To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Jonathan Corbet Cc: Alexandre Belloni , 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. 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 5b370daed499..75a85c9e33ff 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 Tue Apr 16 05:56:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 13631309 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (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 EB4C76F513; Tue, 16 Apr 2024 05:57:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.193 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713247037; cv=none; b=V+gWQBiTcKX9F95QE6UWL5INULpPfDkI6hRU90SQZAmFD9H1Bo7amP7yz6XNc/mMjWle5xglHxu8xHFta68pA60XEeTVxhShBb+VjtyXVqKq/e1jGwKVfvg86iv7PxgD2dtjysuq0O66XrQ9MePDAc+RmINpUiHYedFY6ZjJYqI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713247037; c=relaxed/simple; bh=BSiD45iHezRW5bA1OBXq4yRQdrMCdX7Kl7um3fjh6H8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qS/s+DhogQ0tNxDmmMuqV0yO+/3dKeYvwm2JLtXE+M9fW/hEFQCerDQ3ZTg8LibI0pM9rr0RlDQyHOcYC+rlT2wObQE1OdWtvGjl9I48Y2gwJQQUIbF6+WJYgBkfFpSQDfxVjnZ1B00+GqP2ISLIxzbNYqlP79QA1TLt8mplTJc= 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=R6lMXlNH; arc=none smtp.client-ip=217.70.183.193 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="R6lMXlNH" Received: by mail.gandi.net (Postfix) with ESMTPSA id 25711240002; Tue, 16 Apr 2024 05:57:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1713247034; 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=A6kUCOTU/KHoNeSRP9VYf4bLvh0d1EyGbb//Y+6ttp4=; b=R6lMXlNHkx3gtA+mxyCTBUY7GsR81/Gr9OrY6Zk+YhszsFvXJ5qQP1FtxcnBY1ZtaWCzLU fchP7KAvj1Okp1UnqAFmcXvXXFZrSOyHCLVF/vnjUt1BsQjBy6VnVSxTDZYIvqc6SRQncD EBnveo4jzDuio7ldjDbs4aA8QOksxxxvQtZALjQrmhJls8MUKaQ0ux1See/Vnv63CLY2MV H2U3ayIqb9IAxIZsFHLLs6C5H7ZtUP54Kq6XW5QVGwRKkQeJY+uJuuP2yxE77In8Ngq9QI PJjnLD9gLQtbcXarPuIjb5tTVLG/C9GRIH45X44UTzwzoPE0Gfbq36w2h0BXMA== From: Luca Ceresoli Date: Tue, 16 Apr 2024 07:56:18 +0200 Subject: [PATCH 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: <20240416-dapm-docs-v1-12-a818d2819bf6@bootlin.com> References: <20240416-dapm-docs-v1-0-a818d2819bf6@bootlin.com> In-Reply-To: <20240416-dapm-docs-v1-0-a818d2819bf6@bootlin.com> To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Jonathan Corbet Cc: Alexandre Belloni , 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. 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 75a85c9e33ff..f76fc97dd162 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)