drm/mediatek: support HDMI jack status reporting
authorTzung-Bi Shih <tzungbi@google.com>
Thu, 6 Feb 2020 03:17:51 +0000 (11:17 +0800)
committerMark Brown <broonie@kernel.org>
Tue, 11 Feb 2020 11:48:00 +0000 (11:48 +0000)
commit5d3c644773925c3568617435e42a9404a114c428
treed1ba494f9e3f71ec519f53bf8433537682be70b9
parentf9eb06cd0cdd50a3125bc9c62cdc997dc461eae7
drm/mediatek: support HDMI jack status reporting

1.
Provides a callback (i.e. mtk_hdmi_audio_hook_plugged_cb) to hdmi-codec.
When ASoC machine driver calls hdmi_codec_set_jack_detect(), the
callback will be invoked to save plugged_cb and codec_dev parameters.

+---------+  set_jack_  +------------+ plugged_cb  +----------+
| machine | ----------> | hdmi-codec | ----------> | mtk-hdmi |
+---------+  detect()   +------------+ codec_dev   +----------+

2.
When there is any jack status changes, mtk-hdmi will call the
plugged_cb() to notify hdmi-codec.  And then hdmi-codec will call
snd_soc_jack_report().

+----------+ plugged_cb  +------------+
| mtk-hdmi | ----------> | hdmi-codec | -> snd_soc_jack_report()
+----------+ codec_dev   +------------+
             connector_status

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200206102509.2.I230fd59de28e73934a91cb01424e25b9e84727f4@changeid
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/gpu/drm/mediatek/mtk_hdmi.c