Lines Matching refs:pdev
339 static int tegra20_i2s_platform_probe(struct platform_device *pdev) in tegra20_i2s_platform_probe() argument
346 i2s = devm_kzalloc(&pdev->dev, sizeof(struct tegra20_i2s), GFP_KERNEL); in tegra20_i2s_platform_probe()
348 dev_err(&pdev->dev, "Can't allocate tegra20_i2s\n"); in tegra20_i2s_platform_probe()
352 dev_set_drvdata(&pdev->dev, i2s); in tegra20_i2s_platform_probe()
355 i2s->dai.name = dev_name(&pdev->dev); in tegra20_i2s_platform_probe()
357 i2s->clk_i2s = clk_get(&pdev->dev, NULL); in tegra20_i2s_platform_probe()
359 dev_err(&pdev->dev, "Can't retrieve i2s clock\n"); in tegra20_i2s_platform_probe()
364 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); in tegra20_i2s_platform_probe()
366 dev_err(&pdev->dev, "No memory resource\n"); in tegra20_i2s_platform_probe()
371 memregion = devm_request_mem_region(&pdev->dev, mem->start, in tegra20_i2s_platform_probe()
374 dev_err(&pdev->dev, "Memory region already claimed\n"); in tegra20_i2s_platform_probe()
379 regs = devm_ioremap(&pdev->dev, mem->start, resource_size(mem)); in tegra20_i2s_platform_probe()
381 dev_err(&pdev->dev, "ioremap failed\n"); in tegra20_i2s_platform_probe()
386 i2s->regmap = devm_regmap_init_mmio(&pdev->dev, regs, in tegra20_i2s_platform_probe()
389 dev_err(&pdev->dev, "regmap init failed\n"); in tegra20_i2s_platform_probe()
402 pm_runtime_enable(&pdev->dev); in tegra20_i2s_platform_probe()
403 if (!pm_runtime_enabled(&pdev->dev)) { in tegra20_i2s_platform_probe()
404 ret = tegra20_i2s_runtime_resume(&pdev->dev); in tegra20_i2s_platform_probe()
409 ret = snd_soc_register_component(&pdev->dev, &tegra20_i2s_component, in tegra20_i2s_platform_probe()
412 dev_err(&pdev->dev, "Could not register DAI: %d\n", ret); in tegra20_i2s_platform_probe()
417 ret = tegra_pcm_platform_register(&pdev->dev); in tegra20_i2s_platform_probe()
419 dev_err(&pdev->dev, "Could not register PCM: %d\n", ret); in tegra20_i2s_platform_probe()
426 snd_soc_unregister_component(&pdev->dev); in tegra20_i2s_platform_probe()
428 if (!pm_runtime_status_suspended(&pdev->dev)) in tegra20_i2s_platform_probe()
429 tegra20_i2s_runtime_suspend(&pdev->dev); in tegra20_i2s_platform_probe()
431 pm_runtime_disable(&pdev->dev); in tegra20_i2s_platform_probe()
438 static int tegra20_i2s_platform_remove(struct platform_device *pdev) in tegra20_i2s_platform_remove() argument
440 struct tegra20_i2s *i2s = dev_get_drvdata(&pdev->dev); in tegra20_i2s_platform_remove()
442 pm_runtime_disable(&pdev->dev); in tegra20_i2s_platform_remove()
443 if (!pm_runtime_status_suspended(&pdev->dev)) in tegra20_i2s_platform_remove()
444 tegra20_i2s_runtime_suspend(&pdev->dev); in tegra20_i2s_platform_remove()
446 tegra_pcm_platform_unregister(&pdev->dev); in tegra20_i2s_platform_remove()
447 snd_soc_unregister_component(&pdev->dev); in tegra20_i2s_platform_remove()