Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CAE4FC43334 for ; Thu, 16 Jun 2022 22:30:58 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D043B1B28; Fri, 17 Jun 2022 00:30:06 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D043B1B28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1655418656; bh=/o30uPX7cfuFdVcO42YIZa1I0rb3LMrU6x8Dm2DUHdk=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Pg/UbXK2idmeGWBkQRWYYgZvKWlzX33w+Pz36p+U8mm5dEgVh8qAaLInXQiVrAMH+ PZe5v4WXPtYuEyG5a4P9MOIgWr5GyhKnuaXXzuyjic86ov/yvZfROxVZCcY0J7y/rT SOlcDXjlfKzxvJZr/NrqDrMZoXA9a4XpFSPPnwvk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2E56BF80527; Fri, 17 Jun 2022 00:29:35 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A1F28F8051F; Fri, 17 Jun 2022 00:29:32 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id B5316F800F0 for ; Fri, 17 Jun 2022 00:29:23 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B5316F800F0 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ZEWIJAe/" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655418566; x=1686954566; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/o30uPX7cfuFdVcO42YIZa1I0rb3LMrU6x8Dm2DUHdk=; b=ZEWIJAe/TmEerpgbT5/H6SYcXrUXIHSY6Iv7F3pOi9So+cs2fq6Fj+88 pgFRX2Oi1U0w4GnLTVZPaYx6JFOpkCU1fvZzaY3BZMn4H0YNvmNSNo71A 3gy2uXol+XdtXW1p2LLTWWrXoelM+7N5i9t/oCUP/Jf5I6Op0mddhBKzi 2jqTA9QiSdzO4AePKc+0Px2vdhElKk/VOBhMMO5f5MH8/cZTZ+UlvVsTY LebcL4+KkR5YNRDVldTJEZfPbdBVQblDcGG4n4QpTEIk+P6sTbJ05aeSf 4/9RTinJc0dXQyGLgj8nx6YsvD3b7lDdAJktSsxt5N/gmZaSDVo8UiSKk g==; X-IronPort-AV: E=McAfee;i="6400,9594,10380"; a="365718819" X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="365718819" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 15:29:20 -0700 X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="653359637" Received: from buckkenx-mobl.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.212.52.70]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 15:29:19 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Subject: [PATCH 1/2] ALSA: x86: intel_hdmi_audio: enable pm_runtime and set autosuspend delay Date: Thu, 16 Jun 2022 17:29:09 -0500 Message-Id: <20220616222910.136854-2-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220616222910.136854-1-pierre-louis.bossart@linux.intel.com> References: <20220616222910.136854-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: Kai Vehmanen , tiwai@suse.de, Pierre-Louis Bossart , Ranjani Sridharan , Hans de Goede , broonie@kernel.org, Bard Liao X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The existing code uses pm_runtime_get_sync/put_autosuspend, but pm_runtime was not explicitly enabled. The autosuspend delay was not set either, the value is set to 5s since HDMI is rather painful to resume. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan --- sound/x86/intel_hdmi_audio.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sound/x86/intel_hdmi_audio.c b/sound/x86/intel_hdmi_audio.c index 0d828e35b4019..3b04c70a73e33 100644 --- a/sound/x86/intel_hdmi_audio.c +++ b/sound/x86/intel_hdmi_audio.c @@ -33,6 +33,8 @@ #include #include "intel_hdmi_audio.h" +#define INTEL_HDMI_AUDIO_SUSPEND_DELAY_MS 5000 + #define for_each_pipe(card_ctx, pipe) \ for ((pipe) = 0; (pipe) < (card_ctx)->num_pipes; (pipe)++) #define for_each_port(card_ctx, port) \ @@ -1802,8 +1804,11 @@ static int __hdmi_lpe_audio_probe(struct platform_device *pdev) pdata->notify_audio_lpe = notify_audio_lpe; spin_unlock_irq(&pdata->lpe_audio_slock); + pm_runtime_set_autosuspend_delay(&pdev->dev, INTEL_HDMI_AUDIO_SUSPEND_DELAY_MS); pm_runtime_use_autosuspend(&pdev->dev); + pm_runtime_enable(&pdev->dev); pm_runtime_mark_last_busy(&pdev->dev); + pm_runtime_idle(&pdev->dev); dev_dbg(&pdev->dev, "%s: handle pending notification\n", __func__); for_each_port(card_ctx, port) { -- 2.34.1