aboutsummaryrefslogtreecommitdiff
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.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/sound/soc/sof/intel/hda-codec.c b/sound/soc/sof/intel/hda-codec.c
index 64a7c51a9992..1882b9ac3c3b 100644
--- a/sound/soc/sof/intel/hda-codec.c
+++ b/sound/soc/sof/intel/hda-codec.c
@@ -72,6 +72,10 @@ void hda_codec_jack_wake_enable(struct snd_sof_dev *sdev, bool enable)
struct hda_codec *codec;
unsigned int mask = 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)
if (codec->jacktbl.used)
@@ -88,6 +92,10 @@ void hda_codec_jack_check(struct snd_sof_dev *sdev)
struct hda_bus *hbus = sof_to_hbus(sdev);
struct hda_codec *codec;
+ if (IS_ENABLED(CONFIG_SND_SOC_SOF_NOCODEC_DEBUG_SUPPORT) &&
+ sof_debug_check_flag(SOF_DBG_FORCE_NOCODEC))
+ return;
+
list_for_each_codec(codec, hbus)
/*
* Wake up all jack-detecting codecs regardless whether an event
@@ -207,6 +215,10 @@ void hda_codec_probe_bus(struct snd_sof_dev *sdev)
struct hdac_bus *bus = sof_to_bus(sdev);
int i, ret;
+ if (IS_ENABLED(CONFIG_SND_SOC_SOF_NOCODEC_DEBUG_SUPPORT) &&
+ sof_debug_check_flag(SOF_DBG_FORCE_NOCODEC))
+ return;
+
/* probe codecs in avail slots */
for (i = 0; i < HDA_MAX_CODECS; i++) {
@@ -240,6 +252,10 @@ void hda_codec_detect_mask(struct snd_sof_dev *sdev)
{
struct hdac_bus *bus = sof_to_bus(sdev);
+ if (IS_ENABLED(CONFIG_SND_SOC_SOF_NOCODEC_DEBUG_SUPPORT) &&
+ sof_debug_check_flag(SOF_DBG_FORCE_NOCODEC))
+ return;
+
/* Accept unsolicited responses */
snd_hdac_chip_updatel(bus, GCTL, AZX_GCTL_UNSOL, AZX_GCTL_UNSOL);
@@ -261,6 +277,10 @@ void hda_codec_init_cmd_io(struct snd_sof_dev *sdev)
{
struct hdac_bus *bus = sof_to_bus(sdev);
+ if (IS_ENABLED(CONFIG_SND_SOC_SOF_NOCODEC_DEBUG_SUPPORT) &&
+ sof_debug_check_flag(SOF_DBG_FORCE_NOCODEC))
+ return;
+
/* initialize the codec command I/O */
snd_hdac_bus_init_cmd_io(bus);
}
@@ -270,6 +290,10 @@ void hda_codec_resume_cmd_io(struct snd_sof_dev *sdev)
{
struct hdac_bus *bus = sof_to_bus(sdev);
+ if (IS_ENABLED(CONFIG_SND_SOC_SOF_NOCODEC_DEBUG_SUPPORT) &&
+ sof_debug_check_flag(SOF_DBG_FORCE_NOCODEC))
+ return;
+
/* set up CORB/RIRB buffers if was on before suspend */
if (bus->cmd_dma_state)
snd_hdac_bus_init_cmd_io(bus);
@@ -280,6 +304,10 @@ void hda_codec_stop_cmd_io(struct snd_sof_dev *sdev)
{
struct hdac_bus *bus = sof_to_bus(sdev);
+ if (IS_ENABLED(CONFIG_SND_SOC_SOF_NOCODEC_DEBUG_SUPPORT) &&
+ sof_debug_check_flag(SOF_DBG_FORCE_NOCODEC))
+ return;
+
/* initialize the codec command I/O */
snd_hdac_bus_stop_cmd_io(bus);
}
@@ -289,6 +317,10 @@ void hda_codec_suspend_cmd_io(struct snd_sof_dev *sdev)
{
struct hdac_bus *bus = sof_to_bus(sdev);
+ if (IS_ENABLED(CONFIG_SND_SOC_SOF_NOCODEC_DEBUG_SUPPORT) &&
+ sof_debug_check_flag(SOF_DBG_FORCE_NOCODEC))
+ return;
+
/* stop the CORB/RIRB DMA if it is On */
if (bus->cmd_dma_state)
snd_hdac_bus_stop_cmd_io(bus);
@@ -300,6 +332,10 @@ void hda_codec_rirb_status_clear(struct snd_sof_dev *sdev)
{
struct hdac_bus *bus = sof_to_bus(sdev);
+ if (IS_ENABLED(CONFIG_SND_SOC_SOF_NOCODEC_DEBUG_SUPPORT) &&
+ sof_debug_check_flag(SOF_DBG_FORCE_NOCODEC))
+ return;
+
/* clear rirb status */
snd_hdac_chip_writeb(bus, RIRBSTS, RIRB_INT_MASK);
}
@@ -309,6 +345,9 @@ void hda_codec_set_codec_wakeup(struct snd_sof_dev *sdev, bool status)
{
struct hdac_bus *bus = sof_to_bus(sdev);
+ if (sof_debug_check_flag(SOF_DBG_FORCE_NOCODEC))
+ return;
+
snd_hdac_set_codec_wakeup(bus, status);
}
EXPORT_SYMBOL_NS_GPL(hda_codec_set_codec_wakeup, SND_SOC_SOF_HDA_AUDIO_CODEC);
@@ -319,6 +358,10 @@ bool hda_codec_check_rirb_status(struct snd_sof_dev *sdev)
bool active = false;
u32 rirb_status;
+ if (IS_ENABLED(CONFIG_SND_SOC_SOF_NOCODEC_DEBUG_SUPPORT) &&
+ sof_debug_check_flag(SOF_DBG_FORCE_NOCODEC))
+ return false;
+
rirb_status = snd_hdac_chip_readb(bus, RIRBSTS);
if (rirb_status & RIRB_INT_MASK) {
/*
@@ -340,6 +383,10 @@ void hda_codec_device_remove(struct snd_sof_dev *sdev)
{
struct hdac_bus *bus = sof_to_bus(sdev);
+ if (IS_ENABLED(CONFIG_SND_SOC_SOF_NOCODEC_DEBUG_SUPPORT) &&
+ sof_debug_check_flag(SOF_DBG_FORCE_NOCODEC))
+ return;
+
/* codec removal, invoke bus_device_remove */
snd_hdac_ext_bus_device_remove(bus);
}
@@ -353,6 +400,10 @@ void hda_codec_i915_display_power(struct snd_sof_dev *sdev, bool enable)
{
struct hdac_bus *bus = sof_to_bus(sdev);
+ if (IS_ENABLED(CONFIG_SND_SOC_SOF_NOCODEC_DEBUG_SUPPORT) &&
+ sof_debug_check_flag(SOF_DBG_FORCE_NOCODEC))
+ return;
+
if (HDA_IDISP_CODEC(bus->codec_mask)) {
dev_dbg(bus->dev, "Turning i915 HDAC power %d\n", enable);
snd_hdac_display_power(bus, HDA_CODEC_IDX_CONTROLLER, enable);
@@ -365,6 +416,10 @@ int hda_codec_i915_init(struct snd_sof_dev *sdev)
struct hdac_bus *bus = sof_to_bus(sdev);
int ret;
+ if (IS_ENABLED(CONFIG_SND_SOC_SOF_NOCODEC_DEBUG_SUPPORT) &&
+ sof_debug_check_flag(SOF_DBG_FORCE_NOCODEC))
+ return 0;
+
/* i915 exposes a HDA codec for HDMI audio */
ret = snd_hdac_i915_init(bus);
if (ret < 0)
@@ -381,6 +436,10 @@ int hda_codec_i915_exit(struct snd_sof_dev *sdev)
{
struct hdac_bus *bus = sof_to_bus(sdev);
+ if (IS_ENABLED(CONFIG_SND_SOC_SOF_NOCODEC_DEBUG_SUPPORT) &&
+ sof_debug_check_flag(SOF_DBG_FORCE_NOCODEC))
+ return 0;
+
if (!bus->audio_component)
return 0;