FROMLIST: ASoC: hdmi-codec: callback function will be called with private data
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Fri, 24 Jun 2016 02:47:55 +0000 (02:47 +0000)
committerYakir Yang <ykk@rock-chips.com>
Wed, 20 Jul 2016 02:26:21 +0000 (10:26 +0800)
commit63de7b75163859c0181426f63b3af48588108712
tree2722f063c06825efef701b66370f6f2d4995e626
parent9b93e8d7b622ed8c2e6050a9915a60c845a7c831
FROMLIST: ASoC: hdmi-codec: callback function will be called with private data

Current hdmi-codec driver is assuming that it will be registered
from HDMI driver. Because of this assumption, each callback function
has struct device pointer which is parent device (= HDMI).
Then, it can use dev_get_drvdata() to get private data.

OTOH, on some SoC/HDMI case, SoC has VIDEO/SOUND and HDMI IPs.
This case, it needs SoC VIDEO, SoC SOUND and HDMI video, HDMI codec
driver. In DesignWare HDMI IP case, SoC VIDEO (= DRM/KMS) driver tries
to bind DesignWare HDMI video driver, and HDMI codec driver
(= hdmi-codec). This case, above "parent device" of HDMI codec driver
is DRM/KMS driver and its "device" already has private data.

And, from DT and ASoC CPU/Codec/Card binding point of view, HDMI codec
(= hdmi-codec) needs to have "parent device" (= DRM/KMS), otherwise,
it never detect sound card.

Because of these reasons, some driver can't use dev_get_drvdata() to
get private data on hdmi-codec driver. This patch add new void pointer
on hdmi_codec_pdata for private data, and callback function will be
called with it.

Change-Id: Ic7f4bb6cc06b5f7ce9a5a60f54566a780ddf1f65
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
(am form https://patchwork.kernel.org/patch/9196459/)
include/sound/hdmi-codec.h
sound/soc/codecs/hdmi-codec.c