diff options
Diffstat (limited to 'sound/soc/fsl/fsl_spdif.c')
| -rw-r--r-- | sound/soc/fsl/fsl_spdif.c | 55 |
1 files changed, 25 insertions, 30 deletions
diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c index 78d9dfbe6548..1b9be85b34c2 100644 --- a/sound/soc/fsl/fsl_spdif.c +++ b/sound/soc/fsl/fsl_spdif.c @@ -12,9 +12,7 @@ #include <linux/bitrev.h> #include <linux/clk.h> #include <linux/module.h> -#include <linux/of_address.h> -#include <linux/of_device.h> -#include <linux/of_irq.h> +#include <linux/of.h> #include <linux/regmap.h> #include <linux/pm_runtime.h> @@ -150,7 +148,7 @@ struct fsl_spdif_priv { struct clk *pll11k_clk; }; -static struct fsl_spdif_soc_data fsl_spdif_vf610 = { +static const struct fsl_spdif_soc_data fsl_spdif_vf610 = { .imx = false, .shared_root_clock = false, .raw_capture_mode = false, @@ -160,7 +158,7 @@ static struct fsl_spdif_soc_data fsl_spdif_vf610 = { .tx_formats = FSL_SPDIF_FORMATS_PLAYBACK, }; -static struct fsl_spdif_soc_data fsl_spdif_imx35 = { +static const struct fsl_spdif_soc_data fsl_spdif_imx35 = { .imx = true, .shared_root_clock = false, .raw_capture_mode = false, @@ -170,7 +168,7 @@ static struct fsl_spdif_soc_data fsl_spdif_imx35 = { .tx_formats = FSL_SPDIF_FORMATS_PLAYBACK, }; -static struct fsl_spdif_soc_data fsl_spdif_imx6sx = { +static const struct fsl_spdif_soc_data fsl_spdif_imx6sx = { .imx = true, .shared_root_clock = true, .raw_capture_mode = false, @@ -181,7 +179,7 @@ static struct fsl_spdif_soc_data fsl_spdif_imx6sx = { }; -static struct fsl_spdif_soc_data fsl_spdif_imx8qm = { +static const struct fsl_spdif_soc_data fsl_spdif_imx8qm = { .imx = true, .shared_root_clock = true, .raw_capture_mode = false, @@ -191,7 +189,7 @@ static struct fsl_spdif_soc_data fsl_spdif_imx8qm = { .tx_formats = SNDRV_PCM_FMTBIT_S24_LE, /* Applied for EDMA */ }; -static struct fsl_spdif_soc_data fsl_spdif_imx8mm = { +static const struct fsl_spdif_soc_data fsl_spdif_imx8mm = { .imx = true, .shared_root_clock = false, .raw_capture_mode = true, @@ -201,7 +199,7 @@ static struct fsl_spdif_soc_data fsl_spdif_imx8mm = { .tx_formats = FSL_SPDIF_FORMATS_PLAYBACK, }; -static struct fsl_spdif_soc_data fsl_spdif_imx8ulp = { +static const struct fsl_spdif_soc_data fsl_spdif_imx8ulp = { .imx = true, .shared_root_clock = true, .raw_capture_mode = false, @@ -502,8 +500,8 @@ static int fsl_spdif_probe_txclk(struct fsl_spdif_priv *spdif_priv, enum spdif_t static int spdif_set_sample_rate(struct snd_pcm_substream *substream, int sample_rate) { - struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); - struct fsl_spdif_priv *spdif_priv = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0)); + struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); + struct fsl_spdif_priv *spdif_priv = snd_soc_dai_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0)); struct spdif_mixer_control *ctrl = &spdif_priv->fsl_spdif_control; struct regmap *regmap = spdif_priv->regmap; struct platform_device *pdev = spdif_priv->pdev; @@ -605,8 +603,8 @@ clk_set_bypass: static int fsl_spdif_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *cpu_dai) { - struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); - struct fsl_spdif_priv *spdif_priv = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0)); + struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); + struct fsl_spdif_priv *spdif_priv = snd_soc_dai_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0)); struct platform_device *pdev = spdif_priv->pdev; struct regmap *regmap = spdif_priv->regmap; u32 scr, mask; @@ -647,8 +645,8 @@ static int fsl_spdif_startup(struct snd_pcm_substream *substream, static void fsl_spdif_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *cpu_dai) { - struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); - struct fsl_spdif_priv *spdif_priv = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0)); + struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); + struct fsl_spdif_priv *spdif_priv = snd_soc_dai_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0)); struct regmap *regmap = spdif_priv->regmap; u32 scr, mask; @@ -701,8 +699,8 @@ static int fsl_spdif_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) { - struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); - struct fsl_spdif_priv *spdif_priv = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0)); + struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); + struct fsl_spdif_priv *spdif_priv = snd_soc_dai_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0)); struct spdif_mixer_control *ctrl = &spdif_priv->fsl_spdif_control; struct platform_device *pdev = spdif_priv->pdev; u32 sample_rate = params_rate(params); @@ -736,8 +734,8 @@ static int fsl_spdif_hw_params(struct snd_pcm_substream *substream, static int fsl_spdif_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai) { - struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); - struct fsl_spdif_priv *spdif_priv = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0)); + struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); + struct fsl_spdif_priv *spdif_priv = snd_soc_dai_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0)); struct regmap *regmap = spdif_priv->regmap; bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; u32 intr = SIE_INTR_FOR(tx); @@ -1148,7 +1146,7 @@ static int fsl_spdif_usync_put(struct snd_kcontrol *kcontrol, } /* FSL SPDIF IEC958 controller defines */ -static struct snd_kcontrol_new fsl_spdif_ctrls[] = { +static const struct snd_kcontrol_new fsl_spdif_ctrls[] = { /* Status cchanel controller */ { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, @@ -1206,7 +1204,7 @@ static struct snd_kcontrol_new fsl_spdif_ctrls[] = { }, /* DPLL lock info get controller */ { - .iface = SNDRV_CTL_ELEM_IFACE_PCM, + .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = RX_SAMPLE_RATE_KCONTROL, .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, @@ -1235,7 +1233,7 @@ static struct snd_kcontrol_new fsl_spdif_ctrls[] = { }, }; -static struct snd_kcontrol_new fsl_spdif_ctrls_rcm[] = { +static const struct snd_kcontrol_new fsl_spdif_ctrls_rcm[] = { { .iface = SNDRV_CTL_ELEM_IFACE_PCM, .name = "IEC958 Raw Capture Mode", @@ -1669,7 +1667,6 @@ static void fsl_spdif_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); } -#ifdef CONFIG_PM static int fsl_spdif_runtime_suspend(struct device *dev) { struct fsl_spdif_priv *spdif_priv = dev_get_drvdata(dev); @@ -1741,13 +1738,11 @@ disable_core_clk: return ret; } -#endif /* CONFIG_PM */ static const struct dev_pm_ops fsl_spdif_pm = { - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, - pm_runtime_force_resume) - SET_RUNTIME_PM_OPS(fsl_spdif_runtime_suspend, fsl_spdif_runtime_resume, - NULL) + SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) + RUNTIME_PM_OPS(fsl_spdif_runtime_suspend, fsl_spdif_runtime_resume, + NULL) }; static const struct of_device_id fsl_spdif_dt_ids[] = { @@ -1765,10 +1760,10 @@ static struct platform_driver fsl_spdif_driver = { .driver = { .name = "fsl-spdif-dai", .of_match_table = fsl_spdif_dt_ids, - .pm = &fsl_spdif_pm, + .pm = pm_ptr(&fsl_spdif_pm), }, .probe = fsl_spdif_probe, - .remove_new = fsl_spdif_remove, + .remove = fsl_spdif_remove, }; module_platform_driver(fsl_spdif_driver); |
