drm: adv7511_audio: Add .get_dai_id callback to map port number to dai id
authorJohn Stultz <john.stultz@linaro.org>
Tue, 13 Jun 2017 21:59:49 +0000 (14:59 -0700)
committerMark Brown <broonie@kernel.org>
Wed, 28 Jun 2017 20:00:08 +0000 (21:00 +0100)
commit7204e97685634813d8456f1900b7f38fa7701e60
treef442222210631b50bec4b4c47a117319dbaf9878
parente3839bd6f56a291f00a4c3737eb15ca0344a82a9
drm: adv7511_audio: Add .get_dai_id callback to map port number to dai id

ALSA SoC needs to know connected DAI ID for probing. Using
the new audio-card-graph approach, ports/endpoints are used
to describe how the links are connected. Unfortunately, since
ports/endpoints are used as well for video linkages, there
are some issues mixing the port ids to the two (video and
audio) namespaces.

To solve this issue, this patch adds new .get_dai_id callback
on hdmi_codec_ops.

The will assume that HDMI audio out will be connected to
reg = <2>. This will then be remapped to the ALSA SoC side will
as DAI 0. Allowing the adv7511's hdmi audio support to be used
with the audio-card-graph.

Credit to Kuninori Morimoto who's patch to dw-hdmi-i2s-audio.c
was what this was mostly copy-pasted from.

Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Archit Taneja <architt@codeaurora.org>
Cc: Mark Brown <broonie@kernel.org>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: David Airlie <airlied@linux.ie>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Documentation/devicetree/bindings/display/bridge/adi,adv7511.txt
drivers/gpu/drm/bridge/adv7511/adv7511_audio.c