Received: by 2002:ab2:1c04:0:b0:1f7:53ba:1ebe with SMTP id f4csp112132lqg; Fri, 26 Apr 2024 10:06:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWPR/4Wfbj2E3mgW9lAtMFUpzR1dFuXZ4Yftt3+kfflLAXxJ/gEnFhJYrE9IAY2q2TG5Gly3RnyiyEpHF9LtItI9YymIszOsp/GCArhcg== X-Google-Smtp-Source: AGHT+IGv4MwAL/iofS7vGHHI5kYCEsj9njl6R08s1NP9cCdViT2kKNX0HForKDSGRHWOAKj3tZaR X-Received: by 2002:a05:6a21:920d:b0:1a9:11e5:2915 with SMTP id tl13-20020a056a21920d00b001a911e52915mr5490390pzb.27.1714151182467; Fri, 26 Apr 2024 10:06:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714151182; cv=pass; d=google.com; s=arc-20160816; b=MWbN/i1ZG/yBsOs3WZK1HEyAeYzr+tlkbNnBlLR4zJSg04Zn/1hel23UXK+RHpWd47 7l8zoBLVils80gt1YNAJUreaP55rknz7/h0gXu8uB05ihloTA0hS2KHVB3Z7ipw/pOPL RkTrTCnDZksZe4fmpc8hbJump69QM8j/6a5/m810jfxoIPKPyFicQCfDFoTLV0q4CjTx BRPP87dhlqAGaEwk5R/oIWgklSZdsrcwxi1QF8WJtL2G1z7HK5/y4hjEbNoGnuB4cBkF 9vQg+EGG5TQlY5zwI5y4pwEsDeoG1n6W4BZ0xAjf2hkitRvOffyCWxqwdKxZY0Cfv5hj fNyg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=05gZeJQSHsZrIshFB3NI1Um+lR28IX40e/lD/576N3k=; fh=nltZftsxQXuWoLpedj6X+btMoFrrKx13QYCe+HaZVzI=; b=GPyeQEIyFlBfhv89Pz/pUGBZZ8i4qdddFeHedbaDVJGGLlOKLSAbs4QB+cE6SWqTio n4VeAW5bCP/eAWsp6rH00Bs+95DQKMiUyL9/jfIhuZ1lyhQdJomwujlXaprF7LMmNR05 x9+ND8HMLKxGOoPqPubAef4S/qmCdKRwAdBPA95QxIajYiAfvvmxJ511sE1I5OULWhDi 2hU9s6sj/6EvbtMvly3TUewvfVRMyf4tcsuYkwJaaFP/VfGpRpFhGANJ2zByYlNMz5m5 xQ3sCiiXCWlSoLiRIKz6BNtSnXfSAM2lmvHB96ud4m6fM4keFdFafBmitX8HsjwhPYPg 4Y4Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=KLBjqaDD; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-160424-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160424-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id fb9-20020a056a002d8900b006e6f6dd1735si15709198pfb.371.2024.04.26.10.06.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 10:06:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-160424-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=KLBjqaDD; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-160424-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160424-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 6E96EB24842 for ; Fri, 26 Apr 2024 16:58:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 113E516FF4E; Fri, 26 Apr 2024 16:56:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="KLBjqaDD" 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 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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 ============ -- 2.34.1