diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2017-05-18 01:40:20 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-05-24 18:45:29 +0100 |
commit | 96203fb4237bf70f0fd0fa307ca2975077db3ceb (patch) | |
tree | 9641ed8df0d72e910b568d81a0fda0bd6d2bd08b /sound/soc/codecs/hdmi-codec.c | |
parent | 24069b589b02cc1292761b0f72623dd50ad1e19c (diff) | |
download | linux-stable-96203fb4237bf70f0fd0fa307ca2975077db3ceb.tar.gz linux-stable-96203fb4237bf70f0fd0fa307ca2975077db3ceb.tar.bz2 linux-stable-96203fb4237bf70f0fd0fa307ca2975077db3ceb.zip |
ASoC: hdmi-codec: add .get_dai_id support
ALSA SoC needs to know connected DAI ID for probing.
It is not a big problem if device/driver was only for sound,
but getting DAI ID will be difficult if device includes both
Video/Sound, like HDMI.
To solve this issue, this patch adds new .get_dai_id callback
on hdmi_codec_ops
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/hdmi-codec.c')
-rw-r--r-- | sound/soc/codecs/hdmi-codec.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c index 8659b76b066a..6d05161b625d 100644 --- a/sound/soc/codecs/hdmi-codec.c +++ b/sound/soc/codecs/hdmi-codec.c @@ -719,6 +719,18 @@ static const struct snd_soc_dai_driver hdmi_spdif_dai = { .pcm_new = hdmi_codec_pcm_new, }; +static int hdmi_of_xlate_dai_id(struct snd_soc_component *component, + struct device_node *endpoint) +{ + struct hdmi_codec_priv *hcp = snd_soc_component_get_drvdata(component); + int ret = -ENOTSUPP; /* see snd_soc_get_dai_id() */ + + if (hcp->hcd.ops->get_dai_id) + ret = hcp->hcd.ops->get_dai_id(component, endpoint); + + return ret; +} + static struct snd_soc_codec_driver hdmi_codec = { .component_driver = { .controls = hdmi_controls, @@ -727,6 +739,7 @@ static struct snd_soc_codec_driver hdmi_codec = { .num_dapm_widgets = ARRAY_SIZE(hdmi_widgets), .dapm_routes = hdmi_routes, .num_dapm_routes = ARRAY_SIZE(hdmi_routes), + .of_xlate_dai_id = hdmi_of_xlate_dai_id, }, }; |