From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BDF79C43334 for ; Tue, 28 Jun 2022 02:20:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243499AbiF1CUD (ORCPT ); Mon, 27 Jun 2022 22:20:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243433AbiF1CTj (ORCPT ); Mon, 27 Jun 2022 22:19:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AD431B7A4; Mon, 27 Jun 2022 19:19:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BD690617C8; Tue, 28 Jun 2022 02:19:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85CD3C341CB; Tue, 28 Jun 2022 02:19:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656382777; bh=xsox+oAtcdAZJHzJsBu55rSS/MQ8PPD/eM3Wo9jAC4I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p2Z8eRsT1OsYqxc6lh/SV9hQ00Tp+RAClPJOHpB844e/ZT79JWXg42dGWvgGm6JUb abF4WcAytSr5ZkExwBi+GH2syLSZoB+rgTzG097bt4SnYuAJgh1nx395GGIly1reB1 LwmO5OVIOMQf9KEw4eYRRN9oMA13GvI5POTah8uX5WeIdZ0d8FJD4uSgBpO4SpZrHj mRxaxuND7Rz8vYzbP/o6n7VHe+6ezN6Ilf+dJwv4FdDZYxAGMb2UM/JUTO0FDAB24g qo3GDZd3Q7/RnMWLIgyToMDmgro7YHQgd2379kGChTqRkTL64F4WBhFnKS72DC4yQ6 1AW+czaUR5WyQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Pierre-Louis Bossart , Bard Liao , Kai Vehmanen , Ranjani Sridharan , Takashi Iwai , Sasha Levin , perex@perex.cz, tiwai@suse.com, gushengxian@yulong.com, jiasheng@iscas.ac.cn, nizhen@uniontech.com, alsa-devel@alsa-project.org Subject: [PATCH AUTOSEL 5.18 18/53] ALSA: x86: intel_hdmi_audio: enable pm_runtime and set autosuspend delay Date: Mon, 27 Jun 2022 22:18:04 -0400 Message-Id: <20220628021839.594423-18-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220628021839.594423-1-sashal@kernel.org> References: <20220628021839.594423-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pierre-Louis Bossart [ Upstream commit e87c65aeb46ca4f5b7dc08531200bcb8a426c62e ] 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 Link: https://lore.kernel.org/r/20220616222910.136854-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- 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 0d828e35b401..3b04c70a73e3 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.35.1