Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 43 additions & 2 deletions sound/soc/sof/intel/hda-codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#include <linux/module.h>
#include <sound/hdaudio_ext.h>
#include <sound/hda_register.h>
#include <sound/hda_codec.h>
#include <sound/hda_i915.h>
#include <sound/sof.h>
Expand Down Expand Up @@ -37,16 +38,55 @@ static void hda_codec_load_module(struct hda_codec *codec)
static void hda_codec_load_module(struct hda_codec *codec) {}
#endif

/* check jack status after resuming from suspend mode */
void hda_codec_jack_check(struct snd_sof_dev *sdev, int status)
{
struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;
struct hda_bus *hbus = sof_to_hbus(sdev);
struct hdac_bus *bus = sof_to_bus(sdev);
struct hda_codec *codec;
int mask;

/*
* there are two reasons for runtime resume
* (1) waken up by interrupt triggered by WAKEEN feature
* (2) waken up by pm get functions for some audio operations
* For case (1), the bits in status mean which codec triggers
* the interrupt and jacks will be checked on these codecs.
* For case (2), we need to check all the non-hdmi codecs for some
* cases like playback with HDMI or capture with DMIC. In these
* cases, only controller is active and codecs are suspended, so
* codecs can't send unsolicited event to controller. The jack polling
* operation will activate codecs and unsolicited event can work
* even codecs become suspended later.
*/
mask = status ? status : hda->hda_codec_mask;

list_for_each_codec(codec, hbus)
if (mask & BIT(codec->core.addr))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RanderWang @plbossart Sorry, I don't understand this. Now you check jack-status of every codec on every runtime-resume?.. This seems wrong to me. Jack status change should be detected when the change happens, not when the next rtpm-resume is happening. This really doesn't look right to me, please, explain.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please check comments in this function

schedule_delayed_work(&codec->jackpoll_work,
codec->jackpoll_interval);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't work, it only produces kernel warnings, since the jackpool_work isn't initialised in SOF. Further, even though with some tricking that work can be abused for our purpose, its initial purpose is codec polling when the codec cannot send unsolicited events.

Copy link
Author

@RanderWang RanderWang Jun 6, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't make some tricking thing and both I and QA tested on a few devices.
This initial purpose has been reused in runtime resume function , please check __azx_runtime_resume

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't work, it only produces kernel warnings, since the jackpool_work isn't initialised in SOF.

@lyakh Can you share me your test device info so that I can debug on it. Thanks!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lyakh jackpoo_work is initialized by hdac_hda codec. I checked kernel document and didn't find any limitation about this case. Could do share with us more information ? thanks!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RanderWang I was getting these warnings, here from a Wasp log:

Jun  4 15:30:40 wasp kernel: [   10.429822] WARNING: CPU: 1 PID: 62 at /usr/local/src/project/51/src/linux/kernel/workqueue.c:1626 __queue_delayed_work+0x68/0x80
Jun  4 15:30:40 wasp kernel: [   10.429822] Modules linked in: uvcvideo videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 videobuf2_common videodev media snd_soc_skl_hda_dsp snd_soc_hdac_hdmi snd_soc_dmic snd_hda_codec_realtek snd_hda_codec_generic sof_pci_dev snd_sof_intel_hda_common snd_soc_hdac_hda snd_sof_intel_hda snd_sof_intel_byt snd_soc_acpi_intel_match snd_sof_intel_ipc snd_sof snd_sof_xtensa_dsp snd_soc_acpi snd_hda_ext_core snd_soc_core x86_pkg_temp_thermal snd_hda_codec intel_powerclamp snd_hwdep snd_hda_core hid_multitouch iwlmvm snd_pcm mei_me iwlwifi mei processor_thermal_device intel_soc_dts_iosf intel_pch_thermal int3403_thermal int340x_thermal_zone int3400_thermal acpi_thermal_rel efivarfs sdhci_pci xhci_pci intel_lpss_pci cqhci intel_lpss xhci_hcd mfd_core sdhci i2c_hid
Jun  4 15:30:40 wasp kernel: [   10.429837] CPU: 1 PID: 62 Comm: kworker/1:1 Not tainted 5.2.0-rc1+ #39
Jun  4 15:30:40 wasp kernel: [   10.429838] Hardware name: Dell Inc. Vostro 5391/, BIOS 0.1.4 05/02/2019
Jun  4 15:30:40 wasp kernel: [   10.429841] Workqueue: pm pm_runtime_work
Jun  4 15:30:40 wasp kernel: [   10.429843] RIP: 0010:__queue_delayed_work+0x68/0x80
Jun  4 15:30:40 wasp kernel: [   10.429844] Code: 48 01 c1 41 83 f8 40 48 89 4a 30 75 2a e9 80 62 05 00 44 89 c7 e9 88 f4 ff ff 0f 0b eb ce 0f 0b 48 81 7a 38 a0 28 c8 b8 74 ae <0f> 0b 48 83 7a 28 00 74 ac 0f 0b eb a8 44 89 c6 e9 23 53 05 00 0f
Jun  4 15:30:40 wasp kernel: [   10.429844] RSP: 0018:ffffafd540f3bc60 EFLAGS: 00010007
Jun  4 15:30:40 wasp kernel: [   10.429845] RAX: 0000000000000002 RBX: 0000000000000283 RCX: 0000000000000000
Jun  4 15:30:40 wasp kernel: [   10.429846] RDX: ffff9d9961f8e610 RSI: ffff9d9963c10600 RDI: ffff9d9961f8e630
Jun  4 15:30:40 wasp kernel: [   10.429846] RBP: ffff9d9961f8c888 R08: 0000000000000040 R09: ffff9d9961f8d618
Jun  4 15:30:40 wasp kernel: [   10.429846] R10: 00000000000000fb R11: 000000000000072b R12: 0000000000000005
Jun  4 15:30:40 wasp kernel: [   10.429847] R13: ffffffffc0671aa0 R14: 0000000000000005 R15: ffff9d9961f8cce0
Jun  4 15:30:40 wasp kernel: [   10.429848] FS:  0000000000000000(0000) GS:ffff9d9964240000(0000) knlGS:0000000000000000
Jun  4 15:30:40 wasp kernel: [   10.429848] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
Jun  4 15:30:40 wasp kernel: [   10.429849] CR2: 00005561398d3038 CR3: 000000014320a002 CR4: 00000000003606e0
Jun  4 15:30:40 wasp kernel: [   10.429849] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
Jun  4 15:30:40 wasp kernel: [   10.429850] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Jun  4 15:30:40 wasp kernel: [   10.429850] Call Trace:
Jun  4 15:30:40 wasp kernel: [   10.429853]  queue_delayed_work_on+0x11/0x20
Jun  4 15:30:40 wasp kernel: [   10.429855]  hda_codec_jack_check+0x94/0xa0 [snd_sof_intel_hda]
Jun  4 15:30:40 wasp kernel: [   10.429858]  hda_resume+0x14e/0x180 [snd_sof_intel_hda_common]
Jun  4 15:30:40 wasp kernel: [   10.429861]  ? pci_restore_standard_config+0x40/0x40
Jun  4 15:30:40 wasp kernel: [   10.429863]  sof_resume+0x129/0x470 [snd_sof]
Jun  4 15:30:40 wasp kernel: [   10.429864]  ? pci_restore_standard_config+0x40/0x40
Jun  4 15:30:40 wasp kernel: [   10.429865]  pci_pm_runtime_resume+0x6c/0xc0
Jun  4 15:30:40 wasp kernel: [   10.429867]  ? pci_restore_standard_config+0x30/0x40
Jun  4 15:30:40 wasp kernel: [   10.429868]  __rpm_callback+0xc1/0x120
Jun  4 15:30:40 wasp kernel: [   10.429869]  ? pci_restore_standard_config+0x40/0x40
Jun  4 15:30:40 wasp kernel: [   10.429870]  rpm_callback+0x18/0x80
Jun  4 15:30:40 wasp kernel: [   10.429871]  ? pci_restore_standard_config+0x40/0x40
Jun  4 15:30:40 wasp kernel: [   10.429872]  rpm_resume+0x4ea/0x670
Jun  4 15:30:40 wasp kernel: [   10.429873]  rpm_suspend+0x53b/0x650
Jun  4 15:30:40 wasp kernel: [   10.429875]  pm_runtime_work+0x82/0x90
Jun  4 15:30:40 wasp kernel: [   10.429876]  process_one_work+0x15d/0x3b0
Jun  4 15:30:40 wasp kernel: [   10.429877]  worker_thread+0x62/0x400
Jun  4 15:30:40 wasp kernel: [   10.429879]  ? rescuer_thread+0x340/0x340
Jun  4 15:30:40 wasp kernel: [   10.429880]  kthread+0x11e/0x150
Jun  4 15:30:40 wasp kernel: [   10.429882]  ? kthread_bind+0x10/0x10
Jun  4 15:30:40 wasp kernel: [   10.429884]  ret_from_fork+0x1f/0x40
Jun  4 15:30:40 wasp kernel: [   10.429885] ---[ end trace 722112b9053fe9bc ]---

I'm trying to recover the state, when I was getting those warnings to study them in a bit more detail.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It cost me about half a day, but now I have it. Basically you need something like:

diff --git a/include/sound/hda_codec.h b/include/sound/hda_codec.h
index cc7c8d4..4daf126 100644
--- a/include/sound/hda_codec.h
+++ b/include/sound/hda_codec.h
@@ -533,4 +533,6 @@ void snd_hda_codec_load_dsp_cleanup(struct hda_codec *codec,
 				struct snd_dma_buffer *dmab) {}
 #endif
 
+void hda_jackpoll_work(struct work_struct *work);
+
 #endif /* __SOUND_HDA_CODEC_H */
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index b20eb7f..5b70532 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -650,7 +650,7 @@ static void restore_shutup_pins(struct hda_codec *codec)
 }
 #endif
 
