summaryrefslogtreecommitdiff
path: root/sound/soc/sof/intel/hda-codec.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/sof/intel/hda-codec.c')
-rw-r--r--sound/soc/sof/intel/hda-codec.c51
1 files changed, 31 insertions, 20 deletions
diff --git a/sound/soc/sof/intel/hda-codec.c b/sound/soc/sof/intel/hda-codec.c
index 9f84b0d287a5..2f9925830d1d 100644
--- a/sound/soc/sof/intel/hda-codec.c
+++ b/sound/soc/sof/intel/hda-codec.c
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
//
-// Copyright(c) 2018 Intel Corporation. All rights reserved.
+// Copyright(c) 2018 Intel Corporation
//
// Authors: Keyon Jie <yang.jie@linux.intel.com>
//
@@ -79,20 +79,29 @@ void hda_codec_jack_wake_enable(struct snd_sof_dev *sdev, bool enable)
struct hdac_bus *bus = sof_to_bus(sdev);
struct hda_codec *codec;
unsigned int mask = 0;
+ unsigned int val = 0;
if (IS_ENABLED(CONFIG_SND_SOC_SOF_NOCODEC_DEBUG_SUPPORT) &&
sof_debug_check_flag(SOF_DBG_FORCE_NOCODEC))
return;
if (enable) {
- list_for_each_codec(codec, hbus)
+ list_for_each_codec(codec, hbus) {
+ /* only set WAKEEN when needed for HDaudio codecs */
+ mask |= BIT(codec->core.addr);
if (codec->jacktbl.used)
- mask |= BIT(codec->core.addr);
+ val |= BIT(codec->core.addr);
+ }
+ } else {
+ list_for_each_codec(codec, hbus) {
+ /* reset WAKEEN only HDaudio codecs */
+ mask |= BIT(codec->core.addr);
+ }
}
- snd_hdac_chip_updatew(bus, WAKEEN, STATESTS_INT_MASK, mask);
+ snd_hdac_chip_updatew(bus, WAKEEN, mask & STATESTS_INT_MASK, val);
}
-EXPORT_SYMBOL_NS_GPL(hda_codec_jack_wake_enable, SND_SOC_SOF_HDA_AUDIO_CODEC);
+EXPORT_SYMBOL_NS_GPL(hda_codec_jack_wake_enable, "SND_SOC_SOF_HDA_AUDIO_CODEC");
/* check jack status after resuming from suspend mode */
void hda_codec_jack_check(struct snd_sof_dev *sdev)
@@ -112,7 +121,7 @@ void hda_codec_jack_check(struct snd_sof_dev *sdev)
if (codec->jacktbl.used)
pm_request_resume(&codec->core.dev);
}
-EXPORT_SYMBOL_NS_GPL(hda_codec_jack_check, SND_SOC_SOF_HDA_AUDIO_CODEC);
+EXPORT_SYMBOL_NS_GPL(hda_codec_jack_check, "SND_SOC_SOF_HDA_AUDIO_CODEC");
#if IS_ENABLED(CONFIG_SND_HDA_GENERIC)
#define is_generic_config(bus) \
@@ -228,7 +237,7 @@ void hda_codec_probe_bus(struct snd_sof_dev *sdev)
}
}
}
-EXPORT_SYMBOL_NS_GPL(hda_codec_probe_bus, SND_SOC_SOF_HDA_AUDIO_CODEC);
+EXPORT_SYMBOL_NS_GPL(hda_codec_probe_bus, "SND_SOC_SOF_HDA_AUDIO_CODEC");
void hda_codec_check_for_state_change(struct snd_sof_dev *sdev)
{
@@ -241,7 +250,7 @@ void hda_codec_check_for_state_change(struct snd_sof_dev *sdev)
snd_hdac_chip_writew(bus, STATESTS, codec_mask);
}
}
-EXPORT_SYMBOL_NS_GPL(hda_codec_check_for_state_change, SND_SOC_SOF_HDA_AUDIO_CODEC);
+EXPORT_SYMBOL_NS_GPL(hda_codec_check_for_state_change, "SND_SOC_SOF_HDA_AUDIO_CODEC");
void hda_codec_detect_mask(struct snd_sof_dev *sdev)
{
@@ -266,7 +275,7 @@ void hda_codec_detect_mask(struct snd_sof_dev *sdev)
bus->codec_mask);
}
}
-EXPORT_SYMBOL_NS_GPL(hda_codec_detect_mask, SND_SOC_SOF_HDA_AUDIO_CODEC);
+EXPORT_SYMBOL_NS_GPL(hda_codec_detect_mask, "SND_SOC_SOF_HDA_AUDIO_CODEC");
void hda_codec_init_cmd_io(struct snd_sof_dev *sdev)
{
@@ -279,7 +288,7 @@ void hda_codec_init_cmd_io(struct snd_sof_dev *sdev)
/* initialize the codec command I/O */
snd_hdac_bus_init_cmd_io(bus);
}
-EXPORT_SYMBOL_NS_GPL(hda_codec_init_cmd_io, SND_SOC_SOF_HDA_AUDIO_CODEC);
+EXPORT_SYMBOL_NS_GPL(hda_codec_init_cmd_io, "SND_SOC_SOF_HDA_AUDIO_CODEC");
void hda_codec_resume_cmd_io(struct snd_sof_dev *sdev)
{
@@ -293,7 +302,7 @@ void hda_codec_resume_cmd_io(struct snd_sof_dev *sdev)
if (bus->cmd_dma_state)
snd_hdac_bus_init_cmd_io(bus);
}
-EXPORT_SYMBOL_NS_GPL(hda_codec_resume_cmd_io, SND_SOC_SOF_HDA_AUDIO_CODEC);
+EXPORT_SYMBOL_NS_GPL(hda_codec_resume_cmd_io, "SND_SOC_SOF_HDA_AUDIO_CODEC");
void hda_codec_stop_cmd_io(struct snd_sof_dev *sdev)
{
@@ -306,7 +315,7 @@ void hda_codec_stop_cmd_io(struct snd_sof_dev *sdev)
/* initialize the codec command I/O */
snd_hdac_bus_stop_cmd_io(bus);
}
-EXPORT_SYMBOL_NS_GPL(hda_codec_stop_cmd_io, SND_SOC_SOF_HDA_AUDIO_CODEC);
+EXPORT_SYMBOL_NS_GPL(hda_codec_stop_cmd_io, "SND_SOC_SOF_HDA_AUDIO_CODEC");
void hda_codec_suspend_cmd_io(struct snd_sof_dev *sdev)
{
@@ -321,7 +330,7 @@ void hda_codec_suspend_cmd_io(struct snd_sof_dev *sdev)
snd_hdac_bus_stop_cmd_io(bus);
}
-EXPORT_SYMBOL_NS_GPL(hda_codec_suspend_cmd_io, SND_SOC_SOF_HDA_AUDIO_CODEC);
+EXPORT_SYMBOL_NS_GPL(hda_codec_suspend_cmd_io, "SND_SOC_SOF_HDA_AUDIO_CODEC");
void hda_codec_rirb_status_clear(struct snd_sof_dev *sdev)
{
@@ -334,7 +343,7 @@ void hda_codec_rirb_status_clear(struct snd_sof_dev *sdev)
/* clear rirb status */
snd_hdac_chip_writeb(bus, RIRBSTS, RIRB_INT_MASK);
}
-EXPORT_SYMBOL_NS_GPL(hda_codec_rirb_status_clear, SND_SOC_SOF_HDA_AUDIO_CODEC);
+EXPORT_SYMBOL_NS_GPL(hda_codec_rirb_status_clear, "SND_SOC_SOF_HDA_AUDIO_CODEC");
void hda_codec_set_codec_wakeup(struct snd_sof_dev *sdev, bool status)
{
@@ -345,7 +354,7 @@ void hda_codec_set_codec_wakeup(struct snd_sof_dev *sdev, bool status)
snd_hdac_set_codec_wakeup(bus, status);
}
-EXPORT_SYMBOL_NS_GPL(hda_codec_set_codec_wakeup, SND_SOC_SOF_HDA_AUDIO_CODEC);
+EXPORT_SYMBOL_NS_GPL(hda_codec_set_codec_wakeup, "SND_SOC_SOF_HDA_AUDIO_CODEC");
bool hda_codec_check_rirb_status(struct snd_sof_dev *sdev)
{
@@ -372,7 +381,7 @@ bool hda_codec_check_rirb_status(struct snd_sof_dev *sdev)
}
return active;
}
-EXPORT_SYMBOL_NS_GPL(hda_codec_check_rirb_status, SND_SOC_SOF_HDA_AUDIO_CODEC);
+EXPORT_SYMBOL_NS_GPL(hda_codec_check_rirb_status, "SND_SOC_SOF_HDA_AUDIO_CODEC");
void hda_codec_device_remove(struct snd_sof_dev *sdev)
{
@@ -385,7 +394,7 @@ void hda_codec_device_remove(struct snd_sof_dev *sdev)
/* codec removal, invoke bus_device_remove */
snd_hdac_ext_bus_device_remove(bus);
}
-EXPORT_SYMBOL_NS_GPL(hda_codec_device_remove, SND_SOC_SOF_HDA_AUDIO_CODEC);
+EXPORT_SYMBOL_NS_GPL(hda_codec_device_remove, "SND_SOC_SOF_HDA_AUDIO_CODEC");
#endif /* CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC */
@@ -404,7 +413,7 @@ void hda_codec_i915_display_power(struct snd_sof_dev *sdev, bool enable)
snd_hdac_display_power(bus, HDA_CODEC_IDX_CONTROLLER, enable);
}
}
-EXPORT_SYMBOL_NS_GPL(hda_codec_i915_display_power, SND_SOC_SOF_HDA_AUDIO_CODEC_I915);
+EXPORT_SYMBOL_NS_GPL(hda_codec_i915_display_power, "SND_SOC_SOF_HDA_AUDIO_CODEC_I915");
int hda_codec_i915_init(struct snd_sof_dev *sdev)
{
@@ -425,7 +434,7 @@ int hda_codec_i915_init(struct snd_sof_dev *sdev)
return 0;
}
-EXPORT_SYMBOL_NS_GPL(hda_codec_i915_init, SND_SOC_SOF_HDA_AUDIO_CODEC_I915);
+EXPORT_SYMBOL_NS_GPL(hda_codec_i915_init, "SND_SOC_SOF_HDA_AUDIO_CODEC_I915");
int hda_codec_i915_exit(struct snd_sof_dev *sdev)
{
@@ -443,8 +452,10 @@ int hda_codec_i915_exit(struct snd_sof_dev *sdev)
return snd_hdac_i915_exit(bus);
}
-EXPORT_SYMBOL_NS_GPL(hda_codec_i915_exit, SND_SOC_SOF_HDA_AUDIO_CODEC_I915);
+EXPORT_SYMBOL_NS_GPL(hda_codec_i915_exit, "SND_SOC_SOF_HDA_AUDIO_CODEC_I915");
+MODULE_SOFTDEP("pre: snd-hda-codec-hdmi");
#endif
MODULE_LICENSE("Dual BSD/GPL");
+MODULE_DESCRIPTION("SOF support for HDaudio codecs");