summaryrefslogtreecommitdiff
path: root/sound/soc/meson/aiu.c
diff options
context:
space:
mode:
authorJerome Brunet <jbrunet@baylibre.com>2020-02-13 16:51:55 +0100
committerMark Brown <broonie@kernel.org>2020-02-13 20:57:23 +0000
commitb82b734c0e9a75e1b956214ac523a8eb590f51f3 (patch)
tree78eb6e14cda1e483df86d917d590bb6fcc6f9145 /sound/soc/meson/aiu.c
parent6ae9ca9ce986bffe71fd0fbf9595de8500891b52 (diff)
ASoC: meson: aiu: add hdmi codec control support
Add the codec to codec component which handles the routing between the audio producers (PCM and I2S) and the synopsys hdmi controller on the amlogic GX SoC family Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> Link: https://lore.kernel.org/r/20200213155159.3235792-6-jbrunet@baylibre.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/meson/aiu.c')
-rw-r--r--sound/soc/meson/aiu.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/sound/soc/meson/aiu.c b/sound/soc/meson/aiu.c
index a62aced9b687..b765dfb70726 100644
--- a/sound/soc/meson/aiu.c
+++ b/sound/soc/meson/aiu.c
@@ -71,6 +71,26 @@ int aiu_of_xlate_dai_name(struct snd_soc_component *component,
return 0;
}
+int aiu_add_component(struct device *dev,
+ const struct snd_soc_component_driver *component_driver,
+ struct snd_soc_dai_driver *dai_drv,
+ int num_dai,
+ const char *debugfs_prefix)
+{
+ struct snd_soc_component *component;
+
+ component = devm_kzalloc(dev, sizeof(*component), GFP_KERNEL);
+ if (!component)
+ return -ENOMEM;
+
+#ifdef CONFIG_DEBUG_FS
+ component->debugfs_prefix = debugfs_prefix;
+#endif
+
+ return snd_soc_add_component(dev, component, component_driver,
+ dai_drv, num_dai);
+}
+
static int aiu_cpu_of_xlate_dai_name(struct snd_soc_component *component,
struct of_phandle_args *args,
const char **dai_name)
@@ -313,9 +333,21 @@ static int aiu_probe(struct platform_device *pdev)
ret = snd_soc_register_component(dev, &aiu_cpu_component,
aiu_cpu_dai_drv,
ARRAY_SIZE(aiu_cpu_dai_drv));
- if (ret)
+ if (ret) {
dev_err(dev, "Failed to register cpu component\n");
+ return ret;
+ }
+ /* Register the hdmi codec control component */
+ ret = aiu_hdmi_ctrl_register_component(dev);
+ if (ret) {
+ dev_err(dev, "Failed to register hdmi control component\n");
+ goto err;
+ }
+
+ return 0;
+err:
+ snd_soc_unregister_component(dev);
return ret;
}