ASoC: samsung: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Mon, 23 Mar 2020 05:20:20 +0000 (14:20 +0900)
committerMark Brown <broonie@kernel.org>
Fri, 27 Mar 2020 14:44:45 +0000 (14:44 +0000)
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87ftdzir57.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
24 files changed:
sound/soc/samsung/arndale.c
sound/soc/samsung/bells.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/lowland.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/speyside.c
sound/soc/samsung/tm2_wm5110.c
sound/soc/samsung/tobermory.c

index 6e6d67d6e0ab4c9f14fab88606e6c813d6ef13f2..c81ece78e0360f699336c276853f5f9753ec7e80 100644 (file)
@@ -21,8 +21,8 @@ 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_dai *cpu_dai = rtd->cpu_dai;
-       struct snd_soc_dai *codec_dai = rtd->codec_dai;
+       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;
        unsigned long rclk;
 
@@ -56,7 +56,7 @@ 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_dai *codec_dai = rtd->codec_dai;
+       struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
        unsigned int rfs, rclk;
 
        /* Ensure AIF1CLK is >= 3 MHz for optimal performance */
index 5de633497f839b2590e7369da3586ebfd315c32b..8b83f39c3ac918a660c8ca0522295f7f55112476 100644 (file)
@@ -60,7 +60,7 @@ static int bells_set_bias_level(struct snd_soc_card *card,
        int ret;
 
        rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[DAI_DSP_CODEC]);
-       codec_dai = rtd->codec_dai;
+       codec_dai = asoc_rtd_to_codec(rtd, 0);
        component = codec_dai->component;
 
        if (dapm->dev != codec_dai->dev)
@@ -106,7 +106,7 @@ static int bells_set_bias_level_post(struct snd_soc_card *card,
        int ret;
 
        rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[DAI_DSP_CODEC]);
-       codec_dai = rtd->codec_dai;
+       codec_dai = asoc_rtd_to_codec(rtd, 0);
        component = codec_dai->component;
 
        if (dapm->dev != codec_dai->dev)
@@ -152,11 +152,11 @@ static int bells_late_probe(struct snd_soc_card *card)
        int ret;
 
        rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[DAI_AP_DSP]);
-       wm0010 = rtd->codec_dai->component;
+       wm0010 = asoc_rtd_to_codec(rtd, 0)->component;
 
        rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[DAI_DSP_CODEC]);
-       component = rtd->codec_dai->component;
-       aif1_dai = rtd->codec_dai;
+       component = asoc_rtd_to_codec(rtd, 0)->component;
+       aif1_dai = asoc_rtd_to_codec(rtd, 0);
 
        ret = snd_soc_component_set_sysclk(component, ARIZONA_CLK_SYSCLK,
                                       ARIZONA_CLK_SRC_FLL1,
@@ -195,7 +195,7 @@ static int bells_late_probe(struct snd_soc_card *card)
        }
 
        rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[DAI_CODEC_CP]);
-       aif2_dai = rtd->cpu_dai;
+       aif2_dai = asoc_rtd_to_cpu(rtd, 0);
 
        ret = snd_soc_dai_set_sysclk(aif2_dai, ARIZONA_CLK_ASYNCCLK, 0, 0);
        if (ret != 0) {
@@ -207,8 +207,8 @@ static int bells_late_probe(struct snd_soc_card *card)
                return 0;
 
        rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[DAI_CODEC_SUB]);
