static int rt5350_pcm_dev_remove(struct platform_device *pdev) { struct rt5350_pcm *pcm = platform_get_drvdata(pdev); snd_soc_unregister_component(&pdev->dev); iounmap(pcm->base); release_mem_region(pcm->mem->start, resource_size(pcm->mem)); kfree(pcm); snd_dmaengine_pcm_unregister(&pdev->dev); return 0; }
static int rockchip_i2s_remove(struct platform_device *pdev) { struct rk_i2s_dev *i2s = dev_get_drvdata(&pdev->dev); pm_runtime_disable(&pdev->dev); if (!pm_runtime_status_suspended(&pdev->dev)) i2s_runtime_suspend(&pdev->dev); clk_disable_unprepare(i2s->mclk); clk_disable_unprepare(i2s->hclk); snd_dmaengine_pcm_unregister(&pdev->dev); snd_soc_unregister_component(&pdev->dev); return 0; }
static int mt7620_i2s_dev_remove(struct platform_device *pdev) { struct mt7620_i2s *i2s = platform_get_drvdata(pdev); snd_soc_unregister_component(&pdev->dev); iounmap(i2s->base); release_mem_region(i2s->mem->start, resource_size(i2s->mem)); kfree(i2s); snd_dmaengine_pcm_unregister(&pdev->dev); return 0; }
int ux500_pcm_unregister_platform(struct platform_device *pdev) { snd_dmaengine_pcm_unregister(&pdev->dev); return 0; }
static int rockchip_i2s_probe(struct platform_device *pdev) { struct rk_i2s_dev *i2s; struct resource *res; void __iomem *regs; int ret; i2s = devm_kzalloc(&pdev->dev, sizeof(*i2s), GFP_KERNEL); if (!i2s) { dev_err(&pdev->dev, "Can't allocate rk_i2s_dev\n"); return -ENOMEM; } /* try to prepare related clocks */ i2s->hclk = devm_clk_get(&pdev->dev, "i2s_hclk"); if (IS_ERR(i2s->hclk)) { dev_err(&pdev->dev, "Can't retrieve i2s bus clock\n"); return PTR_ERR(i2s->hclk); } i2s->mclk = devm_clk_get(&pdev->dev, "i2s_clk"); if (IS_ERR(i2s->mclk)) { dev_err(&pdev->dev, "Can't retrieve i2s master clock\n"); return PTR_ERR(i2s->mclk); } res = platform_get_resource(pdev, IORESOURCE_MEM, 0); regs = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(regs)) return PTR_ERR(regs); i2s->regmap = devm_regmap_init_mmio(&pdev->dev, regs, &rockchip_i2s_regmap_config); if (IS_ERR(i2s->regmap)) { dev_err(&pdev->dev, "Failed to initialise managed register map\n"); return PTR_ERR(i2s->regmap); } i2s->playback_dma_data.addr = res->start + I2S_TXDR; i2s->playback_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; i2s->playback_dma_data.maxburst = 16; i2s->capture_dma_data.addr = res->start + I2S_RXDR; i2s->capture_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; i2s->capture_dma_data.maxburst = 16; i2s->dev = &pdev->dev; dev_set_drvdata(&pdev->dev, i2s); pm_runtime_enable(&pdev->dev); if (!pm_runtime_enabled(&pdev->dev)) { ret = i2s_runtime_resume(&pdev->dev); if (ret) goto err_pm_disable; } ret = devm_snd_soc_register_component(&pdev->dev, &rockchip_i2s_component, &rockchip_i2s_dai, 1); if (ret) { dev_err(&pdev->dev, "Could not register DAI\n"); goto err_suspend; } ret = snd_dmaengine_pcm_register(&pdev->dev, NULL, 0); if (ret) { dev_err(&pdev->dev, "Could not register PCM\n"); goto err_pcm_register; } return 0; err_pcm_register: snd_dmaengine_pcm_unregister(&pdev->dev); err_suspend: if (!pm_runtime_status_suspended(&pdev->dev)) i2s_runtime_suspend(&pdev->dev); err_pm_disable: pm_runtime_disable(&pdev->dev); return ret; }
void tegra_pcm_platform_unregister(struct device *dev) { return snd_dmaengine_pcm_unregister(dev); }
static void devm_dmaengine_pcm_release(struct device *dev, void *res) { snd_dmaengine_pcm_unregister(*(struct device **)res); }
void atmel_pcm_dma_platform_unregister(struct device *dev) { snd_dmaengine_pcm_unregister(dev); }
void mxs_pcm_platform_unregister(struct device *dev) { snd_dmaengine_pcm_unregister(dev); }
int rockchip_pcm_platform_unregister(struct device *dev) { snd_dmaengine_pcm_unregister(dev); return 0; }