ASoC: samsung: use asoc_substream_to_rtd()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Mon, 20 Jul 2020 01:18:14 +0000 (10:18 +0900)
committerMark Brown <broonie@kernel.org>
Thu, 23 Jul 2020 18:07:26 +0000 (19:07 +0100)
Now we can use asoc_substream_to_rtd() macro,
let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87lfjf0yuf.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 files changed:
sound/soc/samsung/aries_wm8994.c
sound/soc/samsung/arndale.c
sound/soc/samsung/h1940_uda1380.c
sound/soc/samsung/i2s.c
sound/soc/samsung/jive_wm8750.c
sound/soc/samsung/littlemill.c
sound/soc/samsung/neo1973_wm8753.c
sound/soc/samsung/odroid.c
sound/soc/samsung/pcm.c
sound/soc/samsung/rx1950_uda1380.c
sound/soc/samsung/s3c-i2s-v2.c
sound/soc/samsung/s3c24xx_simtec.c
sound/soc/samsung/s3c24xx_uda134x.c
sound/soc/samsung/smartq_wm8987.c
sound/soc/samsung/smdk_spdif.c
sound/soc/samsung/smdk_wm8580.c
sound/soc/samsung/smdk_wm8994.c
sound/soc/samsung/smdk_wm8994pcm.c
sound/soc/samsung/snow.c
sound/soc/samsung/spdif.c
sound/soc/samsung/tm2_wm5110.c

