aboutsummaryrefslogtreecommitdiff
path: root/lib/libypclnt/ypclnt_get.c
diff options
context:
space:
mode:
authorDavid Bidner <david@crap.solutions>2026-11-05 12:28:15 +0000
committerChristos Margiolis <christos@FreeBSD.org>2026-11-05 12:28:15 +0000
commit43bbd71ac785fcc4ee39a8c0ef29d59fcb8c2a3c (patch)
treefaa37b5b9280bc5c7d817ff641a75e22899b3ecf /lib/libypclnt/ypclnt_get.c
parent56b4e685d0fefd8ae99d815741cad2acb4a21694 (diff)
snd_hda: wake display audio and restore amplifier settingsHEADmain
An Intel display-audio codec was observed to remain in D3 after monitor sleep on DragonFly BSD. Starting a new stream then produced no sound, and waking the codec alone left the output pin amplifier muted and other function configuration unrestored. Read the audio function power state at stream start. If its requested or actual state is not D0, use the existing power-up routine before configuring and starting the stream, then restore the function to a known state: Restore selectors, pins, EAPD, GPIO/GPO and direct codec patches, then replay the cached gain and mute values once the pins are configured. Split widget configuration out of hdaa_audio_commit() into hdaa_audio_widget_commit() so the wake path can reuse it without reinitializing the cached amplifier values. Preserve the existing volume, mute and forced-mute values. Re-enable unsolicited responses, refresh ELD, and run jack presence handling for playback pins. Skip the full presence handler for recording pins only: its recording path can drop the driver lock to update the recording source, which is not safe while starting a stream with the channel lock held. The playback path does not drop the driver lock, so it is safe to run here, and it is what matters for display audio, whose pins belong to playback associations. GET_POWER_STATE reports the actual state in ACT (bits 7:4) and the requested state in SET (bits 3:0). They can differ during a transition. Checking both avoids skipping the D0 request when the function is still actually in D0 but has been requested to power down, or when D0 has been requested but the actual state has not reached D0 yet. The observed post-sleep response on DragonFly was 0x233, with both fields reporting D3. Despite their names, HDAA_AMP_MUTE_DEFAULT (0xffffffff) and HDAA_AMP_VOL_DEFAULT (-1) are sentinels meaning "keep the cached setting" in hdaa_audio_ctl_amp_set(). Passing them leaves ctl->muted, ctl->left and ctl->right unchanged, then writes the cached values to the hardware while respecting ctl->forcemute. It does not select factory defaults or unconditionally unmute the output. Preserve the existing behavior when the power-state query returns HDA_INVALID or both fields already report D0, and leave the D0 fast path and invalid power-state query handling unchanged. The observed wake-only silence and amplifier recovery were seen on DragonFly BSD. This FreeBSD adaptation has not been validated on FreeBSD hardware. PR: 299139 MFC after: 2 weeks Reviewed by: christos Pull-Request: https://github.com/freebsd/freebsd-src/pull/2464
Diffstat (limited to 'lib/libypclnt/ypclnt_get.c')
0 files changed, 0 insertions, 0 deletions