Lines Matching refs:rpmsg
43 struct fsl_rpmsg *rpmsg = snd_soc_dai_get_drvdata(dai); in fsl_rpmsg_hw_params() local
44 struct clk *p = rpmsg->mclk, *pll = NULL, *npll = NULL; in fsl_rpmsg_hw_params()
49 while (p && rpmsg->pll8k && rpmsg->pll11k) { in fsl_rpmsg_hw_params()
52 if (clk_is_match(pp, rpmsg->pll8k) || in fsl_rpmsg_hw_params()
53 clk_is_match(pp, rpmsg->pll11k)) { in fsl_rpmsg_hw_params()
62 npll = (do_div(rate, 8000) ? rpmsg->pll11k : rpmsg->pll8k); in fsl_rpmsg_hw_params()
71 if (!(rpmsg->mclk_streams & BIT(substream->stream))) { in fsl_rpmsg_hw_params()
72 ret = clk_prepare_enable(rpmsg->mclk); in fsl_rpmsg_hw_params()
78 rpmsg->mclk_streams |= BIT(substream->stream); in fsl_rpmsg_hw_params()
87 struct fsl_rpmsg *rpmsg = snd_soc_dai_get_drvdata(dai); in fsl_rpmsg_hw_free() local
89 if (rpmsg->mclk_streams & BIT(substream->stream)) { in fsl_rpmsg_hw_free()
90 clk_disable_unprepare(rpmsg->mclk); in fsl_rpmsg_hw_free()
91 rpmsg->mclk_streams &= ~BIT(substream->stream); in fsl_rpmsg_hw_free()
203 struct fsl_rpmsg *rpmsg; in fsl_rpmsg_probe() local
211 rpmsg = devm_kzalloc(&pdev->dev, sizeof(struct fsl_rpmsg), GFP_KERNEL); in fsl_rpmsg_probe()
212 if (!rpmsg) in fsl_rpmsg_probe()
215 rpmsg->soc_data = of_device_get_match_data(&pdev->dev); in fsl_rpmsg_probe()
217 if (rpmsg->soc_data) { in fsl_rpmsg_probe()
218 dai_drv->playback.rates = rpmsg->soc_data->rates; in fsl_rpmsg_probe()
219 dai_drv->capture.rates = rpmsg->soc_data->rates; in fsl_rpmsg_probe()
220 dai_drv->playback.formats = rpmsg->soc_data->formats; in fsl_rpmsg_probe()
221 dai_drv->capture.formats = rpmsg->soc_data->formats; in fsl_rpmsg_probe()
237 rpmsg->enable_lpa = 1; in fsl_rpmsg_probe()
238 rpmsg->buffer_size = LPA_LARGE_BUFFER_SIZE; in fsl_rpmsg_probe()
240 rpmsg->buffer_size = IMX_DEFAULT_DMABUF_SIZE; in fsl_rpmsg_probe()
244 rpmsg->ipg = devm_clk_get_optional(&pdev->dev, "ipg"); in fsl_rpmsg_probe()
245 if (IS_ERR(rpmsg->ipg)) in fsl_rpmsg_probe()
246 return PTR_ERR(rpmsg->ipg); in fsl_rpmsg_probe()
248 rpmsg->mclk = devm_clk_get_optional(&pdev->dev, "mclk"); in fsl_rpmsg_probe()
249 if (IS_ERR(rpmsg->mclk)) in fsl_rpmsg_probe()
250 return PTR_ERR(rpmsg->mclk); in fsl_rpmsg_probe()
252 rpmsg->dma = devm_clk_get_optional(&pdev->dev, "dma"); in fsl_rpmsg_probe()
253 if (IS_ERR(rpmsg->dma)) in fsl_rpmsg_probe()
254 return PTR_ERR(rpmsg->dma); in fsl_rpmsg_probe()
256 rpmsg->pll8k = devm_clk_get_optional(&pdev->dev, "pll8k"); in fsl_rpmsg_probe()
257 if (IS_ERR(rpmsg->pll8k)) in fsl_rpmsg_probe()
258 return PTR_ERR(rpmsg->pll8k); in fsl_rpmsg_probe()
260 rpmsg->pll11k = devm_clk_get_optional(&pdev->dev, "pll11k"); in fsl_rpmsg_probe()
261 if (IS_ERR(rpmsg->pll11k)) in fsl_rpmsg_probe()
262 return PTR_ERR(rpmsg->pll11k); in fsl_rpmsg_probe()
264 platform_set_drvdata(pdev, rpmsg); in fsl_rpmsg_probe()
281 struct fsl_rpmsg *rpmsg = platform_get_drvdata(pdev); in fsl_rpmsg_remove() local
285 if (rpmsg->card_pdev) in fsl_rpmsg_remove()
286 platform_device_unregister(rpmsg->card_pdev); in fsl_rpmsg_remove()
291 struct fsl_rpmsg *rpmsg = dev_get_drvdata(dev); in fsl_rpmsg_runtime_resume() local
294 ret = clk_prepare_enable(rpmsg->ipg); in fsl_rpmsg_runtime_resume()
300 ret = clk_prepare_enable(rpmsg->dma); in fsl_rpmsg_runtime_resume()
309 clk_disable_unprepare(rpmsg->ipg); in fsl_rpmsg_runtime_resume()
316 struct fsl_rpmsg *rpmsg = dev_get_drvdata(dev); in fsl_rpmsg_runtime_suspend() local
318 clk_disable_unprepare(rpmsg->dma); in fsl_rpmsg_runtime_suspend()
319 clk_disable_unprepare(rpmsg->ipg); in fsl_rpmsg_runtime_suspend()