index 8579c87dcae8e10bc25bd97c6f52b7a672471076..0ac5956ba270d7360109d3f9dd9086c3301dfc5c 100644 (file)
@@ -260,7 +260,7 @@ static const struct snd_soc_dapm_widget aries_dapm_widgets[] = {
 static int aries_hw_params(struct snd_pcm_substream *substream,
        struct snd_pcm_hw_params *params)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
        unsigned int pll_out;
        int ret;
@@ -288,7 +288,7 @@ static int aries_hw_params(struct snd_pcm_substream *substream,
 
 static int aries_hw_free(struct snd_pcm_substream *substream)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
        int ret;
 
index c81ece78e0360f699336c276853f5f9753ec7e80..28587375813ac9a8cd4209b20ec6c74d86f363d8 100644 (file)
@@ -20,7 +20,7 @@
 static int arndale_rt5631_hw_params(struct snd_pcm_substream *substream,
                                    struct snd_pcm_hw_params *params)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
        struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
        int rfs, ret;
@@ -55,7 +55,7 @@ static struct snd_soc_ops arndale_rt5631_ops = {
 static int arndale_wm1811_hw_params(struct snd_pcm_substream *substream,
                                    struct snd_pcm_hw_params *params)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
        unsigned int rfs, rclk;
 
index 9139a1e7e2006293a48f7f8cd3dbb95b204b6768..b8f0057a0510501e098fbc27f2ea920b4a67b503 100644 (file)
@@ -67,7 +67,7 @@ static int h1940_startup(struct snd_pcm_substream *substream)
 static int h1940_hw_params(struct snd_pcm_substream *substream,
                                struct snd_pcm_hw_params *params)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
        int div;
        int ret;
index f86e3028b402402bf6a3ec4628588f0bbe4884ef..80ecb5c7fed0c1a03110a9a16c73d853ae154bc9 100644 (file)
@@ -931,7 +931,7 @@ static int i2s_trigger(struct snd_pcm_substream *substream,
 {
        struct samsung_i2s_priv *priv = snd_soc_dai_get_drvdata(dai);
        int capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE);
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct i2s_dai *i2s = to_info(asoc_rtd_to_cpu(rtd, 0));
        unsigned long flags;
 
index 30899016cf08a5177446c78909868c0ecd1c50bd..40a85f539509a363f3e6057d2ecec99871d54a0b 100644 (file)
@@ -32,7 +32,7 @@ static const struct snd_soc_dapm_widget wm8750_dapm_widgets[] = {
 static int jive_hw_params(struct snd_pcm_substream *substream,
                          struct snd_pcm_hw_params *params)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
        struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
        struct s3c_i2sv2_rate_calc div;
index f4375c49f7f49dd6771bb153a1208dd768320a4a..a1ff1400857ed715fcd973781bb83f5085f396dc 100644 (file)
@@ -104,7 +104,7 @@ static int littlemill_set_bias_level_post(struct snd_soc_card *card,
 static int littlemill_hw_params(struct snd_pcm_substream *substream,
                                struct snd_pcm_hw_params *params)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
        int ret;
 
index b7ce1da854cee03b4f2d9f19560abd0cf56362eb..54317e0f68f8eae8ed8e0a6c6753619875e9222b 100644 (file)
@@ -25,7 +25,7 @@
 static int neo1973_hifi_hw_params(struct snd_pcm_substream *substream,
        struct snd_pcm_hw_params *params)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
        struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
        unsigned int pll_out = 0, bclk = 0;
@@ -99,7 +99,7 @@ static int neo1973_hifi_hw_params(struct snd_pcm_substream *substream,
 
 static int neo1973_hifi_hw_free(struct snd_pcm_substream *substream)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
 
        /* disable the PLL */
@@ -117,7 +117,7 @@ static struct snd_soc_ops neo1973_hifi_ops = {
 static int neo1973_voice_hw_params(struct snd_pcm_substream *substream,
        struct snd_pcm_hw_params *params)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
        unsigned int pcmdiv = 0;
        int ret = 0;
@@ -154,7 +154,7 @@ static int neo1973_voice_hw_params(struct snd_pcm_substream *substream,
 
 static int neo1973_voice_hw_free(struct snd_pcm_substream *substream)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
 
        /* disable the PLL */
index 6eda5af989fe38a8f07a5c2d28fadb147cd4b8d6..ca643a488c3caa02154ad2382dc91a7d867c65c1 100644 (file)
@@ -35,7 +35,7 @@ static int odroid_card_fe_startup(struct snd_pcm_substream *substream)
 static int odroid_card_fe_hw_params(struct snd_pcm_substream *substream,
                                      struct snd_pcm_hw_params *params)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct odroid_priv *priv = snd_soc_card_get_drvdata(rtd->card);
        unsigned long flags;
        int ret = 0;
@@ -56,7 +56,7 @@ static const struct snd_soc_ops odroid_card_fe_ops = {
 static int odroid_card_be_hw_params(struct snd_pcm_substream *substream,
                                      struct snd_pcm_hw_params *params)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct odroid_priv *priv = snd_soc_card_get_drvdata(rtd->card);
        unsigned int pll_freq, rclk_freq, rfs;
        unsigned long flags;
@@ -115,7 +115,7 @@ static int odroid_card_be_hw_params(struct snd_pcm_substream *substream,
 
 static int odroid_card_be_trigger(struct snd_pcm_substream *substream, int cmd)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct odroid_priv *priv = snd_soc_card_get_drvdata(rtd->card);
        unsigned long flags;
 
index 45dfc534c6c7f60db66ec31e77a26aa83baff86a..6f50c7b4732606274e91b341867dc1228a84b9c7 100644 (file)
@@ -216,7 +216,7 @@ static void s3c_pcm_snd_rxctrl(struct s3c_pcm_info *pcm, int on)
 static int s3c_pcm_trigger(struct snd_pcm_substream *substream, int cmd,
                               struct snd_soc_dai *dai)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct s3c_pcm_info *pcm = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0));
        unsigned long flags;
 
@@ -260,7 +260,7 @@ static int s3c_pcm_hw_params(struct snd_pcm_substream *substream,
                                 struct snd_pcm_hw_params *params,
                                 struct snd_soc_dai *socdai)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct s3c_pcm_info *pcm = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0));
        void __iomem *regs = pcm->regs;
        struct clk *clk;
index 3afe63c0923ebd8abc2d1fca68dd61476fc5a2d9..08f7c82aedb6238906a704533d55900bc1748edf 100644 (file)
@@ -148,7 +148,7 @@ static int rx1950_spk_power(struct snd_soc_dapm_widget *w,
 static int rx1950_hw_params(struct snd_pcm_substream *substream,
                                struct snd_pcm_hw_params *params)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
        int div;
        int ret;
index 5e95c30fb2bacc936c9e3c25ac9588f5e8ac2f81..ed21786104a1c983c0b6f2b698c3aea4332b328b 100644 (file)
@@ -379,7 +379,7 @@ static int s3c_i2sv2_set_sysclk(struct snd_soc_dai *cpu_dai,
 static int s3c2412_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
                               struct snd_soc_dai *dai)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct s3c_i2sv2_info *i2s = to_info(asoc_rtd_to_cpu(rtd, 0));
        int capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE);
        unsigned long irqs;
index fd2a4da086f3084bed37955b5d2f085b5707b01f..3cddd11344ac5f72140d09e14e9ada84ab21096b 100644 (file)
@@ -159,7 +159,7 @@ EXPORT_SYMBOL_GPL(simtec_audio_init);
 static int simtec_hw_params(struct snd_pcm_substream *substream,
                            struct snd_pcm_hw_params *params)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
        struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
        int ret;
index abb5c4713c534e6f1b50ff141625a8e451f4508c..6272070dcd92be68227c5713b8466f79b87f1007 100644 (file)
@@ -49,7 +49,7 @@ static const struct snd_pcm_hw_constraint_list hw_constraints_rates = {
 
 static int s3c24xx_uda134x_startup(struct snd_pcm_substream *substream)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct s3c24xx_uda134x *priv = snd_soc_card_get_drvdata(rtd->card);
        struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
        int ret = 0;
@@ -101,7 +101,7 @@ static int s3c24xx_uda134x_startup(struct snd_pcm_substream *substream)
 
 static void s3c24xx_uda134x_shutdown(struct snd_pcm_substream *substream)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct s3c24xx_uda134x *priv = snd_soc_card_get_drvdata(rtd->card);
 
        mutex_lock(&priv->clk_lock);
@@ -118,7 +118,7 @@ static void s3c24xx_uda134x_shutdown(struct snd_pcm_substream *substream)
 static int s3c24xx_uda134x_hw_params(struct snd_pcm_substream *substream,
                                        struct snd_pcm_hw_params *params)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
        struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
        unsigned int clk = 0;
index 36bef136d57f818c7e9ba8282d861dfd144ee9fe..c95629becbc342f9edd77fa48a95958ef21cd642 100644 (file)
@@ -24,7 +24,7 @@ static struct snd_soc_card snd_soc_smartq;
 static int smartq_hifi_hw_params(struct snd_pcm_substream *substream,
        struct snd_pcm_hw_params *params)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
        struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
        unsigned int clk = 0;
index 776a270261bf1b397cfe5361e2fac16aaa449c98..6f3eeb7bc834b5844748bdaa98da9ac11c28be78 100644 (file)
@@ -100,7 +100,7 @@ static int set_audio_clock_rate(unsigned long epll_rate,
 static int smdk_hw_params(struct snd_pcm_substream *substream,
                struct snd_pcm_hw_params *params)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
        unsigned long pll_out, rclk_rate;
        int ret, ratio;
index 02074c34a2b2e16f7986410506114886e82b3fe1..ed753a2f202e0ccc192f6eb0cb8d2a429139535b 100644 (file)
@@ -22,7 +22,7 @@
 static int smdk_hw_params(struct snd_pcm_substream *substream,
        struct snd_pcm_hw_params *params)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
        unsigned int pll_out;
        int rfs, ret;
index a9f345f19a8a1cd019c34172d65ad8f26fa00922..64a1a64656abaf11304d4e4b1140cc968521a292 100644 (file)
@@ -44,7 +44,7 @@ static struct smdk_wm8994_data smdk_board_data = {
 static int smdk_hw_params(struct snd_pcm_substream *substream,
        struct snd_pcm_hw_params *params)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
        unsigned int pll_out;
        int ret;
index 746930dde5d7917587be324de45327520d219236..a01640576f71d677618af9131b857f5fca741e1d 100644 (file)
@@ -43,7 +43,7 @@
 static int smdk_wm8994_pcm_hw_params(struct snd_pcm_substream *substream,
                              struct snd_pcm_hw_params *params)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
        struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
        unsigned long mclk_freq;
index 40c5de8df0ffe7b81ff373536b29a302e85376fb..07163f07c6d561cb69a980584a5dd3e52963dc49 100644 (file)
@@ -30,7 +30,7 @@ static int snow_card_hw_params(struct snd_pcm_substream *substream,
        static const unsigned int pll_rate[] = {
                73728000U, 67737602U, 49152000U, 45158401U, 32768001U
        };
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snow_priv *priv = snd_soc_card_get_drvdata(rtd->card);
        int bfs, psr, rfs, bitwidth;
        unsigned long int rclk;
index 4ae7ff623b826e767ebd8cd4513da711ac240109..226c359892e9ff29ca0b50e74191a53526102d22 100644 (file)
@@ -141,7 +141,7 @@ static int spdif_set_sysclk(struct snd_soc_dai *cpu_dai,
 static int spdif_trigger(struct snd_pcm_substream *substream, int cmd,
                                struct snd_soc_dai *dai)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct samsung_spdif_info *spdif = to_info(asoc_rtd_to_cpu(rtd, 0));
        unsigned long flags;
 
@@ -177,7 +177,7 @@ static int spdif_hw_params(struct snd_pcm_substream *substream,
                                struct snd_pcm_hw_params *params,
                                struct snd_soc_dai *socdai)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct samsung_spdif_info *spdif = to_info(asoc_rtd_to_cpu(rtd, 0));
        void __iomem *regs = spdif->regs;
        struct snd_dmaengine_dai_dma_data *dma_data;
@@ -279,7 +279,7 @@ err:
 static void spdif_shutdown(struct snd_pcm_substream *substream,
                                struct snd_soc_dai *dai)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct samsung_spdif_info *spdif = to_info(asoc_rtd_to_cpu(rtd, 0));
        void __iomem *regs = spdif->regs;
        u32 con, clkcon;
index 6dfd540e2d743a0951d11c544616fa766f00a55c..9300fef9bf26985d503bc919c3706e8e80cbf361 100644 (file)
@@ -92,7 +92,7 @@ static int tm2_stop_sysclk(struct snd_soc_card *card)
 static int tm2_aif1_hw_params(struct snd_pcm_substream *substream,
                                struct snd_pcm_hw_params *params)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component;
        struct tm2_machine_priv *priv = snd_soc_card_get_drvdata(rtd->card);
 
@@ -133,7 +133,7 @@ static struct snd_soc_ops tm2_aif1_ops = {
 static int tm2_aif2_hw_params(struct snd_pcm_substream *substream,
                                struct snd_pcm_hw_params *params)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component;
        unsigned int asyncclk_rate;
        int ret;
@@ -187,7 +187,7 @@ static int tm2_aif2_hw_params(struct snd_pcm_substream *substream,
 
 static int tm2_aif2_hw_free(struct snd_pcm_substream *substream)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component;
        int ret;
 
@@ -208,7 +208,7 @@ static struct snd_soc_ops tm2_aif2_ops = {
 static int tm2_hdmi_hw_params(struct snd_pcm_substream *substream,
                              struct snd_pcm_hw_params *params)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
        struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
        unsigned int bfs;
        int bitwidth, ret;