Lines Matching +full:mclk +full:- +full:fs
1 // SPDX-License-Identifier: GPL-2.0-or-later
14 #include <sound/soc-dapm.h>
17 #include "mxs-saif.h"
26 u32 mclk; in mxs_sgtl5000_hw_params() local
29 /* sgtl5000 does not support 512*rate when in 96000 fs */ in mxs_sgtl5000_hw_params()
32 mclk = 256 * rate; in mxs_sgtl5000_hw_params()
35 mclk = 512 * rate; in mxs_sgtl5000_hw_params()
39 /* Set SGTL5000's SYSCLK (provided by SAIF MCLK) */ in mxs_sgtl5000_hw_params()
40 ret = snd_soc_dai_set_sysclk(codec_dai, SGTL5000_SYSCLK, mclk, 0); in mxs_sgtl5000_hw_params()
42 dev_err(codec_dai->dev, "Failed to set sysclk to %u.%03uMHz\n", in mxs_sgtl5000_hw_params()
43 mclk / 1000000, mclk / 1000 % 1000); in mxs_sgtl5000_hw_params()
47 /* The SAIF MCLK should be the same as SGTL5000_SYSCLK */ in mxs_sgtl5000_hw_params()
48 ret = snd_soc_dai_set_sysclk(cpu_dai, MXS_SAIF_MCLK, mclk, 0); in mxs_sgtl5000_hw_params()
50 dev_err(cpu_dai->dev, "Failed to set sysclk to %u.%03uMHz\n", in mxs_sgtl5000_hw_params()
51 mclk / 1000000, mclk / 1000 % 1000); in mxs_sgtl5000_hw_params()
113 struct device_node *np = pdev->dev.of_node; in mxs_sgtl5000_probe()
116 saif_np[0] = of_parse_phandle(np, "saif-controllers", 0); in mxs_sgtl5000_probe()
117 saif_np[1] = of_parse_phandle(np, "saif-controllers", 1); in mxs_sgtl5000_probe()
118 codec_np = of_parse_phandle(np, "audio-codec", 0); in mxs_sgtl5000_probe()
120 dev_err(&pdev->dev, "phandle missing or invalid\n"); in mxs_sgtl5000_probe()
124 return -EINVAL; in mxs_sgtl5000_probe()
128 mxs_sgtl5000_dai[i].codecs->name = NULL; in mxs_sgtl5000_probe()
129 mxs_sgtl5000_dai[i].codecs->of_node = codec_np; in mxs_sgtl5000_probe()
130 mxs_sgtl5000_dai[i].cpus->dai_name = NULL; in mxs_sgtl5000_probe()
131 mxs_sgtl5000_dai[i].cpus->of_node = saif_np[i]; in mxs_sgtl5000_probe()
132 mxs_sgtl5000_dai[i].platforms->name = NULL; in mxs_sgtl5000_probe()
133 mxs_sgtl5000_dai[i].platforms->of_node = saif_np[i]; in mxs_sgtl5000_probe()
142 * The Sgtl5000 sysclk is derived from saif0 mclk and it's range in mxs_sgtl5000_probe()
147 dev_err(&pdev->dev, "failed to get mclk\n"); in mxs_sgtl5000_probe()
151 card->dev = &pdev->dev; in mxs_sgtl5000_probe()
153 if (of_property_present(np, "audio-routing")) { in mxs_sgtl5000_probe()
154 card->dapm_widgets = mxs_sgtl5000_dapm_widgets; in mxs_sgtl5000_probe()
155 card->num_dapm_widgets = ARRAY_SIZE(mxs_sgtl5000_dapm_widgets); in mxs_sgtl5000_probe()
157 ret = snd_soc_of_parse_audio_routing(card, "audio-routing"); in mxs_sgtl5000_probe()
159 dev_err(&pdev->dev, "failed to parse audio-routing (%d)\n", in mxs_sgtl5000_probe()
165 ret = devm_snd_soc_register_card(&pdev->dev, card); in mxs_sgtl5000_probe()
167 return dev_err_probe(&pdev->dev, ret, "snd_soc_register_card failed\n"); in mxs_sgtl5000_probe()
178 { .compatible = "fsl,mxs-audio-sgtl5000", },
185 .name = "mxs-sgtl5000",
197 MODULE_ALIAS("platform:mxs-sgtl5000");