ASoC: SOF: Intel: hda: refine suspend with stop chip#975
Conversation
sound/soc/sof/intel/hda-ctrl.c
Outdated
| snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, SOF_HDA_INTCTL, | ||
| SOF_HDA_INT_ALL_STREAM, 0); | ||
|
|
||
| /* disable hda bus irq */ |
There was a problem hiding this comment.
disable controller CIE and GIE
There was a problem hiding this comment.
no, not disable CIE and GIE, please check this commit torvalds@7d4f606.
Codec can send out INT or wake up controller depending on whether CIE or GIE enabled.(Figure 4, Interupt structure).
There was a problem hiding this comment.
@RanderWang Please check
azx_stop_chip
=>snd_hdac_bus_stop_chip
==>azx_int_disable
There was a problem hiding this comment.
yes, I tried this PR with my 983 PR for headphone detection on whiskylake. Headphone detection worked with it.
| /* disable CORB/RIRB */ | ||
| snd_hdac_bus_stop_cmd_io(bus); | ||
|
|
||
| /* disable position buffer */ |
There was a problem hiding this comment.
is this really dependent on SOF_HDA? This is the position buffer that we can use even for NOCODEC for DPIB.
There was a problem hiding this comment.
@plbossart OK, thanks for confirm, I will still follow a PR with change the same in hda_dsp_ctrl_init_chip.
There was a problem hiding this comment.
It was a question, have you confirmed if yes/no this code is needed for NOCODEC?
And if yes, then the fix is incorrect since you are using snd_hdac_chip_writel() so introduced a dependency on hdac.
There was a problem hiding this comment.
@plbossart Yes, I am confirm that this is needed for NOCODEC. for position buffer is according to HDA stream. What ever codec is using, the position buffer need to be set at beginning and reset at end. It is only that NOCODEC will not cause a issue if not set.
I will update the snd_hdac_chip_writel with SOF functions, thanks!
dd69928 to
f1fff35
Compare
|
@plbossart updated |
f1fff35 to
f19fe55
Compare
|
@plbossart I think this can be merged? |
|
this is going to conflict with @RanderWang changes, and I'd like his PR to go in first. |
There was a problem hiding this comment.
The first commit message doesn't explain why the change is needed.
The description of third commit (for example "If CONFIG_SND_SOC_SOF_HDA is
defined, also disable the CORB/RIRB, and stop i/o.") should go to the second commit as that's where the new stop i/o is added.
In general this looks good and helps with readability.
f19fe55 to
ab34e87
Compare
|
@plbossart @kv2019i Updated, thanks for your suggestions! |
kv2019i
left a comment
There was a problem hiding this comment.
Thanks, the commits are now better, but e.g. the last commit still needs work. How about
First:
Unify ppcap function setup by using SOF common functions for both
HDA and non-HDA cases.
Second:
Add common hda_dsp_ctrl_stop_chip() function to stop controller with
the same function handling both HDA and non-HDA cases. This function
disables IRQs and clears status masks. When CONFIG_SND_SOC_SOF_HDA
is defined, also disables the CORB/RIRB, and stops i/o.
Third:
Unify suspend code by using SOF common function
hda_dsp_ctrl_stop_chip() which can handle both HDA and non-HDA cases.
Unify ppcap function setup by using SOF common functions for both HDA and non-HDA cases. Signed-off-by: Zhu Yingjiang <yingjiang.zhu@linux.intel.com>
Add common hda_dsp_ctrl_stop_chip() function to stop controller with the same function handling both HDA and non-HDA cases. This function disables IRQs and clears status masks. When CONFIG_SND_SOC_SOF_HDA is defined, also disables the CORB/RIRB, and stops i/o. Signed-off-by: Zhu Yingjiang <yingjiang.zhu@linux.intel.com>
Unify suspend code by using SOF common function hda_dsp_ctrl_stop_chip() which can handle both HDA and non-HDA cases. Signed-off-by: Zhu Yingjiang <yingjiang.zhu@linux.intel.com>
ab34e87 to
6322320
Compare
|
@kv2019i Updated, thanks for your suggestion! |
kv2019i
left a comment
There was a problem hiding this comment.
Thank you, looks good now!
Define a SOF hda_dsp_ctrl_stop_chip and use this in hda_suspend, so the disable and clear HDA irq and stream irqs steps all called during the suspend. Codec and HDA link related registers are write if CONFIG_SND_SOC_SOF_HDA is true.
Use the SOF defined ppcap functions in hda_suspend/hda_resume.