Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: samsung: use asoc_substream_to_rtd()

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>

authored by

Kuninori Morimoto and committed by
Mark Brown
c101ce88 28ec78b0

+36 -36
+2 -2
sound/soc/samsung/aries_wm8994.c
··· 260 260 static int aries_hw_params(struct snd_pcm_substream *substream, 261 261 struct snd_pcm_hw_params *params) 262 262 { 263 - struct snd_soc_pcm_runtime *rtd = substream->private_data; 263 + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 264 264 struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); 265 265 unsigned int pll_out; 266 266 int ret; ··· 288 288 289 289 static int aries_hw_free(struct snd_pcm_substream *substream) 290 290 { 291 - struct snd_soc_pcm_runtime *rtd = substream->private_data; 291 + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 292 292 struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); 293 293 int ret; 294 294
+2 -2
sound/soc/samsung/arndale.c
··· 20 20 static int arndale_rt5631_hw_params(struct snd_pcm_substream *substream, 21 21 struct snd_pcm_hw_params *params) 22 22 { 23 - struct snd_soc_pcm_runtime *rtd = substream->private_data; 23 + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 24 24 struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); 25 25 struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); 26 26 int rfs, ret; ··· 55 55 static int arndale_wm1811_hw_params(struct snd_pcm_substream *substream, 56 56 struct snd_pcm_hw_params *params) 57 57 { 58 - struct snd_soc_pcm_runtime *rtd = substream->private_data; 58 + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 59 59 struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); 60 60 unsigned int rfs, rclk; 61 61
+1 -1
sound/soc/samsung/h1940_uda1380.c
··· 67 67 static int h1940_hw_params(struct snd_pcm_substream *substream, 68 68 struct snd_pcm_hw_params *params) 69 69 { 70 - struct snd_soc_pcm_runtime *rtd = substream->private_data; 70 + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 71 71 struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); 72 72 int div; 73 73 int ret;
+1 -1
sound/soc/samsung/i2s.c
··· 931 931 { 932 932 struct samsung_i2s_priv *priv = snd_soc_dai_get_drvdata(dai); 933 933 int capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); 934 - struct snd_soc_pcm_runtime *rtd = substream->private_data; 934 + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 935 935 struct i2s_dai *i2s = to_info(asoc_rtd_to_cpu(rtd, 0)); 936 936 unsigned long flags; 937 937
+1 -1
sound/soc/samsung/jive_wm8750.c
··· 32 32 static int jive_hw_params(struct snd_pcm_substream *substream, 33 33 struct snd_pcm_hw_params *params) 34 34 { 35 - struct snd_soc_pcm_runtime *rtd = substream->private_data; 35 + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 36 36 struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); 37 37 struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); 38 38 struct s3c_i2sv2_rate_calc div;
+1 -1
sound/soc/samsung/littlemill.c
··· 104 104 static int littlemill_hw_params(struct snd_pcm_substream *substream, 105 105 struct snd_pcm_hw_params *params) 106 106 { 107 - struct snd_soc_pcm_runtime *rtd = substream->private_data; 107 + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 108 108 struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); 109 109 int ret; 110 110
+4 -4
sound/soc/samsung/neo1973_wm8753.c
··· 25 25 static int neo1973_hifi_hw_params(struct snd_pcm_substream *substream, 26 26 struct snd_pcm_hw_params *params) 27 27 { 28 - struct snd_soc_pcm_runtime *rtd = substream->private_data; 28 + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 29 29 struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); 30 30 struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); 31 31 unsigned int pll_out = 0, bclk = 0; ··· 99 99 100 100 static int neo1973_hifi_hw_free(struct snd_pcm_substream *substream) 101 101 { 102 - struct snd_soc_pcm_runtime *rtd = substream->private_data; 102 + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 103 103 struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); 104 104 105 105 /* disable the PLL */ ··· 117 117 static int neo1973_voice_hw_params(struct snd_pcm_substream *substream, 118 118 struct snd_pcm_hw_params *params) 119 119 { 120 - struct snd_soc_pcm_runtime *rtd = substream->private_data; 120 + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 121 121 struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); 122 122 unsigned int pcmdiv = 0; 123 123 int ret = 0; ··· 154 154 155 155 static int neo1973_voice_hw_free(struct snd_pcm_substream *substream) 156 156 { 157 - struct snd_soc_pcm_runtime *rtd = substream->private_data; 157 + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 158 158 struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); 159 159 160 160 /* disable the PLL */
+3 -3
sound/soc/samsung/odroid.c
··· 35 35 static int odroid_card_fe_hw_params(struct snd_pcm_substream *substream, 36 36 struct snd_pcm_hw_params *params) 37 37 { 38 - struct snd_soc_pcm_runtime *rtd = substream->private_data; 38 + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 39 39 struct odroid_priv *priv = snd_soc_card_get_drvdata(rtd->card); 40 40 unsigned long flags; 41 41 int ret = 0; ··· 56 56 static int odroid_card_be_hw_params(struct snd_pcm_substream *substream, 57 57 struct snd_pcm_hw_params *params) 58 58 { 59 - struct snd_soc_pcm_runtime *rtd = substream->private_data; 59 + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 60 60 struct odroid_priv *priv = snd_soc_card_get_drvdata(rtd->card); 61 61 unsigned int pll_freq, rclk_freq, rfs; 62 62 unsigned long flags; ··· 115 115 116 116 static int odroid_card_be_trigger(struct snd_pcm_substream *substream, int cmd) 117 117 { 118 - struct snd_soc_pcm_runtime *rtd = substream->private_data; 118 + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 119 119 struct odroid_priv *priv = snd_soc_card_get_drvdata(rtd->card); 120 120 unsigned long flags; 121 121
+2 -2
sound/soc/samsung/pcm.c
··· 216 216 static int s3c_pcm_trigger(struct snd_pcm_substream *substream, int cmd, 217 217 struct snd_soc_dai *dai) 218 218 { 219 - struct snd_soc_pcm_runtime *rtd = substream->private_data; 219 + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 220 220 struct s3c_pcm_info *pcm = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0)); 221 221 unsigned long flags; 222 222 ··· 260 260 struct snd_pcm_hw_params *params, 261 261 struct snd_soc_dai *socdai) 262 262 { 263 - struct snd_soc_pcm_runtime *rtd = substream->private_data; 263 + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 264 264 struct s3c_pcm_info *pcm = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0)); 265 265 void __iomem *regs = pcm->regs; 266 266 struct clk *clk;
+1 -1
sound/soc/samsung/rx1950_uda1380.c
··· 148 148 static int rx1950_hw_params(struct snd_pcm_substream *substream, 149 149 struct snd_pcm_hw_params *params) 150 150 { 151 - struct snd_soc_pcm_runtime *rtd = substream->private_data; 151 + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 152 152 struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); 153 153 int div; 154 154 int ret;
+1 -1
sound/soc/samsung/s3c-i2s-v2.c
··· 379 379 static int s3c2412_i2s_trigger(struct snd_pcm_substream *substream, int cmd, 380 380 struct snd_soc_dai *dai) 381 381 { 382 - struct snd_soc_pcm_runtime *rtd = substream->private_data; 382 + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 383 383 struct s3c_i2sv2_info *i2s = to_info(asoc_rtd_to_cpu(rtd, 0)); 384 384 int capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); 385 385 unsigned long irqs;
+1 -1
sound/soc/samsung/s3c24xx_simtec.c
··· 159 159 static int simtec_hw_params(struct snd_pcm_substream *substream, 160 160 struct snd_pcm_hw_params *params) 161 161 { 162 - struct snd_soc_pcm_runtime *rtd = substream->private_data; 162 + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 163 163 struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); 164 164 struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); 165 165 int ret;
+3 -3
sound/soc/samsung/s3c24xx_uda134x.c
··· 49 49 50 50 static int s3c24xx_uda134x_startup(struct snd_pcm_substream *substream) 51 51 { 52 - struct snd_soc_pcm_runtime *rtd = substream->private_data; 52 + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 53 53 struct s3c24xx_uda134x *priv = snd_soc_card_get_drvdata(rtd->card); 54 54 struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); 55 55 int ret = 0; ··· 101 101 102 102 static void s3c24xx_uda134x_shutdown(struct snd_pcm_substream *substream) 103 103 { 104 - struct snd_soc_pcm_runtime *rtd = substream->private_data; 104 + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 105 105 struct s3c24xx_uda134x *priv = snd_soc_card_get_drvdata(rtd->card); 106 106 107 107 mutex_lock(&priv->clk_lock); ··· 118 118 static int s3c24xx_uda134x_hw_params(struct snd_pcm_substream *substream, 119 119 struct snd_pcm_hw_params *params) 120 120 { 121 - struct snd_soc_pcm_runtime *rtd = substream->private_data; 121 + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 122 122 struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); 123 123 struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); 124 124 unsigned int clk = 0;
+1 -1
sound/soc/samsung/smartq_wm8987.c
··· 24 24 static int smartq_hifi_hw_params(struct snd_pcm_substream *substream, 25 25 struct snd_pcm_hw_params *params) 26 26 { 27 - struct snd_soc_pcm_runtime *rtd = substream->private_data; 27 + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 28 28 struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); 29 29 struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); 30 30 unsigned int clk = 0;
+1 -1
sound/soc/samsung/smdk_spdif.c
··· 100 100 static int smdk_hw_params(struct snd_pcm_substream *substream, 101 101 struct snd_pcm_hw_params *params) 102 102 { 103 - struct snd_soc_pcm_runtime *rtd = substream->private_data; 103 + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 104 104 struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); 105 105 unsigned long pll_out, rclk_rate; 106 106 int ret, ratio;
+1 -1
sound/soc/samsung/smdk_wm8580.c
··· 22 22 static int smdk_hw_params(struct snd_pcm_substream *substream, 23 23 struct snd_pcm_hw_params *params) 24 24 { 25 - struct snd_soc_pcm_runtime *rtd = substream->private_data; 25 + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 26 26 struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); 27 27 unsigned int pll_out; 28 28 int rfs, ret;
+1 -1
sound/soc/samsung/smdk_wm8994.c
··· 44 44 static int smdk_hw_params(struct snd_pcm_substream *substream, 45 45 struct snd_pcm_hw_params *params) 46 46 { 47 - struct snd_soc_pcm_runtime *rtd = substream->private_data; 47 + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 48 48 struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); 49 49 unsigned int pll_out; 50 50 int ret;
+1 -1
sound/soc/samsung/smdk_wm8994pcm.c
··· 43 43 static int smdk_wm8994_pcm_hw_params(struct snd_pcm_substream *substream, 44 44 struct snd_pcm_hw_params *params) 45 45 { 46 - struct snd_soc_pcm_runtime *rtd = substream->private_data; 46 + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 47 47 struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); 48 48 struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); 49 49 unsigned long mclk_freq;
+1 -1
sound/soc/samsung/snow.c
··· 30 30 static const unsigned int pll_rate[] = { 31 31 73728000U, 67737602U, 49152000U, 45158401U, 32768001U 32 32 }; 33 - struct snd_soc_pcm_runtime *rtd = substream->private_data; 33 + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 34 34 struct snow_priv *priv = snd_soc_card_get_drvdata(rtd->card); 35 35 int bfs, psr, rfs, bitwidth; 36 36 unsigned long int rclk;
+3 -3
sound/soc/samsung/spdif.c
··· 141 141 static int spdif_trigger(struct snd_pcm_substream *substream, int cmd, 142 142 struct snd_soc_dai *dai) 143 143 { 144 - struct snd_soc_pcm_runtime *rtd = substream->private_data; 144 + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 145 145 struct samsung_spdif_info *spdif = to_info(asoc_rtd_to_cpu(rtd, 0)); 146 146 unsigned long flags; 147 147 ··· 177 177 struct snd_pcm_hw_params *params, 178 178 struct snd_soc_dai *socdai) 179 179 { 180 - struct snd_soc_pcm_runtime *rtd = substream->private_data; 180 + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 181 181 struct samsung_spdif_info *spdif = to_info(asoc_rtd_to_cpu(rtd, 0)); 182 182 void __iomem *regs = spdif->regs; 183 183 struct snd_dmaengine_dai_dma_data *dma_data; ··· 279 279 static void spdif_shutdown(struct snd_pcm_substream *substream, 280 280 struct snd_soc_dai *dai) 281 281 { 282 - struct snd_soc_pcm_runtime *rtd = substream->private_data; 282 + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 283 283 struct samsung_spdif_info *spdif = to_info(asoc_rtd_to_cpu(rtd, 0)); 284 284 void __iomem *regs = spdif->regs; 285 285 u32 con, clkcon;
+4 -4
sound/soc/samsung/tm2_wm5110.c
··· 92 92 static int tm2_aif1_hw_params(struct snd_pcm_substream *substream, 93 93 struct snd_pcm_hw_params *params) 94 94 { 95 - struct snd_soc_pcm_runtime *rtd = substream->private_data; 95 + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 96 96 struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component; 97 97 struct tm2_machine_priv *priv = snd_soc_card_get_drvdata(rtd->card); 98 98 ··· 133 133 static int tm2_aif2_hw_params(struct snd_pcm_substream *substream, 134 134 struct snd_pcm_hw_params *params) 135 135 { 136 - struct snd_soc_pcm_runtime *rtd = substream->private_data; 136 + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 137 137 struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component; 138 138 unsigned int asyncclk_rate; 139 139 int ret; ··· 187 187 188 188 static int tm2_aif2_hw_free(struct snd_pcm_substream *substream) 189 189 { 190 - struct snd_soc_pcm_runtime *rtd = substream->private_data; 190 + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 191 191 struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component; 192 192 int ret; 193 193 ··· 208 208 static int tm2_hdmi_hw_params(struct snd_pcm_substream *substream, 209 209 struct snd_pcm_hw_params *params) 210 210 { 211 - struct snd_soc_pcm_runtime *rtd = substream->private_data; 211 + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 212 212 struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); 213 213 unsigned int bfs; 214 214 int bitwidth, ret;