Lines Matching refs:pdev
283 static int rk_spdif_probe(struct platform_device *pdev) in rk_spdif_probe() argument
285 struct device_node *np = pdev->dev.of_node; in rk_spdif_probe()
298 dev_err(&pdev->dev, in rk_spdif_probe()
309 spdif = devm_kzalloc(&pdev->dev, sizeof(*spdif), GFP_KERNEL); in rk_spdif_probe()
313 spdif->hclk = devm_clk_get(&pdev->dev, "hclk"); in rk_spdif_probe()
317 spdif->mclk = devm_clk_get(&pdev->dev, "mclk"); in rk_spdif_probe()
321 regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res); in rk_spdif_probe()
325 spdif->regmap = devm_regmap_init_mmio_clk(&pdev->dev, "hclk", regs, in rk_spdif_probe()
334 spdif->dev = &pdev->dev; in rk_spdif_probe()
335 dev_set_drvdata(&pdev->dev, spdif); in rk_spdif_probe()
337 pm_runtime_enable(&pdev->dev); in rk_spdif_probe()
338 if (!pm_runtime_enabled(&pdev->dev)) { in rk_spdif_probe()
339 ret = rk_spdif_runtime_resume(&pdev->dev); in rk_spdif_probe()
344 ret = devm_snd_soc_register_component(&pdev->dev, in rk_spdif_probe()
348 dev_err(&pdev->dev, "Could not register DAI\n"); in rk_spdif_probe()
352 ret = devm_snd_dmaengine_pcm_register(&pdev->dev, NULL, 0); in rk_spdif_probe()
354 dev_err(&pdev->dev, "Could not register PCM\n"); in rk_spdif_probe()
361 if (!pm_runtime_status_suspended(&pdev->dev)) in rk_spdif_probe()
362 rk_spdif_runtime_suspend(&pdev->dev); in rk_spdif_probe()
364 pm_runtime_disable(&pdev->dev); in rk_spdif_probe()
369 static int rk_spdif_remove(struct platform_device *pdev) in rk_spdif_remove() argument
371 pm_runtime_disable(&pdev->dev); in rk_spdif_remove()
372 if (!pm_runtime_status_suspended(&pdev->dev)) in rk_spdif_remove()
373 rk_spdif_runtime_suspend(&pdev->dev); in rk_spdif_remove()