drm/radeon: Add HD-audio component notifier support (v2)
authorTakashi Iwai <tiwai@suse.de>
Mon, 22 Jul 2019 14:38:14 +0000 (16:38 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 14 Jan 2022 23:08:20 +0000 (18:08 -0500)
commit5c70163edf40b5a1678c812bf42cd9a1b45a43ec
tree8007a53cc90bb5412a40001b16631942c2abc5f6
parent94ccc1a6f8f2cf81410ee0fe6f75f8d7f61b9bc7
drm/radeon: Add HD-audio component notifier support (v2)

This patch adds the support for the notification of HD-audio hotplug
via the already existing drm_audio_component framework to radeon
driver.  This allows us more reliable hotplug notification and ELD
transfer without accessing HD-audio bus; it's more efficient, and more
importantly, it works without waking up the runtime PM.

The implementation is rather simplistic: radeon driver provides the
get_eld ops for HD-audio, and it notifies the audio hotplug via
pin_eld_notify callback upon each radeon_audio_enable() call.
The pin->id is referred as the port number passed to the notifier
callback, and the corresponding connector is looked through the
encoder list in the get_eld callback in turn.

The bind and unbind callbacks handle the device-link so that it
assures the PM call order.

v2: fix the logic in radeon_audio_component_get_eld to walk the
connector list since that is where the EDID lives and we can
derive the encoder from the connector because the encoder has
not been assigned at this point (i.e., during monitor probe).

Acked-by: Jim Qu <Jim.Qu@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/Kconfig
drivers/gpu/drm/radeon/radeon.h
drivers/gpu/drm/radeon/radeon_audio.c