OSDN Git Service

drm/vc4: hdmi: Retrieve the vc4_hdmi at unbind using our device
authorMaxime Ripard <maxime@cerno.tech>
Thu, 3 Sep 2020 08:01:19 +0000 (10:01 +0200)
committerMaxime Ripard <maxime@cerno.tech>
Mon, 7 Sep 2020 16:05:33 +0000 (18:05 +0200)
commit47c167b757638e747717ab7e5d7e8803c446d943
tree59913406a0fd1ae4ac2e68c02fa978a97113b4dc
parent66bf1c30e0e5bcc9d6965157a8581f36577c45a4
drm/vc4: hdmi: Retrieve the vc4_hdmi at unbind using our device

The unbind function needs to retrieve a vc4_hdmi structure pointer through
the struct device that we're given since we want to support multiple HDMI
controllers.

However, our optional ASoC support doesn't make that trivial since it will
overwrite the device drvdata if we use it, but obviously won't if we don't
use it.

Let's make sure the fields are at the proper offset to be able to cast
between the snd_soc_card structure and the vc4_hdmi structure
transparently so we can support both cases.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Tested-by: Chanwoo Choi <cw00.choi@samsung.com>
Tested-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
Tested-by: Stefan Wahren <stefan.wahren@i2se.com>
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://patchwork.freedesktop.org/patch/msgid/717082cba06b5c06280f26c56c08aee512365ed3.1599120059.git-series.maxime@cerno.tech
drivers/gpu/drm/vc4/vc4_hdmi.c
drivers/gpu/drm/vc4/vc4_hdmi.h