All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: alsa-devel@alsa-project.org
Cc: tiwai@suse.de, broonie@kernel.org,
	Bard Liao <yung-chuan.liao@linux.intel.com>,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Subject: [PATCH 10/16] ASoC: SOF: Intel: hda: always do a full reset
Date: Mon, 24 Oct 2022 11:53:04 -0500	[thread overview]
Message-ID: <20221024165310.246183-11-pierre-louis.bossart@linux.intel.com> (raw)
In-Reply-To: <20221024165310.246183-1-pierre-louis.bossart@linux.intel.com>

There's no point in checking for a full-reset condition that is
always-true in the callers.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
---
 sound/soc/sof/intel/hda-ctrl.c | 26 ++++++++++++--------------
 sound/soc/sof/intel/hda-dsp.c  |  2 +-
 sound/soc/sof/intel/hda.c      |  2 +-
 sound/soc/sof/intel/hda.h      |  2 +-
 4 files changed, 15 insertions(+), 17 deletions(-)

diff --git a/sound/soc/sof/intel/hda-ctrl.c b/sound/soc/sof/intel/hda-ctrl.c
index 7f387ad5ef6f4..e3334693c2926 100644
--- a/sound/soc/sof/intel/hda-ctrl.c
+++ b/sound/soc/sof/intel/hda-ctrl.c
@@ -182,7 +182,7 @@ int hda_dsp_ctrl_clock_power_gating(struct snd_sof_dev *sdev, bool enable)
 	return 0;
 }
 