-static void hda_jackpoll_work(struct work_struct *work)
+void hda_jackpoll_work(struct work_struct *work)
 {
 	struct hda_codec *codec =
 		container_of(work, struct hda_codec, jackpoll_work.work);
@@ -664,6 +664,7 @@ static void hda_jackpoll_work(struct work_struct *work)
 	schedule_delayed_work(&codec->jackpoll_work,
 			      codec->jackpoll_interval);
 }
+EXPORT_SYMBOL_GPL(hda_jackpoll_work);
 
 /* release all pincfg lists */
 static void free_init_pincfgs(struct hda_codec *codec)
diff --git a/sound/soc/codecs/hdac_hda.h b/sound/soc/codecs/hdac_hda.h
index 6b1bd4f..e68be25 100644
--- a/sound/soc/codecs/hdac_hda.h
+++ b/sound/soc/codecs/hdac_hda.h
@@ -6,6 +6,8 @@
 #ifndef __HDAC_HDA_H__
 #define __HDAC_HDA_H__
 
+#include <sound/hda_codec.h>
+
 struct hdac_hda_pcm {
 	int stream_tag[2];
 	unsigned int format_val[2];
diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c
index 660e058..b961270 100644
--- a/sound/soc/codecs/hdac_hdmi.c
+++ b/sound/soc/codecs/hdac_hdmi.c
@@ -32,6 +32,7 @@
 #include <sound/hda_chmap.h>
 #include "../../hda/local.h"
 #include "hdac_hdmi.h"
+#include "hdac_hda.h"
 
 #define NAME_SIZE	32
 
@@ -1987,13 +1988,17 @@ static int hdac_hdmi_get_spk_alloc(struct hdac_device *hdev, int pcm_idx)
 
 static int hdac_hdmi_dev_probe(struct hdac_device *hdev)
 {
-	struct hdac_hdmi_priv *hdmi_priv = NULL;
+	struct hdac_hdmi_priv *hdmi_priv;
 	struct snd_soc_dai_driver *hdmi_dais = NULL;
-	struct hdac_ext_link *hlink = NULL;
+	struct hdac_ext_link *hlink;
 	int num_dais = 0;
 	int ret = 0;
 	struct hdac_driver *hdrv = drv_to_hdac_driver(hdev->dev.driver);
 	const struct hda_device_id *hdac_id = hdac_get_device_id(hdev, hdrv);
+	struct hdac_hda_priv *hda_priv = container_of(hdev, struct hdac_hda_priv, codec.core);
+
+	dev_info(&hdev->dev, "%s(): priv %p\n", __func__, hda_priv);
+	INIT_DELAYED_WORK(&hda_priv->codec.jackpoll_work, hda_jackpoll_work);
 
 	/* hold the ref while we probe */
 	hlink = snd_hdac_ext_bus_get_link(hdev->bus, dev_name(&hdev->dev));

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RanderWang I actually think it would be better to avoid setting WAKEEN bits for codecs like HDMI. Feel free to use this diff instead of the previous one:

diff --git a/sound/soc/sof/intel/hda-codec.c b/sound/soc/sof/intel/hda-codec.c
index 2ae7783..465d6cd 100644
--- a/sound/soc/sof/intel/hda-codec.c
+++ b/sound/soc/sof/intel/hda-codec.c
@@ -45,19 +45,15 @@ void hda_codec_jack_check(struct snd_sof_dev *sdev, int status)
 	struct hdac_bus *bus = sof_to_bus(sdev);
 	struct hda_codec *codec;
 
-	if (!status)
-		goto disable;
-
-	list_for_each_codec(codec, hbus)
-		if (status & (1 << codec->core.addr))
-			schedule_delayed_work(&codec->jackpoll_work,
-					      codec->jackpoll_interval);
-
-disable:
 	/* disable controller Wake Up event*/
 	snd_hdac_chip_writew(bus, WAKEEN,
 			     snd_hdac_chip_readw(bus, WAKEEN) &
 			     ~STATESTS_INT_MASK);
+
+	list_for_each_codec(codec, hbus)
+		if (status & (1 << codec->core.addr) && codec->jacktbl.used)
+			schedule_delayed_work(&codec->jackpoll_work,
+					      codec->jackpoll_interval);
 }
 #else
 void hda_codec_jack_check(struct snd_sof_dev *sdev, int status) {}
diff --git a/sound/soc/sof/intel/hda-dsp.c b/sound/soc/sof/intel/hda-dsp.c
index b4611e7..f1483c5 100644
--- a/sound/soc/sof/intel/hda-dsp.c
+++ b/sound/soc/sof/intel/hda-dsp.c
@@ -288,7 +288,9 @@ static int hda_suspend(struct snd_sof_dev *sdev, int state,
 	struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;
 	const struct sof_intel_dsp_desc *chip = hda->desc;
 #if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA)
+	struct hda_bus *hbus = sof_to_hbus(sdev);
 	struct hdac_bus *bus = sof_to_bus(sdev);
+	struct hda_codec *codec;
 #endif
 	int ret;
 
@@ -296,11 +298,17 @@ static int hda_suspend(struct snd_sof_dev *sdev, int state,
 	hda_dsp_ipc_int_disable(sdev);
 
 #if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA)
-	if (IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC) && runtime_suspend)
+	if (IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC) && runtime_suspend) {
+		unsigned int mask = 0;
+
+		list_for_each_codec(codec, hbus)
+			if (codec->jacktbl.used)
+				mask |= BIT(codec->core.addr);
+
 		/* enable controller wake up event */
 		snd_hdac_chip_writew(bus, WAKEEN,
-				     snd_hdac_chip_readw(bus, WAKEEN) |
-				     STATESTS_INT_MASK);
+				     snd_hdac_chip_readw(bus, WAKEEN) | mask);
+	}
 
 	/* power down all hda link */
 	snd_hdac_ext_bus_link_power_down_all(bus);

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! These warning message is caused by interrupt issue and I will validate it again on WASP with patch for interrupt. Thanks for your reference!


