From patchwork Wed Jul 18 12:27:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 142279 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp478310ljj; Wed, 18 Jul 2018 05:27:57 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdh3Ch6ZyguwdqR6u1sQ6h5NYUMBdvgZ2nTHWzv1H0wG5J0hxTg17a8bjJhLW1yZlNKY6hh X-Received: by 2002:a1c:5e08:: with SMTP id s8-v6mr1568157wmb.88.1531916877655; Wed, 18 Jul 2018 05:27:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531916877; cv=none; d=google.com; s=arc-20160816; b=jLSZBFTENLE5XVk1kFgn9UUIeQxTBsBpsj0NW0Mq0w/ih48zNTPwtPiSriIumvbAKh +atl6w44wF1VidpWQsJWTz04LPJRl1N2tlkzkcvolzx8uVcnx5Tfq3oNVgM2R8HIYHea QBiiryL1KNzRKfotYpExB/udNTrhEj/Biyak49dbVnQzh77NVMTOR9aYFYN0zbU/wdmq jSWPjptcoCM6zghVC7qCmXB0s5aBXC3og9V/PMZjPuq6RRdwXeFPfRRFSiwcIz1ZbowU RPp8e7K1TnMH7uYfuo/1ldeMTPCFAObFEAmxtv9fopAY93a9wc/C/ZkRqOX6tKO3okvm Koig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=QFuayNRdB7QPNkproiFSubDtq9X5e71gkubIYzQMAe8=; b=mBZYkSFJLfIK2aCVU9NnzlswGAcktNiAH+56nK+YpVOzAE9X2T85pDCBui6sDCwChg 5VsX531GdvLgeiRkb22r35apmlSNeyNaimsI1BP/+XKzDO6OM1to9aVCjq1fqDF0ECM4 QzS9mWvqo6Gt3pssxucgoERv5N+2Fvy1JqnCaAsd8cfYhAILyEy3GwPMh3mQUcJmOiR5 EA5486HOVDpwn+sTeNZmXvIGWmH51lQ+V17EUUNj+TFfZL8P3zI6vCimu/GrqbUS4++x xjjhicjqOIdzOFKv2N9G6ru/MUDCqqMzJ0HiD0uya8wkePC5lXyhKfymrI23FaGFgOWY P24A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=aK63eqZf; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from alsa0.perex.cz ([77.48.224.243]) by mx.google.com with ESMTP id x124-v6si1334845wmg.135.2018.07.18.05.27.57; Wed, 18 Jul 2018 05:27:57 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=aK63eqZf; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id F3D2D2677B9; Wed, 18 Jul 2018 14:27:21 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 722CA2677AC; Wed, 18 Jul 2018 14:27:20 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id 7027A2677B9 for ; Wed, 18 Jul 2018 14:27:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=JLjtZZP92dO3em38yCFA2xBivGzXNOrmijESNNqAlJI=; b=aK63eqZfEZYz ez3NqXYbenksSIdvGSjXbzzBCFe53qDuLVSWESzrgpTp1hk6LxIGbHRBkFLwyQbfcx7Y8uDnla83t cvjDpzV7zpYEWV6WyAdUiT8abfKN/Gfznr51cW4MvaTIJ/3kMzR2XrC9l6jC0OUaBakW+Nd9mfaMp GFP4s=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1fflXx-0003VN-6w; Wed, 18 Jul 2018 12:27:09 +0000 Received: from broonie by debutante with local (Exim 4.91) (envelope-from ) id 1fflXw-0007Hx-PQ; Wed, 18 Jul 2018 13:27:08 +0100 From: Mark Brown To: Sriram Periyasamy In-Reply-To: <1531735354-13352-1-git-send-email-sriramx.periyasamy@intel.com> Message-Id: Date: Wed, 18 Jul 2018 13:27:08 +0100 Cc: alsa-devel@alsa-project.org, Takashi Iwai , Liam Girdwood , Patches Audio , Mark Brown , Sanyog Kale Subject: [alsa-devel] Applied "ASoC: hdac_hdmi: Add documentation for power management" to the asoc tree X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org The patch ASoC: hdac_hdmi: Add documentation for power management has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From bf270262b7b8bb7b48a846c613f74e800abba392 Mon Sep 17 00:00:00 2001 From: Sriram Periyasamy Date: Mon, 16 Jul 2018 15:32:34 +0530 Subject: [PATCH] ASoC: hdac_hdmi: Add documentation for power management Add documentation for power management of HDAC HDMI codec device for various scenarios such as S0/S3, probe and playback use case. Signed-off-by: Sriram Periyasamy Signed-off-by: Sanyog Kale Signed-off-by: Mark Brown --- sound/soc/codecs/hdac_hdmi.c | 69 ++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) -- 2.18.0 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c index 84f7a7a36e4b..30ccc902e5cf 100644 --- a/sound/soc/codecs/hdac_hdmi.c +++ b/sound/soc/codecs/hdac_hdmi.c @@ -2103,6 +2103,75 @@ static int hdac_hdmi_dev_remove(struct hdac_ext_device *edev) } #ifdef CONFIG_PM +/* + * Power management sequences + * ========================== + * + * The following explains the PM handling of HDAC HDMI with its parent + * device SKL and display power usage + * + * Probe + * ----- + * In SKL probe, + * 1. skl_probe_work() powers up the display (refcount++ -> 1) + * 2. enumerates the codecs on the link + * 3. powers down the display (refcount-- -> 0) + * + * In HDAC HDMI probe, + * 1. hdac_hdmi_dev_probe() powers up the display (refcount++ -> 1) + * 2. probe the codec + * 3. put the HDAC HDMI device to runtime suspend + * 4. hdac_hdmi_runtime_suspend() powers down the display (refcount-- -> 0) + * + * Once children are runtime suspended, SKL device also goes to runtime + * suspend + * + * HDMI Playback + * ------------- + * Open HDMI device, + * 1. skl_runtime_resume() invoked + * 2. hdac_hdmi_runtime_resume() powers up the display (refcount++ -> 1) + * + * Close HDMI device, + * 1. hdac_hdmi_runtime_suspend() powers down the display (refcount-- -> 0) + * 2. skl_runtime_suspend() invoked + * + * S0/S3 Cycle with playback in progress + * ------------------------------------- + * When the device is opened for playback, the device is runtime active + * already and the display refcount is 1 as explained above. + * + * Entering to S3, + * 1. hdmi_codec_prepare() invoke the runtime resume of codec which just + * increments the PM runtime usage count of the codec since the device + * is in use already + * 2. skl_suspend() powers down the display (refcount-- -> 0) + * + * Wakeup from S3, + * 1. skl_resume() powers up the display (refcount++ -> 1) + * 2. hdmi_codec_complete() invokes the runtime suspend of codec which just + * decrements the PM runtime usage count of the codec since the device + * is in use already + * + * Once playback is stopped, the display refcount is set to 0 as explained + * above in the HDMI playback sequence. The PM handlings are designed in + * such way that to balance the refcount of display power when the codec + * device put to S3 while playback is going on. + * + * S0/S3 Cycle without playback in progress + * ---------------------------------------- + * Entering to S3, + * 1. hdmi_codec_prepare() invoke the runtime resume of codec + * 2. skl_runtime_resume() invoked + * 3. hdac_hdmi_runtime_resume() powers up the display (refcount++ -> 1) + * 4. skl_suspend() powers down the display (refcount-- -> 0) + * + * Wakeup from S3, + * 1. skl_resume() powers up the display (refcount++ -> 1) + * 2. hdmi_codec_complete() invokes the runtime suspend of codec + * 3. hdac_hdmi_runtime_suspend() powers down the display (refcount-- -> 0) + * 4. skl_runtime_suspend() invoked + */ static int hdac_hdmi_runtime_suspend(struct device *dev) { struct hdac_ext_device *edev = to_hda_ext_device(dev);