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 6e6d67d..c81ece7 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 5de6334..8b83f39 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 a95c34e..9139a1e 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 a57bb98..f86e302 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 949d2e0..3089901 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 2f2f83a..f4375c4 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 fcc7897..998d10c 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 1339e41..b7ce1da 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 30c7e1b..6eda5af 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 f6e67d0..a5b1a12 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 4b247e9..3afe63c 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 593be1b..3588878 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 4543705..fd2a4da 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 55d2a80..abb5c47 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 fab3db9..36bef13 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 4baef84..776a270 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 d096ff9..02074c3 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 8fa5f6b..a9f345f 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 6e44f79..746930d 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 bebcf0a..40c5de8 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 1a9f08a..759fc66 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 8f175f2..f5f6ba0 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 043a287..6dfd540 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 1aa3fdb..c962d2c 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);