Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1306886ybl; Wed, 21 Aug 2019 13:19:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqzj/r8nuJVsQ/eXFXiYwqCJfKwvgwcmLPPhZyoFFhNXWWZgaGPCLyyPr5K/RdzJJ1KrMh+m X-Received: by 2002:a63:534d:: with SMTP id t13mr15534029pgl.313.1566418783678; Wed, 21 Aug 2019 13:19:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566418783; cv=none; d=google.com; s=arc-20160816; b=URkhWZ6TpU8c6YYFkB7IXK/9BGmsqxt14vY9aEKNFInK78zjWI31wbV5vw0xyYJq3x LxjWLrbL3fZ2cAOt9Lwvo8E7v5WFVkiUnWVRC6h/ouQBXbkb3XuAr58culFSlqqEaV6H 5oGAFXu0d8bXoCchXDJcxI4XWjhr80L+ZJ42BiYy5e14fEM3uGd1LX0Ug0yMy+ljZG3t 5Id2NlLLr2rE314XoD7+6jhVLppvRI72Q6Pv7ypqWLxBbj2cJZ8APmWF5cCuP9hi6gHw 7wbYC38/8c3K5K5mHPFcrH0ml5gVfUXqfNa5wJmVFNFhIiMULHc5j2JlX3szLPPsZyOS 0hyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=DRA0/XUh/0ifhxyDdKG3MWWO6V5cfpUIFcPAjPAiekc=; b=tfALuskjzgPL7LiBJhe5PWqsrMfyPbmH+IZFVkjm0wUs9Jlxn1T6LOtHeB/aM7A+HW 9yeBh2oxvig37mEXvblfiHu1s4r8RoPcOZT4XlgkswKu9gn7aUl2AgRydLpdWA5d4r7J VAM1troWhBkbjIrizlg9iggTKpGxTewX3mqmLJynYlqdeiwIUlAecrvDO3FNugMU9EbD vUneTlZolvYyP7+LgswOnlJS1SBBNYINbyzrv+s13ApbN4EnvVCAaByzPhXwilSn0W/S l2DwfwNIKMAwC+DlZnXbPX5lTxNJ/ZQ1nrZELmA7mA7Sghk/O8jymHguj2OYv4EdPo1U Jz6A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i189si14758084pge.253.2019.08.21.13.19.29; Wed, 21 Aug 2019 13:19:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730401AbfHUUSX (ORCPT + 99 others); Wed, 21 Aug 2019 16:18:23 -0400 Received: from mga05.intel.com ([192.55.52.43]:5759 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728986AbfHUUSW (ORCPT ); Wed, 21 Aug 2019 16:18:22 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Aug 2019 13:18:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,412,1559545200"; d="scan'208";a="186344260" Received: from smasango-mobl1.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.252.139.100]) by FMSMGA003.fm.intel.com with ESMTP; 21 Aug 2019 13:18:18 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Cc: linux-kernel@vger.kernel.org, tiwai@suse.de, broonie@kernel.org, vkoul@kernel.org, gregkh@linuxfoundation.org, jank@cadence.com, srinivas.kandagatla@linaro.org, slawomir.blauciak@intel.com, Bard liao , Rander Wang , Ranjani Sridharan , Pierre-Louis Bossart , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Zhu Yingjiang , Kai Vehmanen , YueHaibing , Arnd Bergmann , Guennadi Liakhovetski , Pan Xiuli , Fred Oh , Keyon Jie , Daniel Baluta Subject: [RFC PATCH 5/5] ASoC: SOF: Intel: add support for SoundWire suspend/resume Date: Wed, 21 Aug 2019 15:17:20 -0500 Message-Id: <20190821201720.17768-6-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821201720.17768-1-pierre-louis.bossart@linux.intel.com> References: <20190821201720.17768-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Somehow the core0 needs to be on to set-up the interrupts and power-up the SoundWire IP. Signed-off-by: Pierre-Louis Bossart --- sound/soc/sof/intel/hda-dsp.c | 11 +++++++++++ sound/soc/sof/intel/hda.c | 2 +- sound/soc/sof/intel/hda.h | 5 +++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/sound/soc/sof/intel/hda-dsp.c b/sound/soc/sof/intel/hda-dsp.c index fb55a3c5afd0..e1ade59ac6e1 100644 --- a/sound/soc/sof/intel/hda-dsp.c +++ b/sound/soc/sof/intel/hda-dsp.c @@ -374,6 +374,17 @@ static int hda_resume(struct snd_sof_dev *sdev, bool runtime_resume) hda_dsp_ctrl_ppcap_enable(sdev, true); hda_dsp_ctrl_ppcap_int_enable(sdev, true); +#if IS_ENABLED(CONFIG_SOUNDWIRE_INTEL) + /* need to power-up core before setting-up capabilities */ + ret = hda_dsp_core_power_up(sdev, HDA_DSP_CORE_MASK(0)); + if (ret < 0) { + dev_err(sdev->dev, "error: could not power-up DSP subsystem\n"); + return ret; + } + + hda_sdw_int_enable(sdev, true); +#endif + return 0; } diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c index 1e84ea9e6fce..09aa0cfa6099 100644 --- a/sound/soc/sof/intel/hda.c +++ b/sound/soc/sof/intel/hda.c @@ -39,7 +39,7 @@ #if IS_ENABLED(CONFIG_SOUNDWIRE_INTEL) -static void hda_sdw_int_enable(struct snd_sof_dev *sdev, bool enable) +void hda_sdw_int_enable(struct snd_sof_dev *sdev, bool enable) { if (enable) snd_sof_dsp_update_bits(sdev, HDA_DSP_BAR, diff --git a/sound/soc/sof/intel/hda.h b/sound/soc/sof/intel/hda.h index 48e09b7daf0a..de71c92b2f39 100644 --- a/sound/soc/sof/intel/hda.h +++ b/sound/soc/sof/intel/hda.h @@ -591,6 +591,11 @@ int hda_dsp_trace_init(struct snd_sof_dev *sdev, u32 *stream_tag); int hda_dsp_trace_release(struct snd_sof_dev *sdev); int hda_dsp_trace_trigger(struct snd_sof_dev *sdev, int cmd); +/* + * SoundWire support + */ +void hda_sdw_int_enable(struct snd_sof_dev *sdev, bool enable); + /* common dai driver */ extern struct snd_soc_dai_driver skl_dai[]; -- 2.20.1