From patchwork Thu Apr 6 15:44:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 671923 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 5749CC7618D for ; Thu, 6 Apr 2023 15:47:01 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id CEDA8F04; Thu, 6 Apr 2023 17:46:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CEDA8F04 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1680796018; bh=+ysS7T7cxRO9HlMvDXWw2b6g8HzEPsfpnLPFd7YHjnM=; h=From:To:Subject:Date:CC:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=tMMhPWMkJ6IgqmI7Eou+nrR/oB6OY33xgaIdP4xc4QhRNTrkR/TWeDv61XTKOpoZj dre7/IGugm+V5ZfGHQe6Sdg2ayhq0Mw2sC54na12b1RGbMx7FG5TzuDBrkKv5wS78V CU+S4tQ+4wdE9CuUMKwsGVBJ3XiW8thgWb128Gc8= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 6A160F80246; Thu, 6 Apr 2023 17:45:46 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5F177F80246; Thu, 6 Apr 2023 17:45:39 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 0942BF8015B for ; Thu, 6 Apr 2023 17:45:26 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0942BF8015B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=VlIbEQmh DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680795929; x=1712331929; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=+ysS7T7cxRO9HlMvDXWw2b6g8HzEPsfpnLPFd7YHjnM=; b=VlIbEQmh6UrFH2lKJAnxvgdKZQ8VUIQZowhpII2ZzwYb5jl9W0IyavLi dgcOhSAWo/QndigmsnGfS3QojsQ/ifWRkThpmSnruKMoB8AGjNwElIp+/ vFw2/kksuUGV5RNK3S8eEXRft8T8P2Ud9IC94Y7e8amZeJXj0qkDagmuy 6SkGgsz9nXP4VbgA1kv/9iub/7HZXIVcm4tP8tCckNn8WNYRDfL3GxXvC 30LjWxYZI1SBOukE57ywpPEoH96VBSrB956oP1bpgj1npJOVgicThbFGL rdmf7uXkHpuPfxLm6J7j/L6Yy3J5Wn//omk9rUn//InTmXisNJKDfOAdu Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10672"; a="344527941" X-IronPort-AV: E=Sophos;i="5.98,323,1673942400"; d="scan'208";a="344527941" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Apr 2023 08:45:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10672"; a="1016910423" X-IronPort-AV: E=Sophos;i="5.98,323,1673942400"; d="scan'208";a="1016910423" Received: from iherna2-mobl4.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.209.83.247]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Apr 2023 08:45:04 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Subject: [PATCH] ASoC: SOF: Intel: MTL: conditionally wake WPIO1PG domain Date: Thu, 6 Apr 2023 10:44:54 -0500 Message-Id: <20230406154454.18163-1-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Message-ID-Hash: GSELP5BJF5STNGERWZKYQRFLPYTYHV6B X-Message-ID-Hash: GSELP5BJF5STNGERWZKYQRFLPYTYHV6B X-MailFrom: pierre-louis.bossart@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: tiwai@suse.de, broonie@kernel.org, Yong Zhi , Pierre-Louis Bossart , Ranjani Sridharan , =?utf-8?q?P=C3=A9ter?= =?utf-8?q?_Ujfalusi?= X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Yong Zhi Wake IO1 from power gating if there is SoundWire enabled link discovered by ACPI scan. Signed-off-by: Yong Zhi Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi --- sound/soc/sof/intel/mtl.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sound/soc/sof/intel/mtl.c b/sound/soc/sof/intel/mtl.c index 58959c24cb71..882ce5536ab6 100644 --- a/sound/soc/sof/intel/mtl.c +++ b/sound/soc/sof/intel/mtl.c @@ -217,6 +217,7 @@ static int mtl_enable_interrupts(struct snd_sof_dev *sdev, bool enable) /* pre fw run operations */ static int mtl_dsp_pre_fw_run(struct snd_sof_dev *sdev) { + struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata; u32 dsphfpwrsts; u32 dsphfdsscs; u32 cpa; @@ -255,9 +256,11 @@ static int mtl_dsp_pre_fw_run(struct snd_sof_dev *sdev) if (ret < 0) dev_err(sdev->dev, "failed to power up gated DSP domain\n"); - /* make sure SoundWire is not power-gated */ - snd_sof_dsp_update_bits(sdev, HDA_DSP_BAR, MTL_HFPWRCTL, - MTL_HfPWRCTL_WPIOXPG(1), MTL_HfPWRCTL_WPIOXPG(1)); + /* if SoundWire is used, make sure it is not power-gated */ + if (hdev->info.handle && hdev->info.link_mask > 0) + snd_sof_dsp_update_bits(sdev, HDA_DSP_BAR, MTL_HFPWRCTL, + MTL_HfPWRCTL_WPIOXPG(1), MTL_HfPWRCTL_WPIOXPG(1)); + return ret; }