-int hda_dsp_ctrl_init_chip(struct snd_sof_dev *sdev, bool full_reset)
+int hda_dsp_ctrl_init_chip(struct snd_sof_dev *sdev)
 {
 	struct hdac_bus *bus = sof_to_bus(sdev);
 #if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA)
@@ -199,20 +199,18 @@ int hda_dsp_ctrl_init_chip(struct snd_sof_dev *sdev, bool full_reset)
 #endif
 	hda_dsp_ctrl_misc_clock_gating(sdev, false);
 
-	if (full_reset) {
-		/* reset HDA controller */
-		ret = hda_dsp_ctrl_link_reset(sdev, true);
-		if (ret < 0) {
-			dev_err(sdev->dev, "error: failed to reset HDA controller\n");
-			goto err;
-		}
+	/* reset HDA controller */
+	ret = hda_dsp_ctrl_link_reset(sdev, true);
+	if (ret < 0) {
+		dev_err(sdev->dev, "error: failed to reset HDA controller\n");
+		goto err;
+	}
 
-		/* exit HDA controller reset */
-		ret = hda_dsp_ctrl_link_reset(sdev, false);
-		if (ret < 0) {
-			dev_err(sdev->dev, "error: failed to exit HDA controller reset\n");
-			goto err;
-		}
+	/* exit HDA controller reset */
+	ret = hda_dsp_ctrl_link_reset(sdev, false);
+	if (ret < 0) {
+		dev_err(sdev->dev, "error: failed to exit HDA controller reset\n");
+		goto err;
 	}
 
 #if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA)
diff --git a/sound/soc/sof/intel/hda-dsp.c b/sound/soc/sof/intel/hda-dsp.c
index 74067df96fdc4..6d896ea316806 100644
--- a/sound/soc/sof/intel/hda-dsp.c
+++ b/sound/soc/sof/intel/hda-dsp.c
@@ -691,7 +691,7 @@ static int hda_resume(struct snd_sof_dev *sdev, bool runtime_resume)
 	snd_sof_pci_update_bits(sdev, PCI_TCSEL, 0x07, 0);
 
 	/* reset and start hda controller */
-	ret = hda_dsp_ctrl_init_chip(sdev, true);
+	ret = hda_dsp_ctrl_init_chip(sdev);
 	if (ret < 0) {
 		dev_err(sdev->dev,
 			"error: failed to start controller after resume\n");
diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c
index d63f843dc7aab..2ee414600f779 100644
--- a/sound/soc/sof/intel/hda.c
+++ b/sound/soc/sof/intel/hda.c
@@ -890,7 +890,7 @@ static int hda_init_caps(struct snd_sof_dev *sdev)
 		dev_dbg(sdev->dev, "PP capability, will probe DSP later.\n");
 
 	/* Init HDA controller after i915 init */
-	ret = hda_dsp_ctrl_init_chip(sdev, true);
+	ret = hda_dsp_ctrl_init_chip(sdev);
 	if (ret < 0) {
 		dev_err(bus->dev, "error: init chip failed with ret: %d\n",
 			ret);
diff --git a/sound/soc/sof/intel/hda.h b/sound/soc/sof/intel/hda.h
index c91fc36378235..6b1474d78ebb3 100644
--- a/sound/soc/sof/intel/hda.h
+++ b/sound/soc/sof/intel/hda.h
@@ -702,7 +702,7 @@ void hda_dsp_ctrl_ppcap_int_enable(struct snd_sof_dev *sdev, bool enable);
 int hda_dsp_ctrl_link_reset(struct snd_sof_dev *sdev, bool reset);
 void hda_dsp_ctrl_misc_clock_gating(struct snd_sof_dev *sdev, bool enable);
 int hda_dsp_ctrl_clock_power_gating(struct snd_sof_dev *sdev, bool enable);
-int hda_dsp_ctrl_init_chip(struct snd_sof_dev *sdev, bool full_reset);
+int hda_dsp_ctrl_init_chip(struct snd_sof_dev *sdev);
 void hda_dsp_ctrl_stop_chip(struct snd_sof_dev *sdev);
 /*
  * HDA bus operations.
-- 
2.34.1


  parent reply	other threads:[~2022-10-24 16:57 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-24 16:52 [PATCH 00/16] ASoC: SOF: Intel: HDaudio cleanups Pierre-Louis Bossart
2022-10-24 16:52 ` [PATCH 01/16] ASoC: SOF: ops: fallback to mmio in helpers Pierre-Louis Bossart
2022-10-24 16:52 ` [PATCH 02/16] ASoC: SOF: Intel: use mmio fallback for all platforms Pierre-Louis Bossart
2022-10-24 16:52 ` [PATCH 03/16] ASoC: SOF: ops: add readb/writeb helpers Pierre-Louis Bossart
2022-10-27 18:51   ` Nathan Chancellor
2022-10-27 19:58     ` Pierre-Louis Bossart
2022-10-27 20:02       ` Nathan Chancellor
2022-10-24 16:52 ` [PATCH 04/16] ASoC: SOF: ops: add snd_sof_dsp_updateb() helper Pierre-Louis Bossart
2022-10-24 16:52 ` [PATCH 05/16] ASoC: SOF: Intel: hda-dsp: use SOF helpers for consistency Pierre-Louis Bossart
2022-10-24 16:53 ` [PATCH 06/16] ASoC: SOF: Intel: hda-dai: start removing the use of runtime->private_data in BE Pierre-Louis Bossart
2022-10-24 16:53 ` [PATCH 07/16] ASoC: SOF: Intel: hda-dai: use component_get_drvdata to find hdac_bus Pierre-Louis Bossart
2022-10-24 16:53 ` [PATCH 08/16] ASoC: SOF: Intel: hda-dai: remove useless members in hda_pipe_params Pierre-Louis Bossart
2022-10-24 16:53 ` [PATCH 09/16] ASoC: SOF: Intel: hda-ctrl: remove useless sleep Pierre-Louis Bossart
2022-10-24 16:53 ` Pierre-Louis Bossart [this message]
2022-10-24 16:53 ` [PATCH 11/16] ASoC: SOF: Intel: hda: remove useless check on GCTL Pierre-Louis Bossart
2022-10-24 16:53 ` [PATCH 12/16] ASoC: SOF: Intel: hda-stream: use SOF helpers for consistency Pierre-Louis Bossart
2022-10-24 16:53 ` [PATCH 13/16] ASoC: SOF: Intel: hda-stream: rename CL_SD_CTL registers as SD_CTL Pierre-Louis Bossart
2022-10-24 16:53 ` [PATCH 14/16] ASoC: SOF: Intel: hda: use SOF helper for consistency Pierre-Louis Bossart
2022-10-24 16:53 ` [PATCH 15/16] ASoC: SOF: Intel: hda-stream: use snd_sof_dsp_updateb() helper Pierre-Louis Bossart
2022-10-24 16:53 ` [PATCH 16/16] ASoC: SOF: Intel: hda-stream: use readb/writeb for stream registers Pierre-Louis Bossart
2022-10-26 19:04 ` [PATCH 00/16] ASoC: SOF: Intel: HDaudio cleanups Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221024165310.246183-11-pierre-louis.bossart@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=ranjani.sridharan@linux.intel.com \
    --cc=tiwai@suse.de \
    --cc=yung-chuan.liao@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.