On some Lenovo and HP laptops, if both codec driver and SOF driver
are in runtime suspend mode, we plug a headset to the audio jack,
the headphone could be detected but Mic couldn't.
That is because when plugging, the headphone triggers a unsol event
first, and about 0.7s later (on the Lenovo X1 Carbon 7th), the Mic
triggers a unsol event. But if the codec driver enters runtime suspend
within 0.7s, the Mic can't trigger the unsol event.
If we don't set autosuspend_delay to a non-zero value for the hda codec
driver, it will enter runtime suspend immediately after the headphone
triggers the unsol event.
Follow the sequence of legacy hda driver and set a autosuspend delay
of 1sec after card registration (refer to pci/hda/hda_intel.c and
pci/hda/hda_codec.c).
Signed-off-by: Hui Wang <email address hidden>
Co-developed-by: Kai Vehmanen <email address hidden>
Signed-off-by: Kai Vehmanen <email address hidden>
Co-developed-by: Jaska Uimonen <email address hidden>
Signed-off-by: Jaska Uimonen <email address hidden>
(backported from commit 22d5e98fe5cf82e842fb025d59d6edcf9f03a528
git://github.com/thesofproject/linux.git)
Signed-off-by: Hui Wang <email address hidden>
Signed-off-by: AceLan Kao <email address hidden>
Originally, driver do IQK after auth/assoc, but it's doing 4-way handshake
if we connect to an AP with WPA2 security. Since 11N chips use software IQK
that causes more than 100ms, so IQK and 4-way handshake can be overlap, then
4-way handshake may be failed. To resolve this issue, move IQK prior to
issue auth.