mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bard Liao <yung-chuan.liao@linux.intel.com>
To: alsa-devel@alsa-project.org, vkoul@kernel.org,
	broonie@kernel.org, tiwai@suse.de
Cc: linux-kernel@vger.kernel.org, vinod.koul@linaro.org,
	pierre-louis.bossart@linux.intel.com, bard.liao@intel.com
Subject: [PATCH v2 08/26] ASoC: SOF: Intel: hda: retrieve SoundWire eml_lock and pass pointer
Date: Mon, 15 May 2023 15:10:24 +0800	[thread overview]
Message-ID: <20230515071042.2038-9-yung-chuan.liao@linux.intel.com> (raw)
In-Reply-To: <20230515071042.2038-1-yung-chuan.liao@linux.intel.com>

From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

Use new helper and interface to make sure the HDaudio and SoundWire
parts use the same mutex when accessing shared registers.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Acked-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/sof/intel/hda.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c
index 4d48f4018617..388e41057172 100644
--- a/sound/soc/sof/intel/hda.c
+++ b/sound/soc/sof/intel/hda.c
@@ -175,6 +175,15 @@ static int hda_sdw_probe(struct snd_sof_dev *sdev)
 		res.alh_base = hdev->desc->sdw_alh_base;
 		res.ext = false;
 	} else {
+		/*
+		 * retrieve eml_lock needed to protect shared registers
+		 * in the HDaudio multi-link areas
+		 */
+		res.eml_lock = hdac_bus_eml_get_mutex(sof_to_bus(sdev), true,
+						      AZX_REG_ML_LEPTR_ID_SDW);
+		if (!res.eml_lock)
+			return -ENODEV;
+
 		res.mmio_base = sdev->bar[HDA_DSP_HDA_BAR];
 		/*
 		 * the SHIM and SoundWire register offsets are link-specific
-- 
2.25.1


  parent reply	other threads:[~2023-05-15  6:51 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-15  7:10 [PATCH v2 00/26] ASoC/soundwire: add support for ACE2.x Bard Liao
2023-05-15  7:10 ` [PATCH v2 01/26] ASoC: SOF: Intel: shim: add enum for ACE 2.0 IP used in LunarLake Bard Liao
2023-05-15  7:10 ` [PATCH v2 02/26] soundwire: intel: add ACE2.x SHIM definitions Bard Liao
2023-05-15  7:10 ` [PATCH v2 03/26] soundwire: intel_ace2x: add empty new ops for LunarLake Bard Liao
2023-05-15  7:10 ` [PATCH v2 04/26] soundwire/ASOC: Intel: update offsets " Bard Liao
2023-05-15  7:10 ` [PATCH v2 05/26] soundwire: intel/cadence: set ip_offset at run-time Bard Liao
2023-05-15  7:10 ` [PATCH v2 06/26] ASoC/soundwire: intel: pass hdac_bus pointer for link management Bard Liao
2023-05-15  7:10 ` [PATCH v2 07/26] soundwire: intel: add eml_lock in the interface for new platforms Bard Liao
2023-05-15  7:10 ` Bard Liao [this message]
2023-05-15  7:10 ` [PATCH v2 09/26] soundwire: intel_init: use eml_lock parameter Bard Liao
2023-05-15  7:10 ` [PATCH v2 10/26] soundwire: intel_ace2x: add debugfs support Bard Liao
2023-05-15  7:10 ` [PATCH v2 11/26] soundwire: intel_ace2x: add link power-up/down helpers Bard Liao
2023-05-15  7:10 ` [PATCH v2 12/26] soundwire: intel_ace2x: set SYNCPRD before powering-up Bard Liao
2023-05-15  7:10 ` [PATCH v2 13/26] soundwire: intel_ace2x: configure link PHY Bard Liao
2023-05-15  7:10 ` [PATCH v2 14/26] soundwire: intel_ace2x: add DAI registration Bard Liao
2023-05-15  7:10 ` [PATCH v2 15/26] soundwire: intel_ace2x: add sync_arm/sync_go helpers Bard Liao
2023-05-15  7:10 ` [PATCH v2 16/26] soundwire: intel_ace2x: use common helpers for bus start/stop Bard Liao
2023-05-15  7:10 ` [PATCH v2 17/26] soundwire: intel_ace2x: enable wake support Bard Liao
2023-05-15  7:10 ` [PATCH v2 18/26] soundwire: intel_ace2x: add check_cmdsync_unlocked helper Bard Liao
2023-05-15  7:10 ` [PATCH v2 19/26] soundwire: bus: add new manager callback to deal with peripheral enumeration Bard Liao
2023-05-15  7:10 ` [PATCH v2 20/26] soundwire: intel_ace2x: add new_peripheral_assigned callback Bard Liao
2023-05-15  7:10 ` [PATCH v2 21/26] soundwire: intel_ace2x: add pre/post bank switch callbacks Bard Liao
2023-05-15  7:10 ` [PATCH v2 22/26] ASoC: SOF/soundwire: re-add substream in params_stream structure Bard Liao
2023-05-15  7:10 ` [PATCH v2 23/26] soundwire: intel: remove .trigger callback implementation Bard Liao
2023-05-15  7:10 ` [PATCH v2 24/26] soundwire: intel: use substream for .trigger callback Bard Liao
2023-05-15  7:10 ` [PATCH v2 25/26] soundwire: intel: remove .free callback implementation Bard Liao
2023-05-15  7:10 ` [PATCH v2 26/26] soundwire: intel: use substream for .free callback Bard Liao
2023-05-27 10:36 ` [PATCH v2 00/26] ASoC/soundwire: add support for ACE2.x Vinod Koul
2023-06-02 20:46   ` Pierre-Louis Bossart
2023-06-07 13:07     ` Vinod Koul
2023-06-07 14:45       ` Pierre-Louis Bossart

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=20230515071042.2038-9-yung-chuan.liao@linux.intel.com \
    --to=yung-chuan.liao@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=bard.liao@intel.com \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=tiwai@suse.de \
    --cc=vinod.koul@linaro.org \
    --cc=vkoul@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®