Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1863318lqp; Mon, 15 Apr 2024 22:59:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXKqZKBgwXbGI8Jm4nDPfE4qQ0rtTKzwix1O07zkwWdSa6VxbW61k9YW9aum7/nAhxtMTnztOUqEkE6JcCecNKXVOHFTdALZ39DbwdeMA== X-Google-Smtp-Source: AGHT+IE4Bb49azG1vDQkzTPrBuYM1zWKcOAb2vDr6mGBvSixcpL+7lFl1cN89aS6vrWNPNTeSsKJ X-Received: by 2002:a05:6808:a0a:b0:3c5:ed16:c0fc with SMTP id n10-20020a0568080a0a00b003c5ed16c0fcmr12091569oij.52.1713247155599; Mon, 15 Apr 2024 22:59:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713247155; cv=pass; d=google.com; s=arc-20160816; b=kMG6KwdLOZG5L0VldkVmjeixLL0sGwZbZHju/7t7XKjsXxeeAd78a3xuL/uwbczUVw OTOXoyMoYFhfBkDEmsLGTlk7S33n3rMpDf7LbA5fvGV3tPLYOPLtWYNnaY3OCZO5mYnS pljSToxwRjUkIqdMtUykB35DgocmUMsbLwQ9MMQX+OQfodrugH5cXwatfswISHZTqCEY jjjU0GoDTx9wV370219OTEGLVWXgFHN9Q4RHX8iWfll/yB7mFrGNEytI0p/7zmd4Yhc8 OIsFA1GwAWEV9oLAF3xD/winaCHXuKUYNSpnm8Dae3jezVHVcyjMo3fH/xubgaARv4E0 XCQQ== 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=Abaex5aksLB1anO0DJAYWX8f1sHqRSGhAgoBmASUQT8=; fh=RpUkPCO1yB9SrvCZK9/H1csNKJkfhSEm0lTOtlRGhag=; b=gQAzsV0wLLUmv8aZ9SY6byZv/jZnJW88NM+4BibE9ZnNXkf6x3B4pW4C+3pQG9cjIE aboVsk5+Tfu5O7lDr1dgsXme+htFB9sEsnDTYkcs1QbPJsW4LLENbjzlkN7QB3yoBz7S jjTZIOrppv/tCmj9AOl8+jLv1UnF5JNaf2e0TKVndelTtLP2UO7S4zF1iciv9NT44m6z +LZx9nvWlDasKGcoKuIk/YmX/8dd4pmQ7FFFmUA0FsiEGtee2cIuure6Tv8bQq01i3hc jGMN+jRxyZDW/WBBp+kCpE3FTRwwG4NcgV7fYPFe2QdNABE/C+rRALr9FZM0e80lwl7Y 8D3w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="kTgvdK/P"; 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-146299-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146299-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. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id t20-20020a639554000000b005e3cdf125easi9023496pgn.612.2024.04.15.22.59.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 22:59:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-146299-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="kTgvdK/P"; 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-146299-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146299-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 14B6DB23E4B for ; Tue, 16 Apr 2024 05:58:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2C8B740849; Tue, 16 Apr 2024 05:56:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="kTgvdK/P" 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 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-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: <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 --- 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 ============ -- 2.34.1