static int spdif_out_resume(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct spdif_out_dev *host = dev_get_drvdata(&pdev->dev); if (host->running) { clk_enable(host->clk); spdif_out_configure(host); spdif_out_clock(host, host->saved_params.core_freq, host->saved_params.rate); } return 0; }
static int spdif_out_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *cpu_dai) { struct spdif_out_dev *host = snd_soc_dai_get_drvdata(cpu_dai); int ret; if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) return -EINVAL; ret = clk_enable(host->clk); if (ret) return ret; host->running = true; spdif_out_configure(host); return 0; }