All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
To: lgirdwood@gmail.com, broonie@kernel.org, tiwai@suse.de, perex@perex.cz
Cc: alsa-devel@alsa-project.org,
	pierre-louis.bossart@linux.intel.com,
	ranjani.sridharan@linux.intel.com, kai.vehmanen@linux.intel.com,
	rander.wang@intel.com
Subject: [PATCH 09/18] ASoC: SOF: Intel: hda-mlink: add convenience helpers for SoundWire PM
Date: Mon, 27 Mar 2023 14:29:22 +0300	[thread overview]
Message-ID: <20230327112931.23411-10-peter.ujfalusi@linux.intel.com> (raw)
In-Reply-To: <20230327112931.23411-1-peter.ujfalusi@linux.intel.com>

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

The updated SoundWire Intel driver will need to rely on Extended
HDaudio links for power management, but it doesn't need to be aware of
all the HDaudio structures. Add convenience helpers to avoid polluting
SoundWire drivers too much with HDaudio information.

Since the SoundWire/Intel solution already takes the lock at a higher
level, the _unlocked PM helpers are used.

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: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
---
 include/sound/hda-mlink.h       |  9 +++++++++
 sound/soc/sof/intel/hda-mlink.c | 12 ++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/include/sound/hda-mlink.h b/include/sound/hda-mlink.h
