Lines Matching +full:rclk +full:-

1 // SPDX-License-Identifier: GPL-2.0
33 struct snow_priv *priv = snd_soc_card_get_drvdata(rtd->card); in snow_card_hw_params()
35 unsigned long int rclk; in snow_card_hw_params() local
36 long int freq = -EINVAL; in snow_card_hw_params()
41 dev_err(rtd->card->dev, "Invalid bit-width: %d\n", bitwidth); in snow_card_hw_params()
46 dev_err(rtd->card->dev, "Unsupported bit-width: %d\n", bitwidth); in snow_card_hw_params()
47 return -EINVAL; in snow_card_hw_params()
72 return -EINVAL; in snow_card_hw_params()
75 rclk = params_rate(params) * rfs; in snow_card_hw_params()
79 if ((pll_rate[i] - rclk * psr) <= 2) { in snow_card_hw_params()
86 dev_err(rtd->card->dev, "Unsupported RCLK rate: %lu\n", rclk); in snow_card_hw_params()
87 return -EINVAL; in snow_card_hw_params()
90 ret = clk_set_rate(priv->clk_i2s_bus, freq); in snow_card_hw_params()
92 dev_err(rtd->card->dev, "I2S bus clock rate set failed\n"); in snow_card_hw_params()
108 rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[0]); in snow_late_probe()
110 /* In the multi-codec case codec_dais 0 is MAX98095 and 1 is HDMI. */ in snow_late_probe()
119 .name = "Snow-I2S",
126 struct device *dev = &pdev->dev; in snow_probe()
135 return -ENOMEM; in snow_probe()
137 link = &priv->dai_link; in snow_probe()
139 link->dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | in snow_probe()
142 link->name = "Primary"; in snow_probe()
143 link->stream_name = link->name; in snow_probe()
145 link->cpus = links_cpus; in snow_probe()
146 link->num_cpus = ARRAY_SIZE(links_cpus); in snow_probe()
147 link->codecs = links_codecs; in snow_probe()
148 link->num_codecs = ARRAY_SIZE(links_codecs); in snow_probe()
149 link->platforms = links_platforms; in snow_probe()
150 link->num_platforms = ARRAY_SIZE(links_platforms); in snow_probe()
152 card->dai_link = link; in snow_probe()
153 card->num_links = 1; in snow_probe()
154 card->dev = dev; in snow_probe()
157 cpu = of_get_child_by_name(dev->of_node, "cpu"); in snow_probe()
160 link->ops = &snow_card_ops; in snow_probe()
162 link->cpus->of_node = of_parse_phandle(cpu, "sound-dai", 0); in snow_probe()
165 if (!link->cpus->of_node) { in snow_probe()
166 dev_err(dev, "Failed parsing cpu/sound-dai property\n"); in snow_probe()
167 return -EINVAL; in snow_probe()
170 codec = of_get_child_by_name(dev->of_node, "codec"); in snow_probe()
175 of_node_put(link->cpus->of_node); in snow_probe()
180 priv->clk_i2s_bus = of_clk_get_by_name(link->cpus->of_node, in snow_probe()
182 if (IS_ERR(priv->clk_i2s_bus)) { in snow_probe()
184 of_node_put(link->cpus->of_node); in snow_probe()
185 return PTR_ERR(priv->clk_i2s_bus); in snow_probe()
188 link->codecs->dai_name = "HiFi"; in snow_probe()
190 link->cpus->of_node = of_parse_phandle(dev->of_node, in snow_probe()
191 "samsung,i2s-controller", 0); in snow_probe()
192 if (!link->cpus->of_node) { in snow_probe()
193 dev_err(dev, "i2s-controller property parse error\n"); in snow_probe()
194 return -EINVAL; in snow_probe()
197 link->codecs->of_node = of_parse_phandle(dev->of_node, in snow_probe()
198 "samsung,audio-codec", 0); in snow_probe()
199 if (!link->codecs->of_node) { in snow_probe()
200 of_node_put(link->cpus->of_node); in snow_probe()
201 dev_err(dev, "audio-codec property parse error\n"); in snow_probe()
202 return -EINVAL; in snow_probe()
206 link->platforms->of_node = link->cpus->of_node; in snow_probe()
208 /* Update card-name if provided through DT, else use default name */ in snow_probe()
215 return dev_err_probe(&pdev->dev, ret, in snow_probe()
224 struct snd_soc_dai_link *link = &priv->dai_link; in snow_remove()
226 of_node_put(link->cpus->of_node); in snow_remove()
227 of_node_put(link->codecs->of_node); in snow_remove()
230 clk_put(priv->clk_i2s_bus); in snow_remove()
234 { .compatible = "google,snow-audio-max98090", },
235 { .compatible = "google,snow-audio-max98091", },
236 { .compatible = "google,snow-audio-max98095", },
243 .name = "snow-audio",