/* disable controller Wake Up event*/
snd_hdac_chip_writew(bus, WAKEEN,
snd_hdac_chip_readw(bus, WAKEEN) &
~hda->hda_codec_mask);
}
#else
void hda_codec_jack_check(struct snd_sof_dev *sdev, int status) {}
#endif /* CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC */
EXPORT_SYMBOL(hda_codec_jack_check);

/* probe individual codec */
static int hda_codec_probe(struct snd_sof_dev *sdev, int address)
{
struct hda_bus *hbus = sof_to_hbus(sdev);
struct hdac_device *hdev;
#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC)
struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;
struct hdac_hda_priv *hda_priv;
#endif
struct hda_bus *hbus = sof_to_hbus(sdev);
struct hdac_device *hdev;

u32 hda_cmd = (address << 28) | (AC_NODE_ROOT << 20) |
(AC_VERB_PARAMETERS << 8) | AC_PAR_VENDOR_ID;
u32 resp = -1;
Expand Down Expand Up @@ -76,6 +116,7 @@ static int hda_codec_probe(struct snd_sof_dev *sdev, int address)
/* use legacy bus only for HDA codecs, idisp uses ext bus */
if ((resp & 0xFFFF0000) != IDISP_VID_INTEL) {
hdev->type = HDA_DEV_LEGACY;
hda->hda_codec_mask |= BIT(address);
hda_codec_load_module(&hda_priv->codec);
}

Expand Down
51 changes: 33 additions & 18 deletions sound/soc/sof/intel/hda-dsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,8 @@ void hda_dsp_ipc_int_disable(struct snd_sof_dev *sdev)
HDA_DSP_REG_HIPCCTL_BUSY | HDA_DSP_REG_HIPCCTL_DONE, 0);
}