-       aif3_dai = rtd->cpu_dai;
-       wm9081_dai = rtd->codec_dai;
+       aif3_dai = asoc_rtd_to_cpu(rtd, 0);
+       wm9081_dai = asoc_rtd_to_codec(rtd, 0);
 
        ret = snd_soc_dai_set_sysclk(aif3_dai, ARIZONA_CLK_SYSCLK, 0, 0);
        if (ret != 0) {
index a95c34e53a2b901904247589165f455f2595113b..9139a1e7e2006293a48f7f8cd3dbb95b204b6768 100644 (file)
@@ -68,7 +68,7 @@ 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_dai *cpu_dai = rtd->cpu_dai;
+       struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
        int div;
        int ret;
        unsigned int rate = params_rate(params);
index a57bb989a0efd58c581ddbbf29542a284c5aa6fa..f86e3028b402402bf6a3ec4628588f0bbe4884ef 100644 (file)
@@ -932,7 +932,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 i2s_dai *i2s = to_info(rtd->cpu_dai);
+       struct i2s_dai *i2s = to_info(asoc_rtd_to_cpu(rtd, 0));
        unsigned long flags;
 
        switch (cmd) {
index 949d2e0299625594b2f873c6e4c6f140c2f63ad1..30899016cf08a5177446c78909868c0ecd1c50bd 100644 (file)
@@ -33,8 +33,8 @@ 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_dai *codec_dai = rtd->codec_dai;
-       struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
+       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;
        unsigned int clk = 0;
        int ret = 0;
index 2f2f83a8c23a35ed2f6215fdc0e522ef3707cd43..f4375c49f7f49dd6771bb153a1208dd768320a4a 100644 (file)
@@ -23,7 +23,7 @@ static int littlemill_set_bias_level(struct snd_soc_card *card,
        int ret;
 
        rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[0]);
-       aif1_dai = rtd->codec_dai;
+       aif1_dai = asoc_rtd_to_codec(rtd, 0);
 
        if (dapm->dev != aif1_dai->dev)
                return 0;
@@ -70,7 +70,7 @@ static int littlemill_set_bias_level_post(struct snd_soc_card *card,
        int ret;
 
        rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[0]);
-       aif1_dai = rtd->codec_dai;
+       aif1_dai = asoc_rtd_to_codec(rtd, 0);
 
        if (dapm->dev != aif1_dai->dev)
                return 0;
@@ -105,7 +105,7 @@ 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_dai *codec_dai = rtd->codec_dai;
+       struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
        int ret;
 
        sample_rate = params_rate(params);
@@ -181,7 +181,7 @@ static int bbclk_ev(struct snd_soc_dapm_widget *w,
        int ret;
 
        rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[1]);
-       aif2_dai = rtd->cpu_dai;
+       aif2_dai = asoc_rtd_to_cpu(rtd, 0);
 
        switch (event) {
        case SND_SOC_DAPM_PRE_PMU:
@@ -264,11 +264,11 @@ static int littlemill_late_probe(struct snd_soc_card *card)
        int ret;
 
        rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[0]);
-       component = rtd->codec_dai->component;
-       aif1_dai = rtd->codec_dai;
+       component = asoc_rtd_to_codec(rtd, 0)->component;
+       aif1_dai = asoc_rtd_to_codec(rtd, 0);
 
        rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[1]);
-       aif2_dai = rtd->cpu_dai;
+       aif2_dai = asoc_rtd_to_cpu(rtd, 0);
 
        ret = snd_soc_dai_set_sysclk(aif1_dai, WM8994_SYSCLK_MCLK2,
                                     32768, SND_SOC_CLOCK_IN);
index fcc7897ee7d05e9fa4fac9334377e7fac8a19306..998d10cf8c9476be8f23744a0bfe1703f024e37c 100644 (file)
@@ -32,7 +32,7 @@ static struct snd_soc_jack_pin lowland_headset_pins[] = {
 
 static int lowland_wm5100_init(struct snd_soc_pcm_runtime *rtd)
 {
-       struct snd_soc_component *component = rtd->codec_dai->component;
+       struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component;
        int ret;
 
        ret = snd_soc_component_set_sysclk(component, WM5100_CLK_SYSCLK,
@@ -65,7 +65,7 @@ static int lowland_wm5100_init(struct snd_soc_pcm_runtime *rtd)
 
 static int lowland_wm9081_init(struct snd_soc_pcm_runtime *rtd)
 {
-       struct snd_soc_component *component = rtd->codec_dai->component;
+       struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component;
 
        snd_soc_dapm_nc_pin(&rtd->card->dapm, "LINEOUT");
 
index 1339e41e986072744a98083bb045a3ef69400904..b7ce1da854cee03b4f2d9f19560abd0cf56362eb 100644 (file)
@@ -26,8 +26,8 @@ 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_dai *codec_dai = rtd->codec_dai;
-       struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
+       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;
        int ret = 0;
        unsigned long iis_clkrate;
@@ -100,7 +100,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_dai *codec_dai = rtd->codec_dai;
+       struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
 
        /* disable the PLL */
        return snd_soc_dai_set_pll(codec_dai, WM8753_PLL1, 0, 0, 0);
@@ -118,7 +118,7 @@ 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_dai *codec_dai = rtd->codec_dai;
+       struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
        unsigned int pcmdiv = 0;
        int ret = 0;
        unsigned long iis_clkrate;
@@ -155,7 +155,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_dai *codec_dai = rtd->codec_dai;
+       struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
 
        /* disable the PLL */
        return snd_soc_dai_set_pll(codec_dai, WM8753_PLL2, 0, 0, 0);
index 30c7e1bc2a30b2d46ca836318f1eed2c629fd1e2..6eda5af989fe38a8f07a5c2d28fadb147cd4b8d6 100644 (file)
@@ -98,7 +98,7 @@ static int odroid_card_be_hw_params(struct snd_pcm_substream *substream,
                return ret;
 
        if (rtd->num_codecs > 1) {
-               struct snd_soc_dai *codec_dai = rtd->codec_dais[1];
+               struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 1);
 
                ret = snd_soc_dai_set_sysclk(codec_dai, 0, rclk_freq,
                                             SND_SOC_CLOCK_IN);
index f6e67d0e7882b3441418d4db770b08c0c318ab4f..a5b1a12b349660e6b727a48a078d1e91baeca1a1 100644 (file)
@@ -212,7 +212,7 @@ 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 s3c_pcm_info *pcm = snd_soc_dai_get_drvdata(rtd->cpu_dai);
+       struct s3c_pcm_info *pcm = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0));
        unsigned long flags;
 
        dev_dbg(pcm->dev, "Entered %s\n", __func__);
@@ -256,7 +256,7 @@ static int s3c_pcm_hw_params(struct snd_pcm_substream *substream,
                                 struct snd_soc_dai *socdai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
-       struct s3c_pcm_info *pcm = snd_soc_dai_get_drvdata(rtd->cpu_dai);
+       struct s3c_pcm_info *pcm = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0));
        void __iomem *regs = pcm->regs;
        struct clk *clk;
        int sclk_div, sync_div;
index 4b247e91ae5b2dae231126d90df799633d8c0803..3afe63c0923ebd8abc2d1fca68dd61476fc5a2d9 100644 (file)
@@ -149,7 +149,7 @@ 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_dai *cpu_dai = rtd->cpu_dai;
+       struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
        int div;
        int ret;
        unsigned int rate = params_rate(params);
index 593be1b668d644e3716456ccdc278b4a3139b224..35888784829388bac9417c1e541911b2a92f7dfc 100644 (file)
@@ -380,7 +380,7 @@ 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 s3c_i2sv2_info *i2s = to_info(rtd->cpu_dai);
+       struct s3c_i2sv2_info *i2s = to_info(asoc_rtd_to_cpu(rtd, 0));
        int capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE);
        unsigned long irqs;
        int ret = 0;
index 4543705b8d87d29418ba6f553b4c03cce25ea008..fd2a4da086f3084bed37955b5d2f085b5707b01f 100644 (file)
@@ -160,8 +160,8 @@ 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_dai *codec_dai = rtd->codec_dai;
-       struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
+       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;
 
        ret = snd_soc_dai_set_sysclk(codec_dai, 0,
index 55d2a802a6cb6a3a20962592af3a70f3cb76dbf0..abb5c4713c534e6f1b50ff141625a8e451f4508c 100644 (file)
@@ -51,7 +51,7 @@ static int s3c24xx_uda134x_startup(struct snd_pcm_substream *substream)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct s3c24xx_uda134x *priv = snd_soc_card_get_drvdata(rtd->card);
-       struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
+       struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
        int ret = 0;
 
        mutex_lock(&priv->clk_lock);
@@ -119,8 +119,8 @@ 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_dai *codec_dai = rtd->codec_dai;
-       struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
+       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;
        int ret = 0;
        int clk_source, fs_mode;
index fab3db9fdb98f28df797090a618cbc55bd82dd6d..36bef136d57f818c7e9ba8282d861dfd144ee9fe 100644 (file)
@@ -25,8 +25,8 @@ 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_dai *codec_dai = rtd->codec_dai;
-       struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
+       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;
        int ret;
 
index 4baef84d29ee220ae1ee57fdaa4147743e82810d..776a270261bf1b397cfe5361e2fac16aaa449c98 100644 (file)
@@ -101,7 +101,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_dai *cpu_dai = rtd->cpu_dai;
+       struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
        unsigned long pll_out, rclk_rate;
        int ret, ratio;
 
index d096ff9122607bcbbe42f55529c421380981d824..02074c34a2b2e16f7986410506114886e82b3fe1 100644 (file)
@@ -23,7 +23,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_dai *codec_dai = rtd->codec_dai;
+       struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
        unsigned int pll_out;
        int rfs, ret;
 
index 8fa5f6b387adcf34bd419afe2589b7cdbbdd6b6f..a9f345f19a8a1cd019c34172d65ad8f26fa00922 100644 (file)
@@ -45,7 +45,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_dai *codec_dai = rtd->codec_dai;
+       struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
        unsigned int pll_out;
        int ret;
 
index 6e44f7927852e3bef9e2de462a5853f1fdf5a106..746930dde5d7917587be324de45327520d219236 100644 (file)
@@ -44,8 +44,8 @@ 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_dai *codec_dai = rtd->codec_dai;
-       struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
+       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;
        int rfs, ret;
 
index bebcf0a4d608e7fc484dc3ed9aedf3b9b1a4542b..40c5de8df0ffe7b81ff373536b29a302e85376fb 100644 (file)
@@ -110,9 +110,9 @@ static int snow_late_probe(struct snd_soc_card *card)
 
        /* In the multi-codec case codec_dais 0 is MAX98095 and 1 is HDMI. */
        if (rtd->num_codecs > 1)
-               codec_dai = rtd->codec_dais[0];
+               codec_dai = asoc_rtd_to_codec(rtd, 0);
        else
-               codec_dai = rtd->codec_dai;
+               codec_dai = asoc_rtd_to_codec(rtd, 0);
 
        /* Set the MCLK rate for the codec */
        return snd_soc_dai_set_sysclk(codec_dai, 0,
index 1a9f08a50394bfa134ec3bf2fce006c23a2f3f5a..759fc66443298a8b6f2b792130f008a0dd6123af 100644 (file)
@@ -142,7 +142,7 @@ 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 samsung_spdif_info *spdif = to_info(rtd->cpu_dai);
+       struct samsung_spdif_info *spdif = to_info(asoc_rtd_to_cpu(rtd, 0));
        unsigned long flags;
 
        dev_dbg(spdif->dev, "Entered %s\n", __func__);
@@ -178,7 +178,7 @@ static int spdif_hw_params(struct snd_pcm_substream *substream,
                                struct snd_soc_dai *socdai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
-       struct samsung_spdif_info *spdif = to_info(rtd->cpu_dai);
+       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;
        u32 con, clkcon, cstas;
@@ -194,7 +194,7 @@ static int spdif_hw_params(struct snd_pcm_substream *substream,
                return -EINVAL;
        }
 
-       snd_soc_dai_set_dma_data(rtd->cpu_dai, substream, dma_data);
+       snd_soc_dai_set_dma_data(asoc_rtd_to_cpu(rtd, 0), substream, dma_data);
 
        spin_lock_irqsave(&spdif->lock, flags);
 
@@ -280,7 +280,7 @@ static void spdif_shutdown(struct snd_pcm_substream *substream,
                                struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
-       struct samsung_spdif_info *spdif = to_info(rtd->cpu_dai);
+       struct samsung_spdif_info *spdif = to_info(asoc_rtd_to_cpu(rtd, 0));
        void __iomem *regs = spdif->regs;
        u32 con, clkcon;
 
index 8f175f204eb70a5c99d6180d8a5bbb38200325c5..f5f6ba00d0731f07113f112478b99893b754f940 100644 (file)
@@ -25,7 +25,7 @@ static int speyside_set_bias_level(struct snd_soc_card *card,
        int ret;
 
        rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[1]);
-       codec_dai = rtd->codec_dai;
+       codec_dai = asoc_rtd_to_codec(rtd, 0);
 
        if (dapm->dev != codec_dai->dev)
                return 0;
@@ -61,7 +61,7 @@ static int speyside_set_bias_level_post(struct snd_soc_card *card,
        int ret;
 
        rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[1]);
-       codec_dai = rtd->codec_dai;
+       codec_dai = asoc_rtd_to_codec(rtd, 0);
 
        if (dapm->dev != codec_dai->dev)
                return 0;
@@ -131,7 +131,7 @@ static void speyside_set_polarity(struct snd_soc_component *component,
 
 static int speyside_wm0010_init(struct snd_soc_pcm_runtime *rtd)
 {
-       struct snd_soc_dai *dai = rtd->codec_dai;
+       struct snd_soc_dai *dai = asoc_rtd_to_codec(rtd, 0);
        int ret;
 
        ret = snd_soc_dai_set_sysclk(dai, 0, MCLK_AUDIO_RATE, 0);
@@ -143,7 +143,7 @@ static int speyside_wm0010_init(struct snd_soc_pcm_runtime *rtd)
 
 static int speyside_wm8996_init(struct snd_soc_pcm_runtime *rtd)
 {
-       struct snd_soc_dai *dai = rtd->codec_dai;
+       struct snd_soc_dai *dai = asoc_rtd_to_codec(rtd, 0);
        struct snd_soc_component *component = dai->component;
        int ret;
 
index 043a287728b36b66f957616d83c7c9c26bf98e7f..6dfd540e2d743a0951d11c544616fa766f00a55c 100644 (file)
@@ -93,7 +93,7 @@ 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_component *component = rtd->codec_dai->component;
+       struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component;
        struct tm2_machine_priv *priv = snd_soc_card_get_drvdata(rtd->card);
 
        switch (params_rate(params)) {
@@ -134,7 +134,7 @@ 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_component *component = rtd->codec_dai->component;
+       struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component;
        unsigned int asyncclk_rate;
        int ret;
 
@@ -188,7 +188,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_component *component = rtd->codec_dai->component;
+       struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component;
        int ret;
 
        /* disable FLL2 */
@@ -209,7 +209,7 @@ 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_dai *cpu_dai = rtd->cpu_dai;
+       struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
        unsigned int bfs;
        int bitwidth, ret;
 
@@ -284,7 +284,7 @@ static int tm2_set_bias_level(struct snd_soc_card *card,
 
        rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[0]);
 
-       if (dapm->dev != rtd->codec_dai->dev)
+       if (dapm->dev != asoc_rtd_to_codec(rtd, 0)->dev)
                return 0;
 
        switch (level) {
@@ -315,8 +315,8 @@ static int tm2_late_probe(struct snd_soc_card *card)
        int ret;
 
        rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[TM2_DAI_AIF1]);
-       aif1_dai = rtd->codec_dai;
-       priv->component = rtd->codec_dai->component;
+       aif1_dai = asoc_rtd_to_codec(rtd, 0);
+       priv->component = asoc_rtd_to_codec(rtd, 0)->component;
 
        ret = snd_soc_dai_set_sysclk(aif1_dai, ARIZONA_CLK_SYSCLK, 0, 0);
        if (ret < 0) {
@@ -325,7 +325,7 @@ static int tm2_late_probe(struct snd_soc_card *card)
        }
 
        rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[TM2_DAI_AIF2]);
-       aif2_dai = rtd->codec_dai;
+       aif2_dai = asoc_rtd_to_codec(rtd, 0);
 
        ret = snd_soc_dai_set_sysclk(aif2_dai, ARIZONA_CLK_ASYNCCLK, 0, 0);
        if (ret < 0) {
index 1aa3fdb4b15218f0fd6d8ca286d5ce350baf382c..c962d2c2a7f78941b7fa84519091032cfb4f46cc 100644 (file)
@@ -23,7 +23,7 @@ static int tobermory_set_bias_level(struct snd_soc_card *card,
        int ret;
 
        rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[0]);
-       codec_dai = rtd->codec_dai;
+       codec_dai = asoc_rtd_to_codec(rtd, 0);
 
        if (dapm->dev != codec_dai->dev)
                return 0;
@@ -66,7 +66,7 @@ static int tobermory_set_bias_level_post(struct snd_soc_card *card,
        int ret;
 
        rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[0]);
-       codec_dai = rtd->codec_dai;
+       codec_dai = asoc_rtd_to_codec(rtd, 0);
 
        if (dapm->dev != codec_dai->dev)
                return 0;
@@ -181,8 +181,8 @@ static int tobermory_late_probe(struct snd_soc_card *card)
        int ret;
 
        rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[0]);
-       component = rtd->codec_dai->component;
-       codec_dai = rtd->codec_dai;
+       component = asoc_rtd_to_codec(rtd, 0)->component;
+       codec_dai = asoc_rtd_to_codec(rtd, 0);
 
        ret = snd_soc_dai_set_sysclk(codec_dai, WM8962_SYSCLK_MCLK,
                                     32768, SND_SOC_CLOCK_IN);