diff options
-rw-r--r-- | include/sound/hdmi-codec.h | 9 | ||||
-rw-r--r-- | sound/soc/codecs/hdmi-codec.c | 13 |
2 files changed, 22 insertions, 0 deletions
diff --git a/include/sound/hdmi-codec.h b/include/sound/hdmi-codec.h index 915c4357945c..9483c55f871b 100644 --- a/include/sound/hdmi-codec.h +++ b/include/sound/hdmi-codec.h | |||
@@ -18,9 +18,11 @@ | |||
18 | #ifndef __HDMI_CODEC_H__ | 18 | #ifndef __HDMI_CODEC_H__ |
19 | #define __HDMI_CODEC_H__ | 19 | #define __HDMI_CODEC_H__ |
20 | 20 | ||
21 | #include <linux/of_graph.h> | ||
21 | #include <linux/hdmi.h> | 22 | #include <linux/hdmi.h> |
22 | #include <drm/drm_edid.h> | 23 | #include <drm/drm_edid.h> |
23 | #include <sound/asoundef.h> | 24 | #include <sound/asoundef.h> |
25 | #include <sound/soc.h> | ||
24 | #include <uapi/sound/asound.h> | 26 | #include <uapi/sound/asound.h> |
25 | 27 | ||
26 | /* | 28 | /* |
@@ -87,6 +89,13 @@ struct hdmi_codec_ops { | |||
87 | */ | 89 | */ |
88 | int (*get_eld)(struct device *dev, void *data, | 90 | int (*get_eld)(struct device *dev, void *data, |
89 | uint8_t *buf, size_t len); | 91 | uint8_t *buf, size_t len); |
92 | |||
93 | /* | ||
94 | * Getting DAI ID | ||
95 | * Optional | ||
96 | */ | ||
97 | int (*get_dai_id)(struct snd_soc_component *comment, | ||
98 | struct device_node *endpoint); | ||
90 | }; | 99 | }; |
91 | 100 | ||
92 | /* HDMI codec initalization data */ | 101 | /* HDMI codec initalization data */ |
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 = { | |||
719 | .pcm_new = hdmi_codec_pcm_new, | 719 | .pcm_new = hdmi_codec_pcm_new, |
720 | }; | 720 | }; |
721 | 721 | ||
722 | static int hdmi_of_xlate_dai_id(struct snd_soc_component *component, | ||
723 | struct device_node *endpoint) | ||
724 | { | ||
725 | struct hdmi_codec_priv *hcp = snd_soc_component_get_drvdata(component); | ||
726 | int ret = -ENOTSUPP; /* see snd_soc_get_dai_id() */ | ||
727 | |||
728 | if (hcp->hcd.ops->get_dai_id) | ||
729 | ret = hcp->hcd.ops->get_dai_id(component, endpoint); | ||
730 | |||
731 | return ret; | ||
732 | } | ||
733 | |||
722 | static struct snd_soc_codec_driver hdmi_codec = { | 734 | static struct snd_soc_codec_driver hdmi_codec = { |
723 | .component_driver = { | 735 | .component_driver = { |
724 | .controls = hdmi_controls, | 736 | .controls = hdmi_controls, |
@@ -727,6 +739,7 @@ static struct snd_soc_codec_driver hdmi_codec = { | |||
727 | .num_dapm_widgets = ARRAY_SIZE(hdmi_widgets), | 739 | .num_dapm_widgets = ARRAY_SIZE(hdmi_widgets), |
728 | .dapm_routes = hdmi_routes, | 740 | .dapm_routes = hdmi_routes, |
729 | .num_dapm_routes = ARRAY_SIZE(hdmi_routes), | 741 | .num_dapm_routes = ARRAY_SIZE(hdmi_routes), |
742 | .of_xlate_dai_id = hdmi_of_xlate_dai_id, | ||
730 | }, | 743 | }, |
731 | }; | 744 | }; |
732 | 745 | ||