static int hda_suspend(struct snd_sof_dev *sdev, int state)
static int hda_suspend(struct snd_sof_dev *sdev, int state,
bool runtime_suspend)
{
struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;
const struct sof_intel_dsp_desc *chip = hda->desc;
Expand All @@ -295,6 +296,12 @@ static int hda_suspend(struct snd_sof_dev *sdev, int state)
hda_dsp_ipc_int_disable(sdev);

#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA)
if (IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC) && runtime_suspend)
/* enable controller wake up event */
snd_hdac_chip_writew(bus, WAKEEN,
snd_hdac_chip_readw(bus, WAKEEN) |
hda->hda_codec_mask);

/* power down all hda link */
snd_hdac_ext_bus_link_power_down_all(bus);
#endif
Expand Down Expand Up @@ -329,11 +336,12 @@ static int hda_suspend(struct snd_sof_dev *sdev, int state)
return 0;
}

static int hda_resume(struct snd_sof_dev *sdev)
static int hda_resume(struct snd_sof_dev *sdev, bool runtime_resume)
{
#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA)
struct hdac_bus *bus = sof_to_bus(sdev);
struct hdac_ext_link *hlink = NULL;
int status;
#endif
int ret;

Expand All @@ -344,6 +352,11 @@ static int hda_resume(struct snd_sof_dev *sdev)
snd_sof_pci_update_bits(sdev, PCI_TCSEL, 0x07, 0);

#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA)
if (runtime_resume) {
/* read STATESTS before controller reset */
status = snd_hdac_chip_readw(bus, STATESTS);
}

/* reset and start hda controller */
ret = hda_dsp_ctrl_init_chip(sdev, true);
if (ret < 0) {
Expand All @@ -359,6 +372,20 @@ static int hda_resume(struct snd_sof_dev *sdev)
bus->io_ops->reg_writel(0, hlink->ml_addr + AZX_REG_ML_LOSIDV);

hda_dsp_ctrl_misc_clock_gating(sdev, true);

/* check jack status based on controller status */
if (runtime_resume)
hda_codec_jack_check(sdev, status);

/* turn off the links that were off before suspend */
list_for_each_entry(hlink, &bus->hlink_list, list) {
if (!hlink->ref_count)
snd_hdac_ext_bus_link_power_down(hlink);
}

/* check dma status and clean up CORB/RIRB buffers */
if (!bus->cmd_dma_state)
snd_hdac_bus_stop_cmd_io(bus);
#else

hda_dsp_ctrl_misc_clock_gating(sdev, false);
Expand Down Expand Up @@ -391,37 +418,25 @@ static int hda_resume(struct snd_sof_dev *sdev)
hda_dsp_ctrl_ppcap_enable(sdev, true);
hda_dsp_ctrl_ppcap_int_enable(sdev, true);

#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA)
/* turn off the links that were off before suspend */
list_for_each_entry(hlink, &bus->hlink_list, list) {
if (!hlink->ref_count)
snd_hdac_ext_bus_link_power_down(hlink);
}

/* check dma status and clean up CORB/RIRB buffers */
if (!bus->cmd_dma_state)
snd_hdac_bus_stop_cmd_io(bus);
#endif

return 0;
}

int hda_dsp_resume(struct snd_sof_dev *sdev)
{
/* init hda controller. DSP cores will be powered up during fw boot */
return hda_resume(sdev);
return hda_resume(sdev, false);
}

int hda_dsp_runtime_resume(struct snd_sof_dev *sdev)
{
/* init hda controller. DSP cores will be powered up during fw boot */
return hda_resume(sdev);
return hda_resume(sdev, true);
}

int hda_dsp_runtime_suspend(struct snd_sof_dev *sdev, int state)
{
/* stop hda controller and power dsp off */
return hda_suspend(sdev, state);
return hda_suspend(sdev, state, true);
}

int hda_dsp_suspend(struct snd_sof_dev *sdev, int state)
Expand All @@ -430,7 +445,7 @@ int hda_dsp_suspend(struct snd_sof_dev *sdev, int state)
int ret;

/* stop hda controller and power dsp off */
ret = hda_suspend(sdev, state);
ret = hda_suspend(sdev, state, false);
if (ret < 0) {
dev_err(bus->dev, "error: suspending dsp\n");
return ret;
Expand Down
4 changes: 4 additions & 0 deletions sound/soc/sof/intel/hda.h
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,9 @@ struct sof_intel_hda_dev {

/* DMIC device */
struct platform_device *dmic_dev;

/* hda codec mask excluding hdmi */
u32 hda_codec_mask;
Copy link
Collaborator

@lyakh lyakh Jun 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RanderWang @plbossart @ranj063 Is this really needed? Wouldn't it be enough to check codec->jacktbl.used?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hda_codec_mask is used by enable & disable WAKEEN, please check other change in the PR. codec->jacktbl.used is not available.

};

static inline struct hdac_bus *sof_to_bus(struct snd_sof_dev *s)
Expand Down Expand Up @@ -550,6 +553,7 @@ void sof_hda_bus_init(struct hdac_bus *bus, struct device *dev,
* HDA Codec operations.
*/
int hda_codec_probe_bus(struct snd_sof_dev *sdev);
void hda_codec_jack_check(struct snd_sof_dev *sdev, int status);

#endif /* CONFIG_SND_SOC_SOF_HDA */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please leave the empty line between prototype and #endif

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, I will refine it


Expand Down