Lines Matching +full:aiu +full:- +full:gxl

1 // SPDX-License-Identifier: GPL-2.0
13 #include <sound/soc-dai.h>
15 #include <dt-bindings/sound/meson-aiu.h>
16 #include "aiu.h"
17 #include "aiu-fifo.h"
52 if (args->args_count != 2) in aiu_of_xlate_dai_name()
53 return -EINVAL; in aiu_of_xlate_dai_name()
55 if (args->args[0] != component_id) in aiu_of_xlate_dai_name()
56 return -EINVAL; in aiu_of_xlate_dai_name()
58 id = args->args[1]; in aiu_of_xlate_dai_name()
60 if (id < 0 || id >= component->num_dai) in aiu_of_xlate_dai_name()
61 return -EINVAL; in aiu_of_xlate_dai_name()
66 id--; in aiu_of_xlate_dai_name()
69 *dai_name = dai->driver->name; in aiu_of_xlate_dai_name()
83 struct aiu *aiu = snd_soc_component_get_drvdata(component); in aiu_cpu_component_probe() local
86 return clk_prepare_enable(aiu->i2s.clks[PCLK].clk); in aiu_cpu_component_probe()
91 struct aiu *aiu = snd_soc_component_get_drvdata(component); in aiu_cpu_component_remove() local
93 clk_disable_unprepare(aiu->i2s.clks[PCLK].clk); in aiu_cpu_component_remove()
97 .name = "AIU CPU",
188 return -ENOMEM; in aiu_clk_bulk_get()
197 interface->clks = clks; in aiu_clk_bulk_get()
198 interface->clk_num = num; in aiu_clk_bulk_get()
217 struct aiu *aiu = dev_get_drvdata(dev); in aiu_clk_get() local
220 aiu->pclk = devm_clk_get(dev, "pclk"); in aiu_clk_get()
221 if (IS_ERR(aiu->pclk)) { in aiu_clk_get()
222 if (PTR_ERR(aiu->pclk) != -EPROBE_DEFER) in aiu_clk_get()
223 dev_err(dev, "Can't get the aiu pclk\n"); in aiu_clk_get()
224 return PTR_ERR(aiu->pclk); in aiu_clk_get()
227 aiu->spdif_mclk = devm_clk_get(dev, "spdif_mclk"); in aiu_clk_get()
228 if (IS_ERR(aiu->spdif_mclk)) { in aiu_clk_get()
229 if (PTR_ERR(aiu->spdif_mclk) != -EPROBE_DEFER) in aiu_clk_get()
230 dev_err(dev, "Can't get the aiu spdif master clock\n"); in aiu_clk_get()
231 return PTR_ERR(aiu->spdif_mclk); in aiu_clk_get()
235 &aiu->i2s); in aiu_clk_get()
237 if (ret != -EPROBE_DEFER) in aiu_clk_get()
243 &aiu->spdif); in aiu_clk_get()
245 if (ret != -EPROBE_DEFER) in aiu_clk_get()
250 ret = clk_prepare_enable(aiu->pclk); in aiu_clk_get()
258 aiu->pclk); in aiu_clk_get()
267 struct device *dev = &pdev->dev; in aiu_probe()
270 struct aiu *aiu; in aiu_probe() local
273 aiu = devm_kzalloc(dev, sizeof(*aiu), GFP_KERNEL); in aiu_probe()
274 if (!aiu) in aiu_probe()
275 return -ENOMEM; in aiu_probe()
277 aiu->platform = device_get_match_data(dev); in aiu_probe()
278 if (!aiu->platform) in aiu_probe()
279 return -ENODEV; in aiu_probe()
281 platform_set_drvdata(pdev, aiu); in aiu_probe()
285 if (ret != -EPROBE_DEFER) in aiu_probe()
301 aiu->i2s.irq = platform_get_irq_byname(pdev, "i2s"); in aiu_probe()
302 if (aiu->i2s.irq < 0) in aiu_probe()
303 return aiu->i2s.irq; in aiu_probe()
305 aiu->spdif.irq = platform_get_irq_byname(pdev, "spdif"); in aiu_probe()
306 if (aiu->spdif.irq < 0) in aiu_probe()
307 return aiu->spdif.irq; in aiu_probe()
313 /* Register the cpu component of the aiu */ in aiu_probe()
329 /* Register the internal dac control component on gxl */ in aiu_probe()
330 if (aiu->platform->has_acodec) { in aiu_probe()
347 snd_soc_unregister_component(&pdev->dev); in aiu_remove()
368 { .compatible = "amlogic,aiu-gxbb", .data = &aiu_gxbb_pdata },
369 { .compatible = "amlogic,aiu-gxl", .data = &aiu_gxl_pdata },
370 { .compatible = "amlogic,aiu-meson8", .data = &aiu_meson8_pdata },
371 { .compatible = "amlogic,aiu-meson8b", .data = &aiu_meson8_pdata },
380 .name = "meson-aiu",
386 MODULE_DESCRIPTION("Meson AIU Driver");