index 6908af849dd5..74737032a632 100644
--- a/include/sound/hda-mlink.h
+++ b/include/sound/hda-mlink.h
@@ -19,6 +19,9 @@ int hdac_bus_eml_power_up_unlocked(struct hdac_bus *bus, bool alt, int elid, int
 int hdac_bus_eml_power_down(struct hdac_bus *bus, bool alt, int elid, int sublink);
 int hdac_bus_eml_power_down_unlocked(struct hdac_bus *bus, bool alt, int elid, int sublink);
 
+int hdac_bus_eml_sdw_power_up_unlocked(struct hdac_bus *bus, int sublink);
+int hdac_bus_eml_sdw_power_down_unlocked(struct hdac_bus *bus, int sublink);
+
 void hda_bus_ml_put_all(struct hdac_bus *bus);
 void hda_bus_ml_reset_losidv(struct hdac_bus *bus);
 int hda_bus_ml_resume(struct hdac_bus *bus);
@@ -55,6 +58,12 @@ hdac_bus_eml_power_down_unlocked(struct hdac_bus *bus, bool alt, int elid, int s
 	return 0;
 }
 
+static inline int
+hdac_bus_eml_sdw_power_up_unlocked(struct hdac_bus *bus, int sublink) { return 0; }
+
+static inline int
+hdac_bus_eml_sdw_power_down_unlocked(struct hdac_bus *bus, int sublink) { return 0; }
+
 static inline void hda_bus_ml_put_all(struct hdac_bus *bus) { }
 static inline void hda_bus_ml_reset_losidv(struct hdac_bus *bus) { }
 static inline int hda_bus_ml_resume(struct hdac_bus *bus) { return 0; }
diff --git a/sound/soc/sof/intel/hda-mlink.c b/sound/soc/sof/intel/hda-mlink.c
index 4cfef4007d0c..310bb4c6822e 100644
--- a/sound/soc/sof/intel/hda-mlink.c
+++ b/sound/soc/sof/intel/hda-mlink.c
@@ -414,6 +414,18 @@ int hdac_bus_eml_power_down_unlocked(struct hdac_bus *bus, bool alt, int elid, i
 }
 EXPORT_SYMBOL_NS(hdac_bus_eml_power_down_unlocked, SND_SOC_SOF_HDA_MLINK);
 
+int hdac_bus_eml_sdw_power_up_unlocked(struct hdac_bus *bus, int sublink)
+{
+	return hdac_bus_eml_power_up_unlocked(bus, true, AZX_REG_ML_LEPTR_ID_SDW, sublink);
+}
+EXPORT_SYMBOL_NS(hdac_bus_eml_sdw_power_up_unlocked, SND_SOC_SOF_HDA_MLINK);
+
+int hdac_bus_eml_sdw_power_down_unlocked(struct hdac_bus *bus, int sublink)
+{
+	return hdac_bus_eml_power_down_unlocked(bus, true, AZX_REG_ML_LEPTR_ID_SDW, sublink);
+}
+EXPORT_SYMBOL_NS(hdac_bus_eml_sdw_power_down_unlocked, SND_SOC_SOF_HDA_MLINK);
+
 void hda_bus_ml_put_all(struct hdac_bus *bus)
 {
 	struct hdac_ext_link *hlink;
-- 
2.40.0


  parent reply	other threads:[~2023-03-27 11:32 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-27 11:29 [PATCH 00/18] ASoC: SOF: Intel: hda-mlink: HDaudio multi-link extension update Peter Ujfalusi
2023-03-27 11:29 ` [PATCH 01/18] Documentation: sound: add description of Intel HDaudio multi-links Peter Ujfalusi
2023-03-27 11:29 ` [PATCH 02/18] ALSA: hda: add HDaudio Extended link definitions Peter Ujfalusi
2023-03-27 11:29 ` [PATCH 03/18] ASoC: SOF: Intel: hda-mlink: improve hda_bus_ml_free() helper Peter Ujfalusi
2023-03-27 11:29 ` [PATCH 04/18] ASoC: SOF: Intel: hda-mlink: add return value for hda_bus_ml_get_capabilities() Peter Ujfalusi
2023-03-27 11:29 ` [PATCH 05/18] ASoC: SOF: Intel: hda-mlink: move to a dedicated module Peter Ujfalusi
2023-03-27 11:29 ` [PATCH 06/18] ASoC: SOF: Intel: hda-mlink: add structures to parse ALT links Peter Ujfalusi
2023-03-30 15:51   ` Takashi Iwai
2023-03-30 16:09     ` Pierre-Louis Bossart
2023-03-30 18:07       ` Takashi Iwai
2023-03-31  3:05         ` Pierre-Louis Bossart
2023-03-27 11:29 ` [PATCH 07/18] ASoC: SOF: Intel: hda-mlink: special-case HDaudio regular links Peter Ujfalusi
2023-03-27 11:29 ` [PATCH 08/18] ASoC: SOF: Intel: hda-mlink: introduce helpers for 'extended links' PM Peter Ujfalusi
2023-03-28 10:34   ` Amadeusz Sławiński
2023-03-28 13:24     ` Pierre-Louis Bossart
2023-03-30 11:42       ` Amadeusz Sławiński
2023-03-30 15:54   ` Takashi Iwai
2023-03-30 16:22     ` Pierre-Louis Bossart
2023-03-27 11:29 ` Peter Ujfalusi [this message]
2023-03-27 11:29 ` [PATCH 10/18] ASoC: SOF: Intel: hda-mlink: add helper to return sublink count Peter Ujfalusi
2023-03-27 11:29 ` [PATCH 11/18] ASoC: SOF: Intel: hda-mlink: add helpers to enable/check interrupts Peter Ujfalusi
2023-03-27 11:29 ` [PATCH 12/18] ASoC: SOF: Intel: hda-mlink: add helpers to set link SYNC frequency Peter Ujfalusi
2023-03-27 11:29 ` [PATCH 13/18] ASoC: SOF: Intel: hda-mlink: add helpers for sync_arm/sync_go Peter Ujfalusi
2023-03-27 11:29 ` [PATCH 14/18] ASoC: SOF: Intel: hda-mlink: add helper to check cmdsync Peter Ujfalusi
2023-03-27 11:29 ` [PATCH 15/18] ASoC: SOF: Intel: hda-mlink: program SoundWire LSDIID registers Peter Ujfalusi
2023-03-27 11:29 ` [PATCH 16/18] ASoC: SOF: Intel: hda-mlink: add helpers to retrieve DMIC/SSP hlink Peter Ujfalusi
2023-03-27 11:29 ` [PATCH 17/18] ASoC: SOF: Intel: hda-mlink: add helper to offload link ownership Peter Ujfalusi
2023-03-27 11:29 ` [PATCH 18/18] ASoC: SOF: Intel: hda-mlink: add helper to retrieve eml_lock Peter Ujfalusi

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=20230327112931.23411-10-peter.ujfalusi@linux.intel.com \
    --to=peter.ujfalusi@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=lgirdwood@gmail.com \
    --cc=perex@perex.cz \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=rander.wang@intel.com \
    --cc=ranjani.sridharan@linux.intel.com \
    --cc=tiwai@suse.de \
    /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.