ASoC: Merge dai_ops factor out
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 11 Mar 2009 16:51:31 +0000 (16:51 +0000)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 11 Mar 2009 16:51:31 +0000 (16:51 +0000)
Merge Eric Maio's patch to merge snd_soc_dai_ops out of line.  Fixed
merge issues and updated drivers, plus an issue with the ops for the two
s3c2443 AC97 DAIs having been merged.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
42 files changed:
include/sound/soc-dai.h
sound/soc/atmel/atmel_ssc_dai.c
sound/soc/au1x/psc-ac97.c
sound/soc/au1x/psc-i2s.c
sound/soc/blackfin/bf5xx-i2s.c
sound/soc/codecs/ac97.c
sound/soc/codecs/ak4104.c
sound/soc/codecs/ak4535.c
sound/soc/codecs/cs4270.c
sound/soc/codecs/ssm2602.c
sound/soc/codecs/tlv320aic23.c
sound/soc/codecs/tlv320aic26.c
sound/soc/codecs/tlv320aic3x.c
sound/soc/codecs/uda134x.c
sound/soc/codecs/uda1380.c
sound/soc/codecs/wm8350.c
sound/soc/codecs/wm8400.c
sound/soc/codecs/wm8510.c
sound/soc/codecs/wm8580.c
sound/soc/codecs/wm8728.c
sound/soc/codecs/wm8731.c
sound/soc/codecs/wm8750.c
sound/soc/codecs/wm8753.c
sound/soc/codecs/wm8900.c
sound/soc/codecs/wm8903.c
sound/soc/codecs/wm8971.c
sound/soc/codecs/wm8990.c
sound/soc/codecs/wm9705.c
sound/soc/codecs/wm9712.c
sound/soc/codecs/wm9713.c
sound/soc/davinci/davinci-i2s.c
sound/soc/fsl/fsl_ssi.c
sound/soc/fsl/mpc5200_psc_i2s.c
sound/soc/omap/omap-mcbsp.c
sound/soc/pxa/pxa-ssp.c
sound/soc/pxa/pxa2xx-ac97.c
sound/soc/pxa/pxa2xx-i2s.c
sound/soc/s3c24xx/s3c2412-i2s.c
sound/soc/s3c24xx/s3c2443-ac97.c
sound/soc/s3c24xx/s3c24xx-i2s.c
sound/soc/sh/ssi.c
sound/soc/soc-core.c

index 24247f763608d7c5b654a0c87f7af5ac6ec7016d..13676472ddfcca7ace85a4bc407c66d40a746b79 100644 (file)
@@ -203,7 +203,7 @@ struct snd_soc_dai {
        int (*resume)(struct snd_soc_dai *dai);
 
        /* ops */
-       struct snd_soc_dai_ops ops;
+       struct snd_soc_dai_ops *ops;
 
        /* DAI capabilities */
        struct snd_soc_pcm_stream capture;
index ff0054b765028062bb0040985777969f940fe6fd..e588e63f18d205e6e7f1d118b4982711f867cd51 100644 (file)
@@ -697,6 +697,15 @@ static int atmel_ssc_resume(struct snd_soc_dai *cpu_dai)
 #define ATMEL_SSC_FORMATS (SNDRV_PCM_FMTBIT_S8     | SNDRV_PCM_FMTBIT_S16_LE |\
                          SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)
 
+static struct snd_soc_dai_ops atmel_ssc_dai_ops = {
+       .startup        = atmel_ssc_startup,
+       .shutdown       = atmel_ssc_shutdown,
+       .prepare        = atmel_ssc_prepare,
+       .hw_params      = atmel_ssc_hw_params,
+       .set_fmt        = atmel_ssc_set_dai_fmt,
+       .set_clkdiv     = atmel_ssc_set_dai_clkdiv,
+};
+
 struct snd_soc_dai atmel_ssc_dai[NUM_SSC_DEVICES] = {
        {       .name = "atmel-ssc0",
                .id = 0,
@@ -712,13 +721,7 @@ struct snd_soc_dai atmel_ssc_dai[NUM_SSC_DEVICES] = {
                        .channels_max = 2,
                        .rates = ATMEL_SSC_RATES,
                        .formats = ATMEL_SSC_FORMATS,},
-               .ops = {
-                       .startup = atmel_ssc_startup,
-                       .shutdown = atmel_ssc_shutdown,
-                       .prepare = atmel_ssc_prepare,
-                       .hw_params = atmel_ssc_hw_params,
-                       .set_fmt = atmel_ssc_set_dai_fmt,
-                       .set_clkdiv = atmel_ssc_set_dai_clkdiv,},
+               .ops = &atmel_ssc_dai_ops,
                .private_data = &ssc_info[0],
        },
 #if NUM_SSC_DEVICES == 3
@@ -736,13 +739,7 @@ struct snd_soc_dai atmel_ssc_dai[NUM_SSC_DEVICES] = {
                        .channels_max = 2,
                        .rates = ATMEL_SSC_RATES,
                        .formats = ATMEL_SSC_FORMATS,},
-               .ops = {
-                       .startup = atmel_ssc_startup,
-                       .shutdown = atmel_ssc_shutdown,
-                       .prepare = atmel_ssc_prepare,
-                       .hw_params = atmel_ssc_hw_params,
-                       .set_fmt = atmel_ssc_set_dai_fmt,
-                       .set_clkdiv = atmel_ssc_set_dai_clkdiv,},
+               .ops = &atmel_ssc_dai_ops,
                .private_data = &ssc_info[1],
        },
        {       .name = "atmel-ssc2",
@@ -759,13 +756,7 @@ struct snd_soc_dai atmel_ssc_dai[NUM_SSC_DEVICES] = {
                        .channels_max = 2,
                        .rates = ATMEL_SSC_RATES,
                        .formats = ATMEL_SSC_FORMATS,},
-               .ops = {
-                       .startup = atmel_ssc_startup,
-                       .shutdown = atmel_ssc_shutdown,
-                       .prepare = atmel_ssc_prepare,
-                       .hw_params = atmel_ssc_hw_params,
-                       .set_fmt = atmel_ssc_set_dai_fmt,
-                       .set_clkdiv = atmel_ssc_set_dai_clkdiv,},
+               .ops = &atmel_ssc_dai_ops,
                .private_data = &ssc_info[2],
        },
 #endif
index f0e30aec7f233621a23a35f9fa8100facdc4a189..479d7bdf1865cb822cdca9677d3180e2805e4d69 100644 (file)
@@ -342,6 +342,11 @@ static int au1xpsc_ac97_resume(struct snd_soc_dai *dai)
        return 0;
 }
 
+static struct snd_soc_dai_ops au1xpsc_ac97_dai_ops = {
+       .trigger        = au1xpsc_ac97_trigger,
+       .hw_params      = au1xpsc_ac97_hw_params,
+};
+
 struct snd_soc_dai au1xpsc_ac97_dai = {
        .name                   = "au1xpsc_ac97",
        .ac97_control           = 1,
@@ -361,10 +366,7 @@ struct snd_soc_dai au1xpsc_ac97_dai = {
                .channels_min   = 2,
                .channels_max   = 2,
        },
-       .ops = {
-               .trigger        = au1xpsc_ac97_trigger,
-               .hw_params      = au1xpsc_ac97_hw_params,
-       },
+       .ops = &au1xpsc_ac97_dai_ops,
 };
 EXPORT_SYMBOL_GPL(au1xpsc_ac97_dai);
 
index f916de4400edcc358a58a33d227f9fafd0ce88af..bb589327ee32e495e706638af92022e9803b5947 100644 (file)
@@ -367,6 +367,12 @@ static int au1xpsc_i2s_resume(struct snd_soc_dai *cpu_dai)
        return 0;
 }
 
+static struct snd_soc_dai_ops au1xpsc_i2s_dai_ops = {
+       .trigger        = au1xpsc_i2s_trigger,
+       .hw_params      = au1xpsc_i2s_hw_params,
+       .set_fmt        = au1xpsc_i2s_set_fmt,
+};
+
 struct snd_soc_dai au1xpsc_i2s_dai = {
        .name                   = "au1xpsc_i2s",
        .probe                  = au1xpsc_i2s_probe,
@@ -385,11 +391,7 @@ struct snd_soc_dai au1xpsc_i2s_dai = {
                .channels_min   = 2,
                .channels_max   = 8,    /* 2 without external help */
        },
-       .ops = {
-               .trigger        = au1xpsc_i2s_trigger,
-               .hw_params      = au1xpsc_i2s_hw_params,
-               .set_fmt        = au1xpsc_i2s_set_fmt,
-       },
+       .ops = &au1xpsc_i2s_dai_ops,
 };
 EXPORT_SYMBOL(au1xpsc_i2s_dai);
 
index d1d95d2393feb81ea8352d52e04e00b6d59d3d1b..964824419678bfe361b77bab3ce538eb7af6bc38 100644 (file)
@@ -287,6 +287,13 @@ static int bf5xx_i2s_resume(struct platform_device *pdev,
 #define BF5XX_I2S_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE |\
        SNDRV_PCM_FMTBIT_S32_LE)
 
+static struct snd_soc_dai_ops bf5xx_i2s_dai_ops = {
+       .startup        = bf5xx_i2s_startup,
+       .shutdown       = bf5xx_i2s_shutdown,
+       .hw_params      = bf5xx_i2s_hw_params,
+       .set_fmt        = bf5xx_i2s_set_dai_fmt,
+};
+
 struct snd_soc_dai bf5xx_i2s_dai = {
        .name = "bf5xx-i2s",
        .id = 0,
@@ -304,12 +311,7 @@ struct snd_soc_dai bf5xx_i2s_dai = {
                .channels_max = 2,
                .rates = BF5XX_I2S_RATES,
                .formats = BF5XX_I2S_FORMATS,},
-       .ops = {
-               .startup   = bf5xx_i2s_startup,
-               .shutdown  = bf5xx_i2s_shutdown,
-               .hw_params = bf5xx_i2s_hw_params,
-               .set_fmt = bf5xx_i2s_set_dai_fmt,
-       },
+       .ops = &bf5xx_i2s_dai_ops,
 };
 EXPORT_SYMBOL_GPL(bf5xx_i2s_dai);
 
index 11f84b6e5cb86cf30341be275e2f75290a171f9d..b0d4af145b873900509ce18239e2c85899aa9069 100644 (file)
@@ -41,6 +41,10 @@ static int ac97_prepare(struct snd_pcm_substream *substream,
                SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 |\
                SNDRV_PCM_RATE_48000)
 
+static struct snd_soc_dai_ops ac97_dai_ops = {
+       .prepare        = ac97_prepare,
+};
+
 struct snd_soc_dai ac97_dai = {
        .name = "AC97 HiFi",
        .ac97_control = 1,
@@ -56,8 +60,7 @@ struct snd_soc_dai ac97_dai = {
                .channels_max = 2,
                .rates = STD_AC97_RATES,
                .formats = SNDRV_PCM_FMTBIT_S16_LE,},
-       .ops = {
-               .prepare = ac97_prepare,},
+       .ops = &ac97_dai_ops,
 };
 EXPORT_SYMBOL_GPL(ac97_dai);
 
index 338381f4fe1eb509bab2c9e8123e10f8b163bda9..4d47bc4f74284764ec24434167371d3245009df8 100644 (file)
@@ -174,6 +174,11 @@ static int ak4104_hw_params(struct snd_pcm_substream *substream,
        return ak4104_spi_write(codec, AK4104_REG_CHN_STATUS(3), val);
 }
 
+static struct snd_soc_dai_ops ak4101_dai_ops = {
+       .hw_params = ak4104_hw_params,
+       .set_fmt = ak4104_set_dai_fmt,
+};
+
 struct snd_soc_dai ak4104_dai = {
        .name = DRV_NAME,
        .playback = {
@@ -187,10 +192,7 @@ struct snd_soc_dai ak4104_dai = {
                           SNDRV_PCM_FMTBIT_S24_3LE |
                           SNDRV_PCM_FMTBIT_S24_LE
        },
-       .ops = {
-               .hw_params = ak4104_hw_params,
-               .set_fmt = ak4104_set_dai_fmt,
-       }
+       .ops = &ak4101_dai_ops,
 };
 
 static struct snd_soc_codec *ak4104_codec;
index d56e6bb1fedbe542c7603fc43c841daf12cf0bf7..1f63d387a2f49e366b0cfe95ff539615dd6a5795 100644 (file)
@@ -421,6 +421,13 @@ static int ak4535_set_bias_level(struct snd_soc_codec *codec,
                SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 |\
                SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000)
 
+static struct snd_soc_dai_ops ak4535_dai_ops = {
+       .hw_params      = ak4535_hw_params,
+       .set_fmt        = ak4535_set_dai_fmt,
+       .digital_mute   = ak4535_mute,
+       .set_sysclk     = ak4535_set_dai_sysclk,
+};
+
 struct snd_soc_dai ak4535_dai = {
        .name = "AK4535",
        .playback = {
@@ -435,12 +442,7 @@ struct snd_soc_dai ak4535_dai = {
                .channels_max = 2,
                .rates = AK4535_RATES,
                .formats = SNDRV_PCM_FMTBIT_S16_LE,},
-       .ops = {
-               .hw_params = ak4535_hw_params,
-               .set_fmt = ak4535_set_dai_fmt,
-               .digital_mute = ak4535_mute,
-               .set_sysclk = ak4535_set_dai_sysclk,
-       },
+       .ops = &ak4535_dai_ops,
 };
 EXPORT_SYMBOL_GPL(ak4535_dai);
 
index 0e0c23ee6afc95f274f47a6e36992f94edc5cbe9..2137670c9b789b076a6b4f6894d8fafcf93ad8bd 100644 (file)
@@ -502,6 +502,13 @@ static const struct snd_kcontrol_new cs4270_snd_controls[] = {
  */
 static struct snd_soc_codec *cs4270_codec;
 
+static struct snd_soc_dai_ops cs4270_dai_ops = {
+       .hw_params      = cs4270_hw_params,
+       .set_sysclk     = cs4270_set_dai_sysclk,
+       .set_fmt        = cs4270_set_dai_fmt,
+       .digital_mute   = cs4270_mute,
+};
+
 struct snd_soc_dai cs4270_dai = {
        .name = "cs4270",
        .playback = {
@@ -518,12 +525,7 @@ struct snd_soc_dai cs4270_dai = {
                .rates = 0,
                .formats = CS4270_FORMATS,
        },
-       .ops = {
-               .hw_params = cs4270_hw_params,
-               .set_sysclk = cs4270_set_dai_sysclk,
-               .set_fmt = cs4270_set_dai_fmt,
-               .digital_mute = cs4270_mute,
-       },
+       .ops = &cs4270_dai_ops,
 };
 EXPORT_SYMBOL_GPL(cs4270_dai);
 
index 58e225dadc7e3ad0e80bc29d4b77c26c9dc1fd53..87f606c7682292af24e5f213cf7c919465116fd1 100644 (file)
@@ -506,6 +506,16 @@ static int ssm2602_set_bias_level(struct snd_soc_codec *codec,
 #define SSM2602_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
                SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)
 
+static struct snd_soc_dai_ops ssm2602_dai_ops = {
+       .startup        = ssm2602_startup,
+       .prepare        = ssm2602_pcm_prepare,
+       .hw_params      = ssm2602_hw_params,
+       .shutdown       = ssm2602_shutdown,
+       .digital_mute   = ssm2602_mute,
+       .set_sysclk     = ssm2602_set_dai_sysclk,
+       .set_fmt        = ssm2602_set_dai_fmt,
+};
+
 struct snd_soc_dai ssm2602_dai = {
        .name = "SSM2602",
        .playback = {
@@ -520,15 +530,7 @@ struct snd_soc_dai ssm2602_dai = {
                .channels_max = 2,
                .rates = SSM2602_RATES,
                .formats = SSM2602_FORMATS,},
-       .ops = {
-               .startup = ssm2602_startup,
-               .prepare = ssm2602_pcm_prepare,
-               .hw_params = ssm2602_hw_params,
-               .shutdown = ssm2602_shutdown,
-               .digital_mute = ssm2602_mute,
-               .set_sysclk = ssm2602_set_dai_sysclk,
-               .set_fmt = ssm2602_set_dai_fmt,
-       }
+       .ops = &ssm2602_dai_ops,
 };
 EXPORT_SYMBOL_GPL(ssm2602_dai);
 
index 8b20c360adf51ce6ce347da4e931f7210eae7406..c3f4afb5d0173a581d0bcb18e8670d88c2d4d498 100644 (file)
@@ -580,6 +580,15 @@ static int tlv320aic23_set_bias_level(struct snd_soc_codec *codec,
 #define AIC23_FORMATS  (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \
                         SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S32_LE)
 
+static struct snd_soc_dai_ops tlv320aic23_dai_ops = {
+       .prepare        = tlv320aic23_pcm_prepare,
+       .hw_params      = tlv320aic23_hw_params,
+       .shutdown       = tlv320aic23_shutdown,
+       .digital_mute   = tlv320aic23_mute,
+       .set_fmt        = tlv320aic23_set_dai_fmt,
+       .set_sysclk     = tlv320aic23_set_dai_sysclk,
+};
+
 struct snd_soc_dai tlv320aic23_dai = {
        .name = "tlv320aic23",
        .playback = {
@@ -594,14 +603,7 @@ struct snd_soc_dai tlv320aic23_dai = {
                    .channels_max = 2,
                    .rates = AIC23_RATES,
                    .formats = AIC23_FORMATS,},
-       .ops = {
-               .prepare = tlv320aic23_pcm_prepare,
-               .hw_params = tlv320aic23_hw_params,
-               .shutdown = tlv320aic23_shutdown,
-               .digital_mute = tlv320aic23_mute,
-               .set_fmt = tlv320aic23_set_dai_fmt,
-               .set_sysclk = tlv320aic23_set_dai_sysclk,
-       }
+       .ops = &tlv320aic23_dai_ops,
 };
 EXPORT_SYMBOL_GPL(tlv320aic23_dai);
 
index 229e464cf713c71ff6bc8df9a676c8303c51136a..a7f333fc579e3fb5325dafdf6f1511fe8cfff989 100644 (file)
@@ -270,6 +270,13 @@ static int aic26_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
 #define AIC26_FORMATS  (SNDRV_PCM_FMTBIT_S8     | SNDRV_PCM_FMTBIT_S16_BE |\
                         SNDRV_PCM_FMTBIT_S24_BE | SNDRV_PCM_FMTBIT_S32_BE)
 
+static struct snd_soc_dai_ops aic26_dai_ops = {
+       .hw_params      = aic26_hw_params,
+       .digital_mute   = aic26_mute,
+       .set_sysclk     = aic26_set_sysclk,
+       .set_fmt        = aic26_set_fmt,
+};
+
 struct snd_soc_dai aic26_dai = {
        .name = "tlv320aic26",
        .playback = {
@@ -286,12 +293,7 @@ struct snd_soc_dai aic26_dai = {
                .rates = AIC26_RATES,
                .formats = AIC26_FORMATS,
        },
-       .ops = {
-               .hw_params = aic26_hw_params,
-               .digital_mute = aic26_mute,
-               .set_sysclk = aic26_set_sysclk,
-               .set_fmt = aic26_set_fmt,
-       },
+       .ops = &aic26_dai_ops,
 };
 EXPORT_SYMBOL_GPL(aic26_dai);
 
index d638e3f0728bd89d6f508ac9e1ee994900ba6ca0..ab099f482487b7e642d0f3d1372e6001673b3d27 100644 (file)
@@ -1088,6 +1088,13 @@ EXPORT_SYMBOL_GPL(aic3x_button_pressed);
 #define AIC3X_FORMATS  (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \
                         SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S32_LE)
 
+static struct snd_soc_dai_ops aic3x_dai_ops = {
+       .hw_params      = aic3x_hw_params,
+       .digital_mute   = aic3x_mute,
+       .set_sysclk     = aic3x_set_dai_sysclk,
+       .set_fmt        = aic3x_set_dai_fmt,
+};
+
 struct snd_soc_dai aic3x_dai = {
        .name = "tlv320aic3x",
        .playback = {
@@ -1102,12 +1109,7 @@ struct snd_soc_dai aic3x_dai = {
                .channels_max = 2,
                .rates = AIC3X_RATES,
                .formats = AIC3X_FORMATS,},
-       .ops = {
-               .hw_params = aic3x_hw_params,
-               .digital_mute = aic3x_mute,
-               .set_sysclk = aic3x_set_dai_sysclk,
-               .set_fmt = aic3x_set_dai_fmt,
-       }
+       .ops = &aic3x_dai_ops,
 };
 EXPORT_SYMBOL_GPL(aic3x_dai);
 
index 661599295ca751330cec6d19002fbf31a62c1b38..ddefb8f80145bb1830253cde7277f3bf6ae50818 100644 (file)
@@ -431,6 +431,15 @@ SOC_ENUM("PCM Playback De-emphasis", uda134x_mixer_enum[1]),
 SOC_SINGLE("DC Filter Enable Switch", UDA134X_STATUS0, 0, 1, 0),
 };
 
+static struct snd_soc_dai_ops uda134x_dai_ops = {
+       .startup        = uda134x_startup,
+       .shutdown       = uda134x_shutdown,
+       .hw_params      = uda134x_hw_params,
+       .digital_mute   = uda134x_mute,
+       .set_sysclk     = uda134x_set_dai_sysclk,
+       .set_fmt        = uda134x_set_dai_fmt,
+};
+
 struct snd_soc_dai uda134x_dai = {
        .name = "UDA134X",
        /* playback capabilities */
@@ -450,14 +459,7 @@ struct snd_soc_dai uda134x_dai = {
                .formats = UDA134X_FORMATS,
        },
        /* pcm operations */
-       .ops = {
-               .startup = uda134x_startup,
-               .shutdown = uda134x_shutdown,
-               .hw_params = uda134x_hw_params,
-               .digital_mute = uda134x_mute,
-               .set_sysclk = uda134x_set_dai_sysclk,
-               .set_fmt = uda134x_set_dai_fmt,
-       }
+       .ops = &uda134x_dai_ops,
 };
 EXPORT_SYMBOL(uda134x_dai);
 
index 1b10f488328c015479c65393071a01ed4f4b85b2..5b21594e0e58283ee30d3ee6ea209d8636929aef 100644 (file)
@@ -579,6 +579,27 @@ static int uda1380_set_bias_level(struct snd_soc_codec *codec,
                       SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 |\
                       SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000)
 
+static struct snd_soc_dai_ops uda1380_dai_ops = {
+       .hw_params      = uda1380_pcm_hw_params,
+       .shutdown       = uda1380_pcm_shutdown,
+       .trigger        = uda1380_trigger,
+       .set_fmt        = uda1380_set_dai_fmt_both,
+};
+
+static struct snd_soc_dai_ops uda1380_dai_ops_playback = {
+       .hw_params      = uda1380_pcm_hw_params,
+       .shutdown       = uda1380_pcm_shutdown,
+       .trigger        = uda1380_trigger,
+       .set_fmt        = uda1380_set_dai_fmt_playback,
+};
+
+static struct snd_soc_dai_ops uda1380_dai_ops_capture = {
+       .hw_params      = uda1380_pcm_hw_params,
+       .shutdown       = uda1380_pcm_shutdown,
+       .trigger        = uda1380_trigger,
+       .set_fmt        = uda1380_set_dai_fmt_capture,
+};
+
 struct snd_soc_dai uda1380_dai[] = {
 {
        .name = "UDA1380",
@@ -594,12 +615,7 @@ struct snd_soc_dai uda1380_dai[] = {
                .channels_max = 2,
                .rates = UDA1380_RATES,
                .formats = SNDRV_PCM_FMTBIT_S16_LE,},
-       .ops = {
-               .trigger = uda1380_trigger,
-               .hw_params = uda1380_pcm_hw_params,
-               .shutdown = uda1380_pcm_shutdown,
-               .set_fmt = uda1380_set_dai_fmt_both,
-       },
+       .ops = &uda1380_dai_ops,
 },
 { /* playback only - dual interface */
        .name = "UDA1380",
@@ -610,12 +626,7 @@ struct snd_soc_dai uda1380_dai[] = {
                .rates = UDA1380_RATES,
                .formats = SNDRV_PCM_FMTBIT_S16_LE,
        },
-       .ops = {
-               .trigger = uda1380_trigger,
-               .hw_params = uda1380_pcm_hw_params,
-               .shutdown = uda1380_pcm_shutdown,
-               .set_fmt = uda1380_set_dai_fmt_playback,
-       },
+       .ops = &uda1380_dai_ops_playback,
 },
 { /* capture only - dual interface*/
        .name = "UDA1380",
@@ -626,12 +637,7 @@ struct snd_soc_dai uda1380_dai[] = {
                .rates = UDA1380_RATES,
                .formats = SNDRV_PCM_FMTBIT_S16_LE,
        },
-       .ops = {
-               .trigger = uda1380_trigger,
-               .hw_params = uda1380_pcm_hw_params,
-               .shutdown = uda1380_pcm_shutdown,
-               .set_fmt = uda1380_set_dai_fmt_capture,
-       },
+       .ops = &uda1380_dai_ops_capture,
 },
 };
 EXPORT_SYMBOL_GPL(uda1380_dai);
index 359e5cc86f34aa121c04dfbe93357e9e72936ea6..3b1d0993bed947fa815c559b0cd8db1aa144f24f 100644 (file)
@@ -1538,6 +1538,16 @@ static int wm8350_remove(struct platform_device *pdev)
                        SNDRV_PCM_FMTBIT_S20_3LE |\
                        SNDRV_PCM_FMTBIT_S24_LE)
 
+static struct snd_soc_dai_ops wm8350_dai_ops = {
+        .hw_params     = wm8350_pcm_hw_params,
+        .digital_mute  = wm8350_mute,
+        .trigger       = wm8350_pcm_trigger,
+        .set_fmt       = wm8350_set_dai_fmt,
+        .set_sysclk    = wm8350_set_dai_sysclk,
+        .set_pll       = wm8350_set_fll,
+        .set_clkdiv    = wm8350_set_clkdiv,
+};
+
 struct snd_soc_dai wm8350_dai = {
        .name = "WM8350",
        .playback = {
@@ -1554,15 +1564,7 @@ struct snd_soc_dai wm8350_dai = {
                 .rates = WM8350_RATES,
                 .formats = WM8350_FORMATS,
         },
-       .ops = {
-                .hw_params = wm8350_pcm_hw_params,
-                .digital_mute = wm8350_mute,
-                .trigger = wm8350_pcm_trigger,
-                .set_fmt = wm8350_set_dai_fmt,
-                .set_sysclk = wm8350_set_dai_sysclk,
-                .set_pll = wm8350_set_fll,
-                .set_clkdiv = wm8350_set_clkdiv,
-        },
+       .ops = &wm8350_dai_ops,
 };
 EXPORT_SYMBOL_GPL(wm8350_dai);
 
index 9cb73d9d023d647e433cbf7c7391ae63815347d2..4e1cefff8483c27bc18ae08589c089975900f4df 100644 (file)
@@ -1210,6 +1210,14 @@ static int wm8400_set_bias_level(struct snd_soc_codec *codec,
 #define WM8400_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
        SNDRV_PCM_FMTBIT_S24_LE)
 
+static struct snd_soc_dai_ops wm8400_dai_ops = {
+       .hw_params = wm8400_hw_params,
+       .digital_mute = wm8400_mute,
+       .set_fmt = wm8400_set_dai_fmt,
+       .set_clkdiv = wm8400_set_dai_clkdiv,
+       .set_sysclk = wm8400_set_dai_sysclk,
+};
+
 /*
  * The WM8400 supports 2 different and mutually exclusive DAI
  * configurations.
@@ -1235,13 +1243,7 @@ struct snd_soc_dai wm8400_dai = {
                .rates = WM8400_RATES,
                .formats = WM8400_FORMATS,
        },
-       .ops = {
-               .hw_params = wm8400_hw_params,
-               .digital_mute = wm8400_mute,
-               .set_fmt = wm8400_set_dai_fmt,
-               .set_clkdiv = wm8400_set_dai_clkdiv,
-               .set_sysclk = wm8400_set_dai_sysclk,
-       },
+       .ops = &wm8400_dai_ops,
 };
 EXPORT_SYMBOL_GPL(wm8400_dai);
 
index 6d4ef71e9195210284c52d7d24b43686ada63a48..6a4cea09c45dbe624ba2941442c68e3fdb5971c2 100644 (file)
@@ -554,6 +554,14 @@ static int wm8510_set_bias_level(struct snd_soc_codec *codec,
 #define WM8510_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
        SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)
 
+static struct snd_soc_dai_ops wm8510_dai_ops = {
+       .hw_params      = wm8510_pcm_hw_params,
+       .digital_mute   = wm8510_mute,
+       .set_fmt        = wm8510_set_dai_fmt,
+       .set_clkdiv     = wm8510_set_dai_clkdiv,
+       .set_pll        = wm8510_set_dai_pll,
+};
+
 struct snd_soc_dai wm8510_dai = {
        .name = "WM8510 HiFi",
        .playback = {
@@ -568,13 +576,7 @@ struct snd_soc_dai wm8510_dai = {
                .channels_max = 2,
                .rates = WM8510_RATES,
                .formats = WM8510_FORMATS,},
-       .ops = {
-               .hw_params = wm8510_pcm_hw_params,
-               .digital_mute = wm8510_mute,
-               .set_fmt = wm8510_set_dai_fmt,
-               .set_clkdiv = wm8510_set_dai_clkdiv,
-               .set_pll = wm8510_set_dai_pll,
-       },
+       .ops = &wm8510_dai_ops,
 };
 EXPORT_SYMBOL_GPL(wm8510_dai);
 
index 6cab82a9c9d74826379057254ea1f64144916bda..27f9e231bf69c2524ce2247f0e39fb8882c7ebd7 100644 (file)
@@ -769,6 +769,21 @@ static int wm8580_set_bias_level(struct snd_soc_codec *codec,
 #define WM8580_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
                        SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)
 
+static struct snd_soc_dai_ops wm8580_dai_ops_playback = {
+       .hw_params      = wm8580_paif_hw_params,
+       .set_fmt        = wm8580_set_paif_dai_fmt,
+       .set_clkdiv     = wm8580_set_dai_clkdiv,
+       .set_pll        = wm8580_set_dai_pll,
+       .digital_mute   = wm8580_digital_mute,
+};
+
+static struct snd_soc_dai_ops wm8580_dai_ops_capture = {
+       .hw_params      = wm8580_paif_hw_params,
+       .set_fmt        = wm8580_set_paif_dai_fmt,
+       .set_clkdiv     = wm8580_set_dai_clkdiv,
+       .set_pll        = wm8580_set_dai_pll,
+};
+
 struct snd_soc_dai wm8580_dai[] = {
        {
                .name = "WM8580 PAIFRX",
@@ -780,13 +795,7 @@ struct snd_soc_dai wm8580_dai[] = {
                        .rates = SNDRV_PCM_RATE_8000_192000,
                        .formats = WM8580_FORMATS,
                },
-               .ops = {
-                        .hw_params = wm8580_paif_hw_params,
-                        .set_fmt = wm8580_set_paif_dai_fmt,
-                        .set_clkdiv = wm8580_set_dai_clkdiv,
-                        .set_pll = wm8580_set_dai_pll,
-                        .digital_mute = wm8580_digital_mute,
-                },
+               .ops = &wm8580_dai_ops_playback,
        },
        {
                .name = "WM8580 PAIFTX",
@@ -798,12 +807,7 @@ struct snd_soc_dai wm8580_dai[] = {
                        .rates = SNDRV_PCM_RATE_8000_192000,
                        .formats = WM8580_FORMATS,
                },
-               .ops = {
-                        .hw_params = wm8580_paif_hw_params,
-                        .set_fmt = wm8580_set_paif_dai_fmt,
-                        .set_clkdiv = wm8580_set_dai_clkdiv,
-                        .set_pll = wm8580_set_dai_pll,
-                },
+               .ops = &wm8580_dai_ops_capture,
        },
 };
 EXPORT_SYMBOL_GPL(wm8580_dai);
index f8363b308895161d6631a454e86bcdfdc1b92297..e7ff2121ede9b7b4781eecf9ead866db3afbd289 100644 (file)
@@ -244,6 +244,12 @@ static int wm8728_set_bias_level(struct snd_soc_codec *codec,
 #define WM8728_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
        SNDRV_PCM_FMTBIT_S24_LE)
 
+static struct snd_soc_dai_ops wm8728_dai_ops = {
+       .hw_params      = wm8728_hw_params,
+       .digital_mute   = wm8728_mute,
+       .set_fmt        = wm8728_set_dai_fmt,
+};
+
 struct snd_soc_dai wm8728_dai = {
        .name = "WM8728",
        .playback = {
@@ -253,11 +259,7 @@ struct snd_soc_dai wm8728_dai = {
                .rates = WM8728_RATES,
                .formats = WM8728_FORMATS,
        },
-       .ops = {
-                .hw_params = wm8728_hw_params,
-                .digital_mute = wm8728_mute,
-                .set_fmt = wm8728_set_dai_fmt,
-       }
+       .ops = &wm8728_dai_ops,
 };
 EXPORT_SYMBOL_GPL(wm8728_dai);
 
index 9e7ebcc2c491d559f69a3c12731233fd8fb35af2..e043e3f60008b46579e4ae97e411a0df1790e15b 100644 (file)
@@ -433,6 +433,15 @@ static int wm8731_set_bias_level(struct snd_soc_codec *codec,
 #define WM8731_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
        SNDRV_PCM_FMTBIT_S24_LE)
 
+static struct snd_soc_dai_ops wm8731_dai_ops = {
+       .prepare        = wm8731_pcm_prepare,
+       .hw_params      = wm8731_hw_params,
+       .shutdown       = wm8731_shutdown,
+       .digital_mute   = wm8731_mute,
+       .set_sysclk     = wm8731_set_dai_sysclk,
+       .set_fmt        = wm8731_set_dai_fmt,
+};
+
 struct snd_soc_dai wm8731_dai = {
        .name = "WM8731",
        .playback = {
@@ -447,14 +456,7 @@ struct snd_soc_dai wm8731_dai = {
                .channels_max = 2,
                .rates = WM8731_RATES,
                .formats = WM8731_FORMATS,},
-       .ops = {
-               .prepare = wm8731_pcm_prepare,
-               .hw_params = wm8731_hw_params,
-               .shutdown = wm8731_shutdown,
-               .digital_mute = wm8731_mute,
-               .set_sysclk = wm8731_set_dai_sysclk,
-               .set_fmt = wm8731_set_dai_fmt,
-       }
+       .ops = &wm8731_dai_ops,
 };
 EXPORT_SYMBOL_GPL(wm8731_dai);
 
index 96afb86addc62ed7147bc53327a4ebb37d2be42b..b64509b01a49645f847d91fbcf1f051e1248f53b 100644 (file)
@@ -679,6 +679,13 @@ static int wm8750_set_bias_level(struct snd_soc_codec *codec,
 #define WM8750_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
        SNDRV_PCM_FMTBIT_S24_LE)
 
+static struct snd_soc_dai_ops wm8750_dai_ops = {
+       .hw_params      = wm8750_pcm_hw_params,
+       .digital_mute   = wm8750_mute,
+       .set_fmt        = wm8750_set_dai_fmt,
+       .set_sysclk     = wm8750_set_dai_sysclk,
+};
+
 struct snd_soc_dai wm8750_dai = {
        .name = "WM8750",
        .playback = {
@@ -693,12 +700,7 @@ struct snd_soc_dai wm8750_dai = {
                .channels_max = 2,
                .rates = WM8750_RATES,
                .formats = WM8750_FORMATS,},
-       .ops = {
-               .hw_params = wm8750_pcm_hw_params,
-               .digital_mute = wm8750_mute,
-               .set_fmt = wm8750_set_dai_fmt,
-               .set_sysclk = wm8750_set_dai_sysclk,
-       },
+       .ops = &wm8750_dai_ops,
 };
 EXPORT_SYMBOL_GPL(wm8750_dai);
 
index 1d5eca89de60817ac98ba21135243cd00589a805..a6e8f3f7f052ee4dc45b8ef4540f4cf31c9f411e 100644 (file)
@@ -1301,6 +1301,51 @@ static int wm8753_set_bias_level(struct snd_soc_codec *codec,
  * 3. Voice disabled - HIFI over HIFI
  * 4. Voice disabled - HIFI over HIFI, uses voice DAI LRC for capture
  */
+static struct snd_soc_dai_ops wm8753_dai_ops_hifi_mode1 = {
+       .hw_params      = wm8753_i2s_hw_params,
+       .digital_mute   = wm8753_mute,
+       .set_fmt        = wm8753_mode1h_set_dai_fmt,
+       .set_clkdiv     = wm8753_set_dai_clkdiv,
+       .set_pll        = wm8753_set_dai_pll,
+       .set_sysclk     = wm8753_set_dai_sysclk,
+};
+
+static struct snd_soc_dai_ops wm8753_dai_ops_voice_mode1 = {
+       .hw_params      = wm8753_pcm_hw_params,
+       .digital_mute   = wm8753_mute,
+       .set_fmt        = wm8753_mode1v_set_dai_fmt,
+       .set_clkdiv     = wm8753_set_dai_clkdiv,
+       .set_pll        = wm8753_set_dai_pll,
+       .set_sysclk     = wm8753_set_dai_sysclk,
+};
+
+static struct snd_soc_dai_ops wm8753_dai_ops_voice_mode2 = {
+       .hw_params      = wm8753_pcm_hw_params,
+       .digital_mute   = wm8753_mute,
+       .set_fmt        = wm8753_mode2_set_dai_fmt,
+       .set_clkdiv     = wm8753_set_dai_clkdiv,
+       .set_pll        = wm8753_set_dai_pll,
+       .set_sysclk     = wm8753_set_dai_sysclk,
+};
+
+static struct snd_soc_dai_ops wm8753_dai_ops_hifi_mode3        = {
+       .hw_params      = wm8753_i2s_hw_params,
+       .digital_mute   = wm8753_mute,
+       .set_fmt        = wm8753_mode3_4_set_dai_fmt,
+       .set_clkdiv     = wm8753_set_dai_clkdiv,
+       .set_pll        = wm8753_set_dai_pll,
+       .set_sysclk     = wm8753_set_dai_sysclk,
+};
+
+static struct snd_soc_dai_ops wm8753_dai_ops_hifi_mode4        = {
+       .hw_params      = wm8753_i2s_hw_params,
+       .digital_mute   = wm8753_mute,
+       .set_fmt        = wm8753_mode3_4_set_dai_fmt,
+       .set_clkdiv     = wm8753_set_dai_clkdiv,
+       .set_pll        = wm8753_set_dai_pll,
+       .set_sysclk     = wm8753_set_dai_sysclk,
+};
+
 static const struct snd_soc_dai wm8753_all_dai[] = {
 /* DAI HiFi mode 1 */
 {      .name = "WM8753 HiFi",
@@ -1317,14 +1362,7 @@ static const struct snd_soc_dai wm8753_all_dai[] = {
                .channels_max = 2,
                .rates = WM8753_RATES,
                .formats = WM8753_FORMATS},
-       .ops = {
-               .hw_params = wm8753_i2s_hw_params,
-               .digital_mute = wm8753_mute,
-               .set_fmt = wm8753_mode1h_set_dai_fmt,
-               .set_clkdiv = wm8753_set_dai_clkdiv,
-               .set_pll = wm8753_set_dai_pll,
-               .set_sysclk = wm8753_set_dai_sysclk,
-       },
+       .ops = &wm8753_dai_ops_hifi_mode1,
 },
 /* DAI Voice mode 1 */
 {      .name = "WM8753 Voice",
@@ -1341,14 +1379,7 @@ static const struct snd_soc_dai wm8753_all_dai[] = {
                .channels_max = 2,
                .rates = WM8753_RATES,
                .formats = WM8753_FORMATS,},
-       .ops = {
-               .hw_params = wm8753_pcm_hw_params,
-               .digital_mute = wm8753_mute,
-               .set_fmt = wm8753_mode1v_set_dai_fmt,
-               .set_clkdiv = wm8753_set_dai_clkdiv,
-               .set_pll = wm8753_set_dai_pll,
-               .set_sysclk = wm8753_set_dai_sysclk,
-       },
+       .ops = &wm8753_dai_ops_voice_mode1,
 },
 /* DAI HiFi mode 2 - dummy */
 {      .name = "WM8753 HiFi",
@@ -1369,14 +1400,7 @@ static const struct snd_soc_dai wm8753_all_dai[] = {
                .channels_max = 2,
                .rates = WM8753_RATES,
                .formats = WM8753_FORMATS,},
-       .ops = {
-               .hw_params = wm8753_pcm_hw_params,
-               .digital_mute = wm8753_mute,
-               .set_fmt = wm8753_mode2_set_dai_fmt,
-               .set_clkdiv = wm8753_set_dai_clkdiv,
-               .set_pll = wm8753_set_dai_pll,
-               .set_sysclk = wm8753_set_dai_sysclk,
-       },
+       .ops = &wm8753_dai_ops_voice_mode2,
 },
 /* DAI HiFi mode 3 */
 {      .name = "WM8753 HiFi",
@@ -1393,14 +1417,7 @@ static const struct snd_soc_dai wm8753_all_dai[] = {
                .channels_max = 2,
                .rates = WM8753_RATES,
                .formats = WM8753_FORMATS,},
-       .ops = {
-               .hw_params = wm8753_i2s_hw_params,
-               .digital_mute = wm8753_mute,
-               .set_fmt = wm8753_mode3_4_set_dai_fmt,
-               .set_clkdiv = wm8753_set_dai_clkdiv,
-               .set_pll = wm8753_set_dai_pll,
-               .set_sysclk = wm8753_set_dai_sysclk,
-       },
+       .ops = &wm8753_dai_ops_hifi_mode3,
 },
 /* DAI Voice mode 3 - dummy */
 {      .name = "WM8753 Voice",
@@ -1421,14 +1438,7 @@ static const struct snd_soc_dai wm8753_all_dai[] = {
                .channels_max = 2,
                .rates = WM8753_RATES,
                .formats = WM8753_FORMATS,},
-       .ops = {
-               .hw_params = wm8753_i2s_hw_params,
-               .digital_mute = wm8753_mute,
-               .set_fmt = wm8753_mode3_4_set_dai_fmt,
-               .set_clkdiv = wm8753_set_dai_clkdiv,
-               .set_pll = wm8753_set_dai_pll,
-               .set_sysclk = wm8753_set_dai_sysclk,
-       },
+       .ops = &wm8753_dai_ops_hifi_mode4,
 },
 /* DAI Voice mode 4 - dummy */
 {      .name = "WM8753 Voice",
index da5ca64f89bb6619d897694f68efb50e182d2b65..46c5ea1ff921aea8c3f6be8fd13ed7bd8de1f897 100644 (file)
@@ -1088,6 +1088,14 @@ static int wm8900_digital_mute(struct snd_soc_dai *codec_dai, int mute)
        (SNDRV_PCM_FORMAT_S16_LE | SNDRV_PCM_FORMAT_S20_3LE | \
         SNDRV_PCM_FORMAT_S24_LE)
 
+static struct snd_soc_dai_ops wm8900_dai_ops = {
+       .hw_params      = wm8900_hw_params,
+       .set_clkdiv     = wm8900_set_dai_clkdiv,
+       .set_pll        = wm8900_set_dai_pll,
+       .set_fmt        = wm8900_set_dai_fmt,
+       .digital_mute   = wm8900_digital_mute,
+};
+
 struct snd_soc_dai wm8900_dai = {
        .name = "WM8900 HiFi",
        .playback = {
@@ -1104,13 +1112,7 @@ struct snd_soc_dai wm8900_dai = {
                .rates = WM8900_RATES,
                .formats = WM8900_PCM_FORMATS,
         },
-       .ops = {
-               .hw_params = wm8900_hw_params,
-                .set_clkdiv = wm8900_set_dai_clkdiv,
-                .set_pll = wm8900_set_dai_pll,
-                .set_fmt = wm8900_set_dai_fmt,
-                .digital_mute = wm8900_digital_mute,
-        },
+       .ops = &wm8900_dai_ops,
 };
 EXPORT_SYMBOL_GPL(wm8900_dai);
 
index c6fa8a71b4dd5a36bf55dde3f757318ed240b5e5..8cf571f1a803d3ae7b1b1e561aedb01470cc19dd 100644 (file)
@@ -1497,6 +1497,15 @@ static int wm8903_hw_params(struct snd_pcm_substream *substream,
                        SNDRV_PCM_FMTBIT_S20_3LE |\
                        SNDRV_PCM_FMTBIT_S24_LE)
 
+static struct snd_soc_dai_ops wm8903_dai_ops = {
+       .startup        = wm8903_startup,
+       .shutdown       = wm8903_shutdown,
+       .hw_params      = wm8903_hw_params,
+       .digital_mute   = wm8903_digital_mute,
+       .set_fmt        = wm8903_set_dai_fmt,
+       .set_sysclk     = wm8903_set_dai_sysclk,
+};
+
 struct snd_soc_dai wm8903_dai = {
        .name = "WM8903",
        .playback = {
@@ -1513,14 +1522,7 @@ struct snd_soc_dai wm8903_dai = {
                 .rates = WM8903_CAPTURE_RATES,
                 .formats = WM8903_FORMATS,
         },
-       .ops = {
-                .startup = wm8903_startup,
-                .shutdown = wm8903_shutdown,
-                .hw_params = wm8903_hw_params,
-                .digital_mute = wm8903_digital_mute,
-                .set_fmt = wm8903_set_dai_fmt,
-                .set_sysclk = wm8903_set_dai_sysclk
-       }
+       .ops = &wm8903_dai_ops,
 };
 EXPORT_SYMBOL_GPL(wm8903_dai);
 
index 24d4c905a0116d521060e05c88699738832de713..032dca22dbd3dce34746a3e3bc65717c051c7501 100644 (file)
@@ -604,6 +604,13 @@ static int wm8971_set_bias_level(struct snd_soc_codec *codec,
 #define WM8971_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
        SNDRV_PCM_FMTBIT_S24_LE)
 
+static struct snd_soc_dai_ops wm8971_dai_ops = {
+       .hw_params      = wm8971_pcm_hw_params,
+       .digital_mute   = wm8971_mute,
+       .set_fmt        = wm8971_set_dai_fmt,
+       .set_sysclk     = wm8971_set_dai_sysclk,
+};
+
 struct snd_soc_dai wm8971_dai = {
        .name = "WM8971",
        .playback = {
@@ -618,12 +625,7 @@ struct snd_soc_dai wm8971_dai = {
                .channels_max = 2,
                .rates = WM8971_RATES,
                .formats = WM8971_FORMATS,},
-       .ops = {
-               .hw_params = wm8971_pcm_hw_params,
-               .digital_mute = wm8971_mute,
-               .set_fmt = wm8971_set_dai_fmt,
-               .set_sysclk = wm8971_set_dai_sysclk,
-       },
+       .ops = &wm8971_dai_ops,
 };
 EXPORT_SYMBOL_GPL(wm8971_dai);
 
index 1a38421f75947736ec21e6a92f7b45b69934f831..c518c3e5aa3f8e10409dc16da5b9640610060c17 100644 (file)
@@ -1332,6 +1332,15 @@ static int wm8990_set_bias_level(struct snd_soc_codec *codec,
  * 1. ADC/DAC on Primary Interface
  * 2. ADC on Primary Interface/DAC on secondary
  */
+static struct snd_soc_dai_ops wm8990_dai_ops = {
+       .hw_params      = wm8990_hw_params,
+       .digital_mute   = wm8990_mute,
+       .set_fmt        = wm8990_set_dai_fmt,
+       .set_clkdiv     = wm8990_set_dai_clkdiv,
+       .set_pll        = wm8990_set_dai_pll,
+       .set_sysclk     = wm8990_set_dai_sysclk,
+};
+
 struct snd_soc_dai wm8990_dai = {
 /* ADC/DAC on primary */
        .name = "WM8990 ADC/DAC Primary",
@@ -1348,14 +1357,7 @@ struct snd_soc_dai wm8990_dai = {
                .channels_max = 2,
                .rates = WM8990_RATES,
                .formats = WM8990_FORMATS,},
-       .ops = {
-               .hw_params = wm8990_hw_params,
-               .digital_mute = wm8990_mute,
-               .set_fmt = wm8990_set_dai_fmt,
-               .set_clkdiv = wm8990_set_dai_clkdiv,
-               .set_pll = wm8990_set_dai_pll,
-               .set_sysclk = wm8990_set_dai_sysclk,
-       },
+       .ops = &wm8990_dai_ops,
 };
 EXPORT_SYMBOL_GPL(wm8990_dai);
 
index 2e9e06b2daaf9fdda6686af19036c6b48ea072d5..3265817c5c26ece6465d12683f5ccc739eb69d24 100644 (file)
@@ -269,6 +269,10 @@ static int ac97_prepare(struct snd_pcm_substream *substream,
                        SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \
                        SNDRV_PCM_RATE_48000)
 
+static struct snd_soc_dai_ops wm9705_dai_ops = {
+       .prepare        = ac97_prepare,
+};
+
 struct snd_soc_dai wm9705_dai[] = {
        {
                .name = "AC97 HiFi",
@@ -287,9 +291,7 @@ struct snd_soc_dai wm9705_dai[] = {
                        .rates = WM9705_AC97_RATES,
                        .formats = SNDRV_PCM_FMTBIT_S16_LE,
                },
-               .ops = {
-                       .prepare = ac97_prepare,
-               },
+               .ops = &wm9705_dai_ops,
        },
        {
                .name = "AC97 Aux",
index b3a8be77676e3850d8ed8881627afb00c7108e30..765cf1e7369eb37c3a8f85a5e8257a22c2957f8e 100644 (file)
@@ -517,6 +517,14 @@ static int ac97_aux_prepare(struct snd_pcm_substream *substream,
                SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 |\
                SNDRV_PCM_RATE_48000)
 
+static struct snd_soc_dai_ops wm9712_dai_ops_hifi = {
+       .prepare        = ac97_prepare,
+};
+
+static struct snd_soc_dai_ops wm9712_dai_ops_aux = {
+       .prepare        = ac97_aux_prepare,
+};
+
 struct snd_soc_dai wm9712_dai[] = {
 {
        .name = "AC97 HiFi",
@@ -533,8 +541,7 @@ struct snd_soc_dai wm9712_dai[] = {
                .channels_max = 2,
                .rates = WM9712_AC97_RATES,
                .formats = SNDRV_PCM_FMTBIT_S16_LE,},
-       .ops = {
-               .prepare = ac97_prepare,},
+       .ops = &wm9712_dai_ops_hifi,
 },
 {
        .name = "AC97 Aux",
@@ -544,8 +551,7 @@ struct snd_soc_dai wm9712_dai[] = {
                .channels_max = 1,
                .rates = WM9712_AC97_RATES,
                .formats = SNDRV_PCM_FMTBIT_S16_LE,},
-       .ops = {
-               .prepare = ac97_aux_prepare,},
+       .ops = &wm9712_dai_ops_aux,
 }
 };
 EXPORT_SYMBOL_GPL(wm9712_dai);
index a93aea5c18781ea0cecd6112cfc113162c9c7baa..523bad077fa04cc3f84a74feb7289bbb01c2c6a5 100644 (file)
@@ -1005,6 +1005,27 @@ static int ac97_aux_prepare(struct snd_pcm_substream *substream,
        (SNDRV_PCM_FORMAT_S16_LE | SNDRV_PCM_FORMAT_S20_3LE | \
         SNDRV_PCM_FORMAT_S24_LE)
 
+static struct snd_soc_dai_ops wm9713_dai_ops_hifi = {
+       .prepare        = ac97_hifi_prepare,
+       .set_clkdiv     = wm9713_set_dai_clkdiv,
+       .set_pll        = wm9713_set_dai_pll,
+};
+
+static struct snd_soc_dai_ops wm9713_dai_ops_aux = {
+       .prepare        = ac97_aux_prepare,
+       .set_clkdiv     = wm9713_set_dai_clkdiv,
+       .set_pll        = wm9713_set_dai_pll,
+};
+
+static struct snd_soc_dai_ops wm9713_dai_ops_voice = {
+       .hw_params      = wm9713_pcm_hw_params,
+       .shutdown       = wm9713_voiceshutdown,
+       .set_clkdiv     = wm9713_set_dai_clkdiv,
+       .set_pll        = wm9713_set_dai_pll,
+       .set_fmt        = wm9713_set_dai_fmt,
+       .set_tristate   = wm9713_set_dai_tristate,
+};
+
 struct snd_soc_dai wm9713_dai[] = {
 {
        .name = "AC97 HiFi",
@@ -1021,10 +1042,7 @@ struct snd_soc_dai wm9713_dai[] = {
                .channels_max = 2,
                .rates = WM9713_RATES,
                .formats = SNDRV_PCM_FMTBIT_S16_LE,},
-       .ops = {
-               .prepare = ac97_hifi_prepare,
-               .set_clkdiv = wm9713_set_dai_clkdiv,
-               .set_pll = wm9713_set_dai_pll,},
+       .ops = &wm9713_dai_ops_hifi,
        },
        {
        .name = "AC97 Aux",
@@ -1034,10 +1052,7 @@ struct snd_soc_dai wm9713_dai[] = {
                .channels_max = 1,
                .rates = WM9713_RATES,
                .formats = SNDRV_PCM_FMTBIT_S16_LE,},
-       .ops = {
-               .prepare = ac97_aux_prepare,
-               .set_clkdiv = wm9713_set_dai_clkdiv,
-               .set_pll = wm9713_set_dai_pll,},
+       .ops = &wm9713_dai_ops_aux,
        },
        {
        .name = "WM9713 Voice",
@@ -1053,14 +1068,7 @@ struct snd_soc_dai wm9713_dai[] = {
                .channels_max = 2,
                .rates = WM9713_PCM_RATES,
                .formats = WM9713_PCM_FORMATS,},
-       .ops = {
-               .hw_params = wm9713_pcm_hw_params,
-               .shutdown = wm9713_voiceshutdown,
-               .set_clkdiv = wm9713_set_dai_clkdiv,
-               .set_pll = wm9713_set_dai_pll,
-               .set_fmt = wm9713_set_dai_fmt,
-               .set_tristate = wm9713_set_dai_tristate,
-       },
+       .ops = &wm9713_dai_ops_voice,
        },
 };
 EXPORT_SYMBOL_GPL(wm9713_dai);
index 0fee779e3c7601168334bc6e60506d302c9da7ab..ffdb9439d3d875edd6d17e3d884b50d2b626af1e 100644 (file)
@@ -499,6 +499,13 @@ static void davinci_i2s_remove(struct platform_device *pdev,
 
 #define DAVINCI_I2S_RATES      SNDRV_PCM_RATE_8000_96000
 
+static struct snd_soc_dai_ops davinci_i2s_dai_ops = {
+       .startup        = davinci_i2s_startup,
+       .trigger        = davinci_i2s_trigger,
+       .hw_params      = davinci_i2s_hw_params,
+       .set_fmt        = davinci_i2s_set_dai_fmt,
+};
+
 struct snd_soc_dai davinci_i2s_dai = {
        .name = "davinci-i2s",
        .id = 0,
@@ -514,12 +521,7 @@ struct snd_soc_dai davinci_i2s_dai = {
                .channels_max = 2,
                .rates = DAVINCI_I2S_RATES,
                .formats = SNDRV_PCM_FMTBIT_S16_LE,},
-       .ops = {
-               .startup = davinci_i2s_startup,
-               .trigger = davinci_i2s_trigger,
-               .hw_params = davinci_i2s_hw_params,
-               .set_fmt = davinci_i2s_set_dai_fmt,
-       },
+       .ops = &davinci_i2s_dai_ops,
 };
 EXPORT_SYMBOL_GPL(davinci_i2s_dai);
 
index b7733e6be192fe0bf0d2792c4bb7e086695ddc5c..169bca295b7831f263739042aa1ed3645d59c99a 100644 (file)
@@ -580,6 +580,15 @@ static int fsl_ssi_set_fmt(struct snd_soc_dai *cpu_dai, unsigned int format)
 /**
  * fsl_ssi_dai_template: template CPU DAI for the SSI
  */
+static struct snd_soc_dai_ops fsl_ssi_dai_ops = {
+       .startup        = fsl_ssi_startup,
+       .hw_params      = fsl_ssi_hw_params,
+       .shutdown       = fsl_ssi_shutdown,
+       .trigger        = fsl_ssi_trigger,
+       .set_sysclk     = fsl_ssi_set_sysclk,
+       .set_fmt        = fsl_ssi_set_fmt,
+};
+
 static struct snd_soc_dai fsl_ssi_dai_template = {
        .playback = {
                /* The SSI does not support monaural audio. */
@@ -594,14 +603,7 @@ static struct snd_soc_dai fsl_ssi_dai_template = {
                .rates = FSLSSI_I2S_RATES,
                .formats = FSLSSI_I2S_FORMATS,
        },
-       .ops = {
-               .startup = fsl_ssi_startup,
-               .hw_params = fsl_ssi_hw_params,
-               .shutdown = fsl_ssi_shutdown,
-               .trigger = fsl_ssi_trigger,
-               .set_sysclk = fsl_ssi_set_sysclk,
-               .set_fmt = fsl_ssi_set_fmt,
-       },
+       .ops = &fsl_ssi_dai_ops,
 };
 
 /**
index 9eb1ce185bd0cbd11e0e3e8744499ff7085fa624..3aa729df27b58cddea053c96f655d518d73ef694 100644 (file)
@@ -468,6 +468,16 @@ static int psc_i2s_set_fmt(struct snd_soc_dai *cpu_dai, unsigned int format)
 /**
  * psc_i2s_dai_template: template CPU Digital Audio Interface
  */
+static struct snd_soc_dai_ops psc_i2s_dai_ops = {
+       .startup        = psc_i2s_startup,
+       .hw_params      = psc_i2s_hw_params,
+       .hw_free        = psc_i2s_hw_free,
+       .shutdown       = psc_i2s_shutdown,
+       .trigger        = psc_i2s_trigger,
+       .set_sysclk     = psc_i2s_set_sysclk,
+       .set_fmt        = psc_i2s_set_fmt,
+};
+
 static struct snd_soc_dai psc_i2s_dai_template = {
        .playback = {
                .channels_min = 2,
@@ -481,15 +491,7 @@ static struct snd_soc_dai psc_i2s_dai_template = {
                .rates = PSC_I2S_RATES,
                .formats = PSC_I2S_FORMATS,
        },
-       .ops = {
-               .startup = psc_i2s_startup,
-               .hw_params = psc_i2s_hw_params,
-               .hw_free = psc_i2s_hw_free,
-               .shutdown = psc_i2s_shutdown,
-               .trigger = psc_i2s_trigger,
-               .set_sysclk = psc_i2s_set_sysclk,
-               .set_fmt = psc_i2s_set_fmt,
-       },
+       .ops = &psc_i2s_dai_ops,
 };
 
 /* ---------------------------------------------------------------------
index 05dd5abcddf41d425f97d5883911f74f87dae6dc..d6882be33452ae3c6b63140b984d392e0f2e3f61 100644 (file)
@@ -461,6 +461,16 @@ static int omap_mcbsp_dai_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
        return err;
 }
 
+static struct snd_soc_dai_ops omap_mcbsp_dai_ops = {
+       .startup        = omap_mcbsp_dai_startup,
+       .shutdown       = omap_mcbsp_dai_shutdown,
+       .trigger        = omap_mcbsp_dai_trigger,
+       .hw_params      = omap_mcbsp_dai_hw_params,
+       .set_fmt        = omap_mcbsp_dai_set_dai_fmt,
+       .set_clkdiv     = omap_mcbsp_dai_set_clkdiv,
+       .set_sysclk     = omap_mcbsp_dai_set_dai_sysclk,
+};
+
 #define OMAP_MCBSP_DAI_BUILDER(link_id)                                \
 {                                                              \
        .name = "omap-mcbsp-dai-"#link_id,                      \
@@ -477,15 +487,7 @@ static int omap_mcbsp_dai_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
                .rates = OMAP_MCBSP_RATES,                      \
                .formats = SNDRV_PCM_FMTBIT_S16_LE,             \
        },                                                      \
-       .ops = {                                                \
-               .startup = omap_mcbsp_dai_startup,              \
-               .shutdown = omap_mcbsp_dai_shutdown,            \
-               .trigger = omap_mcbsp_dai_trigger,              \
-               .hw_params = omap_mcbsp_dai_hw_params,          \
-               .set_fmt = omap_mcbsp_dai_set_dai_fmt,          \
-               .set_clkdiv = omap_mcbsp_dai_set_clkdiv,        \
-               .set_sysclk = omap_mcbsp_dai_set_dai_sysclk,    \
-       },                                                      \
+       .ops = &omap_mcbsp_dai_ops,                             \
        .private_data = &mcbsp_data[(link_id)].bus_id,          \
 }
 
index 52d97c4b82b19725e9528706eeae02c1c044c004..d3fa6357a9fd9a1eabc29aeef41843dc118501f2 100644 (file)
@@ -794,6 +794,19 @@ static void pxa_ssp_remove(struct platform_device *pdev,
                            SNDRV_PCM_FMTBIT_S24_LE |   \
                            SNDRV_PCM_FMTBIT_S32_LE)
 
+static struct snd_soc_dai_ops pxa_ssp_dai_ops = {
+       .startup        = pxa_ssp_startup,
+       .shutdown       = pxa_ssp_shutdown,
+       .trigger        = pxa_ssp_trigger,
+       .hw_params      = pxa_ssp_hw_params,
+       .set_sysclk     = pxa_ssp_set_dai_sysclk,
+       .set_clkdiv     = pxa_ssp_set_dai_clkdiv,
+       .set_pll        = pxa_ssp_set_dai_pll,
+       .set_fmt        = pxa_ssp_set_dai_fmt,
+       .set_tdm_slot   = pxa_ssp_set_dai_tdm_slot,
+       .set_tristate   = pxa_ssp_set_dai_tristate,
+};
+
 struct snd_soc_dai pxa_ssp_dai[] = {
        {
                .name = "pxa2xx-ssp1",
@@ -814,18 +827,7 @@ struct snd_soc_dai pxa_ssp_dai[] = {
                        .rates = PXA_SSP_RATES,
                        .formats = PXA_SSP_FORMATS,
                 },
-               .ops = {
-                       .startup = pxa_ssp_startup,
-                       .shutdown = pxa_ssp_shutdown,
-                       .trigger = pxa_ssp_trigger,
-                       .hw_params = pxa_ssp_hw_params,
-                       .set_sysclk = pxa_ssp_set_dai_sysclk,
-                       .set_clkdiv = pxa_ssp_set_dai_clkdiv,
-                       .set_pll = pxa_ssp_set_dai_pll,
-                       .set_fmt = pxa_ssp_set_dai_fmt,
-                       .set_tdm_slot = pxa_ssp_set_dai_tdm_slot,
-                       .set_tristate = pxa_ssp_set_dai_tristate,
-               },
+               .ops = &pxa_ssp_dai_ops,
        },
        {       .name = "pxa2xx-ssp2",
                .id = 1,
@@ -845,18 +847,7 @@ struct snd_soc_dai pxa_ssp_dai[] = {
                        .rates = PXA_SSP_RATES,
                        .formats = PXA_SSP_FORMATS,
                 },
-               .ops = {
-                       .startup = pxa_ssp_startup,
-                       .shutdown = pxa_ssp_shutdown,
-                       .trigger = pxa_ssp_trigger,
-                       .hw_params = pxa_ssp_hw_params,
-                       .set_sysclk = pxa_ssp_set_dai_sysclk,
-                       .set_clkdiv = pxa_ssp_set_dai_clkdiv,
-                       .set_pll = pxa_ssp_set_dai_pll,
-                       .set_fmt = pxa_ssp_set_dai_fmt,
-                       .set_tdm_slot = pxa_ssp_set_dai_tdm_slot,
-                       .set_tristate = pxa_ssp_set_dai_tristate,
-               },
+               .ops = &pxa_ssp_dai_ops,
        },
        {
                .name = "pxa2xx-ssp3",
@@ -877,18 +868,7 @@ struct snd_soc_dai pxa_ssp_dai[] = {
                        .rates = PXA_SSP_RATES,
                        .formats = PXA_SSP_FORMATS,
                 },
-               .ops = {
-                       .startup = pxa_ssp_startup,
-                       .shutdown = pxa_ssp_shutdown,
-                       .trigger = pxa_ssp_trigger,
-                       .hw_params = pxa_ssp_hw_params,
-                       .set_sysclk = pxa_ssp_set_dai_sysclk,
-                       .set_clkdiv = pxa_ssp_set_dai_clkdiv,
-                       .set_pll = pxa_ssp_set_dai_pll,
-                       .set_fmt = pxa_ssp_set_dai_fmt,
-                       .set_tdm_slot = pxa_ssp_set_dai_tdm_slot,
-                       .set_tristate = pxa_ssp_set_dai_tristate,
-               },
+               .ops = &pxa_ssp_dai_ops,
        },
        {
                .name = "pxa2xx-ssp4",
@@ -909,18 +889,7 @@ struct snd_soc_dai pxa_ssp_dai[] = {
                        .rates = PXA_SSP_RATES,
                        .formats = PXA_SSP_FORMATS,
                 },
-               .ops = {
-                       .startup = pxa_ssp_startup,
-                       .shutdown = pxa_ssp_shutdown,
-                       .trigger = pxa_ssp_trigger,
-                       .hw_params = pxa_ssp_hw_params,
-                       .set_sysclk = pxa_ssp_set_dai_sysclk,
-                       .set_clkdiv = pxa_ssp_set_dai_clkdiv,
-                       .set_pll = pxa_ssp_set_dai_pll,
-                       .set_fmt = pxa_ssp_set_dai_fmt,
-                       .set_tdm_slot = pxa_ssp_set_dai_tdm_slot,
-                       .set_tristate = pxa_ssp_set_dai_tristate,
-               },
+               .ops = &pxa_ssp_dai_ops,
        },
 };
 EXPORT_SYMBOL_GPL(pxa_ssp_dai);
index 49a2810ca58c70f4174d9da5eee246c498c99908..cf809049272afff65ac85d096f680c5beff47352 100644 (file)
@@ -164,6 +164,10 @@ static int pxa2xx_ac97_hw_mic_params(struct snd_pcm_substream *substream,
                SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | \
                SNDRV_PCM_RATE_48000)
 
+static struct snd_soc_dai_ops pxa_ac97_dai_ops = {
+       .hw_params      = pxa2xx_ac97_hw_params,
+};
+
 /*
  * There is only 1 physical AC97 interface for pxa2xx, but it
  * has extra fifo's that can be used for aux DACs and ADCs.
@@ -189,8 +193,7 @@ struct snd_soc_dai pxa_ac97_dai[] = {
                .channels_max = 2,
                .rates = PXA2XX_AC97_RATES,
                .formats = SNDRV_PCM_FMTBIT_S16_LE,},
-       .ops = {
-               .hw_params = pxa2xx_ac97_hw_params,},
+       .ops = &pxa_ac97_dai_ops,
 },
 {
        .name = "pxa2xx-ac97-aux",
@@ -208,8 +211,7 @@ struct snd_soc_dai pxa_ac97_dai[] = {
                .channels_max = 1,
                .rates = PXA2XX_AC97_RATES,
                .formats = SNDRV_PCM_FMTBIT_S16_LE,},
-       .ops = {
-               .hw_params = pxa2xx_ac97_hw_aux_params,},
+       .ops = &pxa_ac97_dai_ops,
 },
 {
        .name = "pxa2xx-ac97-mic",
@@ -221,8 +223,7 @@ struct snd_soc_dai pxa_ac97_dai[] = {
                .channels_max = 1,
                .rates = PXA2XX_AC97_RATES,
                .formats = SNDRV_PCM_FMTBIT_S16_LE,},
-       .ops = {
-               .hw_params = pxa2xx_ac97_hw_mic_params,},
+       .ops = &pxa_ac97_dai_ops,
 },
 };
 
index 83b59d7fe96e1de46826c23d26952d682bc804ce..e6c24408c5f9fb23714b22173e2b1fad8a8877d8 100644 (file)
@@ -304,6 +304,15 @@ static int pxa2xx_i2s_resume(struct snd_soc_dai *dai)
                SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | \
                SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000)
 
+static struct snd_soc_dai_ops pxa_i2s_dai_ops = {
+       .startup        = pxa2xx_i2s_startup,
+       .shutdown       = pxa2xx_i2s_shutdown,
+       .trigger        = pxa2xx_i2s_trigger,
+       .hw_params      = pxa2xx_i2s_hw_params,
+       .set_fmt        = pxa2xx_i2s_set_dai_fmt,
+       .set_sysclk     = pxa2xx_i2s_set_dai_sysclk,
+};
+
 struct snd_soc_dai pxa_i2s_dai = {
        .name = "pxa2xx-i2s",
        .id = 0,
@@ -319,14 +328,7 @@ struct snd_soc_dai pxa_i2s_dai = {
                .channels_max = 2,
                .rates = PXA2XX_I2S_RATES,
                .formats = SNDRV_PCM_FMTBIT_S16_LE,},
-       .ops = {
-               .startup = pxa2xx_i2s_startup,
-               .shutdown = pxa2xx_i2s_shutdown,
-               .trigger = pxa2xx_i2s_trigger,
-               .hw_params = pxa2xx_i2s_hw_params,
-               .set_fmt = pxa2xx_i2s_set_dai_fmt,
-               .set_sysclk = pxa2xx_i2s_set_dai_sysclk,
-       },
+       .ops = &pxa_i2s_dai_ops,
 };
 
 EXPORT_SYMBOL_GPL(pxa_i2s_dai);
index 1ceae690d019c80ab6140c87ac40d982907855dc..1ca3cdaa82133b009b57b2fd571bc9069524eb80 100644 (file)
@@ -147,6 +147,10 @@ static int s3c2412_i2s_probe(struct platform_device *pdev,
        SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \
        SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000)
 
+static struct snd_soc_dai_ops s3c2412_i2s_dai_ops = {
+       .set_sysclk     = s3c2412_i2s_set_sysclk,
+};
+
 struct snd_soc_dai s3c2412_i2s_dai = {
        .name           = "s3c2412-i2s",
        .id             = 0,
@@ -163,9 +167,7 @@ struct snd_soc_dai s3c2412_i2s_dai = {
                .rates          = S3C2412_I2S_RATES,
                .formats        = SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE,
        },
-       .ops = {
-               .set_sysclk     = s3c2412_i2s_set_sysclk,
-       },
+       .ops = &s3c2412_i2s_dai_ops,
 };
 EXPORT_SYMBOL_GPL(s3c2412_i2s_dai);
 
index 5c7f18a226456f0aaf39bca4ca7b439093410ee1..3698f707c44d0e53fdbc916d717211bf97a279ca 100644 (file)
@@ -355,6 +355,16 @@ static int s3c2443_ac97_mic_trigger(struct snd_pcm_substream *substream,
                SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | \
                SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000)
 
+static struct snd_soc_dai_ops s3c2443_ac97_dai_ops = {
+       .hw_params      = s3c2443_ac97_hw_params,
+       .trigger        = s3c2443_ac97_trigger,
+};
+
+static struct snd_soc_dai_ops s3c2443_ac97_mic_dai_ops = {
+       .hw_params      = s3c2443_ac97_hw_mic_params,
+       .trigger        = s3c2443_ac97_mic_trigger,
+};
+
 struct snd_soc_dai s3c2443_ac97_dai[] = {
 {
        .name = "s3c2443-ac97",
@@ -374,9 +384,7 @@ struct snd_soc_dai s3c2443_ac97_dai[] = {
                .channels_max = 2,
                .rates = s3c2443_AC97_RATES,
                .formats = SNDRV_PCM_FMTBIT_S16_LE,},
-       .ops = {
-               .hw_params = s3c2443_ac97_hw_params,
-               .trigger = s3c2443_ac97_trigger},
+       .ops = &s3c2443_ac97_dai_ops,
 },
 {
        .name = "pxa2xx-ac97-mic",
@@ -388,9 +396,7 @@ struct snd_soc_dai s3c2443_ac97_dai[] = {
                .channels_max = 1,
                .rates = s3c2443_AC97_RATES,
                .formats = SNDRV_PCM_FMTBIT_S16_LE,},
-       .ops = {
-               .hw_params = s3c2443_ac97_hw_mic_params,
-               .trigger = s3c2443_ac97_mic_trigger,},
+       .ops = &s3c2443_ac97_mic_dai_ops,
 },
 };
 EXPORT_SYMBOL_GPL(s3c2443_ac97_dai);
index 407ccd7180fe6f5e3a4a2f2b94dd351ed62c233c..cc066964dad6fe34eb7709115474c522ac0d80ba 100644 (file)
@@ -449,6 +449,14 @@ static int s3c24xx_i2s_resume(struct snd_soc_dai *cpu_dai)
        SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \
        SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000)
 
+static struct snd_soc_dai_ops s3c24xx_i2s_dai_ops = {
+       .trigger        = s3c24xx_i2s_trigger,
+       .hw_params      = s3c24xx_i2s_hw_params,
+       .set_fmt        = s3c24xx_i2s_set_fmt,
+       .set_clkdiv     = s3c24xx_i2s_set_clkdiv,
+       .set_sysclk     = s3c24xx_i2s_set_sysclk,
+};
+
 struct snd_soc_dai s3c24xx_i2s_dai = {
        .name = "s3c24xx-i2s",
        .id = 0,
@@ -465,13 +473,7 @@ struct snd_soc_dai s3c24xx_i2s_dai = {
                .channels_max = 2,
                .rates = S3C24XX_I2S_RATES,
                .formats = SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE,},
-       .ops = {
-               .trigger = s3c24xx_i2s_trigger,
-               .hw_params = s3c24xx_i2s_hw_params,
-               .set_fmt = s3c24xx_i2s_set_fmt,
-               .set_clkdiv = s3c24xx_i2s_set_clkdiv,
-               .set_sysclk = s3c24xx_i2s_set_sysclk,
-       },
+       .ops = &s3c24xx_i2s_dai_ops,
 };
 EXPORT_SYMBOL_GPL(s3c24xx_i2s_dai);
 
index d1e5390fddeb7ff82c999aac717ca281e966864e..56fa0872abbbb54a2bfd8cfcbb6a579cbd1bc8be 100644 (file)
@@ -336,6 +336,16 @@ static int ssi_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
         SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_U24_3LE |  \
         SNDRV_PCM_FMTBIT_S32_LE  | SNDRV_PCM_FMTBIT_U32_LE)
 
+static struct snd_soc_dai_ops ssi_dai_ops = {
+       .startup        = ssi_startup,
+       .shutdown       = ssi_shutdown,
+       .trigger        = ssi_trigger,
+       .hw_params      = ssi_hw_params,
+       .set_sysclk     = ssi_set_sysclk,
+       .set_clkdiv     = ssi_set_clkdiv,
+       .set_fmt        = ssi_set_fmt,
+};
+
 struct snd_soc_dai sh4_ssi_dai[] = {
 {
        .name                   = "SSI0",
@@ -352,15 +362,7 @@ struct snd_soc_dai sh4_ssi_dai[] = {
                .channels_min   = 2,
                .channels_max   = 8,
        },
-       .ops = {
-               .startup        = ssi_startup,
-               .shutdown       = ssi_shutdown,
-               .trigger        = ssi_trigger,
-               .hw_params      = ssi_hw_params,
-               .set_sysclk     = ssi_set_sysclk,
-               .set_clkdiv     = ssi_set_clkdiv,
-               .set_fmt        = ssi_set_fmt,
-       },
+       .ops = &ssi_dai_ops,
 },
 #ifdef CONFIG_CPU_SUBTYPE_SH7760
 {
@@ -378,15 +380,7 @@ struct snd_soc_dai sh4_ssi_dai[] = {
                .channels_min   = 2,
                .channels_max   = 8,
        },
-       .ops = {
-               .startup        = ssi_startup,
-               .shutdown       = ssi_shutdown,
-               .trigger        = ssi_trigger,
-               .hw_params      = ssi_hw_params,
-               .set_sysclk     = ssi_set_sysclk,
-               .set_clkdiv     = ssi_set_clkdiv,
-               .set_fmt        = ssi_set_fmt,
-       },
+       .ops = &ssi_dai_ops,
 },
 #endif
 };
index d4b90d82a098cdf98d939f1b409d7b1b2ace087c..16518329f6b2f344dc7d3d03c072749d28cbd8ce 100644 (file)
@@ -133,8 +133,8 @@ static int soc_pcm_open(struct snd_pcm_substream *substream)
        mutex_lock(&pcm_mutex);
 
        /* startup the audio subsystem */
-       if (cpu_dai->ops.startup) {
-               ret = cpu_dai->ops.startup(substream, cpu_dai);
+       if (cpu_dai->ops->startup) {
+               ret = cpu_dai->ops->startup(substream, cpu_dai);
                if (ret < 0) {
                        printk(KERN_ERR "asoc: can't open interface %s\n",
                                cpu_dai->name);
@@ -150,8 +150,8 @@ static int soc_pcm_open(struct snd_pcm_substream *substream)
                }
        }
 
-       if (codec_dai->ops.startup) {
-               ret = codec_dai->ops.startup(substream, codec_dai);
+       if (codec_dai->ops->startup) {
+               ret = codec_dai->ops->startup(substream, codec_dai);
                if (ret < 0) {
                        printk(KERN_ERR "asoc: can't open codec %s\n",
                                codec_dai->name);
@@ -247,8 +247,8 @@ codec_dai_err:
                platform->pcm_ops->close(substream);
 
 platform_err:
-       if (cpu_dai->ops.shutdown)
-               cpu_dai->ops.shutdown(substream, cpu_dai);
+       if (cpu_dai->ops->shutdown)
+               cpu_dai->ops->shutdown(substream, cpu_dai);
 out:
        mutex_unlock(&pcm_mutex);
        return ret;
@@ -340,11 +340,11 @@ static int soc_codec_close(struct snd_pcm_substream *substream)
        if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
                snd_soc_dai_digital_mute(codec_dai, 1);
 
-       if (cpu_dai->ops.shutdown)
-               cpu_dai->ops.shutdown(substream, cpu_dai);
+       if (cpu_dai->ops->shutdown)
+               cpu_dai->ops->shutdown(substream, cpu_dai);
 
-       if (codec_dai->ops.shutdown)
-               codec_dai->ops.shutdown(substream, codec_dai);
+       if (codec_dai->ops->shutdown)
+               codec_dai->ops->shutdown(substream, codec_dai);
 
        if (machine->ops && machine->ops->shutdown)
                machine->ops->shutdown(substream);
@@ -408,16 +408,16 @@ static int soc_pcm_prepare(struct snd_pcm_substream *substream)
                }
        }
 
-       if (codec_dai->ops.prepare) {
-               ret = codec_dai->ops.prepare(substream, codec_dai);
+       if (codec_dai->ops->prepare) {
+               ret = codec_dai->ops->prepare(substream, codec_dai);
                if (ret < 0) {
                        printk(KERN_ERR "asoc: codec DAI prepare error\n");
                        goto out;
                }
        }
 
-       if (cpu_dai->ops.prepare) {
-               ret = cpu_dai->ops.prepare(substream, cpu_dai);
+       if (cpu_dai->ops->prepare) {
+               ret = cpu_dai->ops->prepare(substream, cpu_dai);
                if (ret < 0) {
                        printk(KERN_ERR "asoc: cpu DAI prepare error\n");
                        goto out;
@@ -494,8 +494,8 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream,
                }
        }
 
-       if (codec_dai->ops.hw_params) {
-               ret = codec_dai->ops.hw_params(substream, params, codec_dai);
+       if (codec_dai->ops->hw_params) {
+               ret = codec_dai->ops->hw_params(substream, params, codec_dai);
                if (ret < 0) {
                        printk(KERN_ERR "asoc: can't set codec %s hw params\n",
                                codec_dai->name);
@@ -503,8 +503,8 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream,
                }
        }
 
-       if (cpu_dai->ops.hw_params) {
-               ret = cpu_dai->ops.hw_params(substream, params, cpu_dai);
+       if (cpu_dai->ops->hw_params) {
+               ret = cpu_dai->ops->hw_params(substream, params, cpu_dai);
                if (ret < 0) {
                        printk(KERN_ERR "asoc: interface %s hw params failed\n",
                                cpu_dai->name);
@@ -526,12 +526,12 @@ out:
        return ret;
 
 platform_err:
-       if (cpu_dai->ops.hw_free)
-               cpu_dai->ops.hw_free(substream, cpu_dai);
+       if (cpu_dai->ops->hw_free)
+               cpu_dai->ops->hw_free(substream, cpu_dai);
 
 interface_err:
-       if (codec_dai->ops.hw_free)
-               codec_dai->ops.hw_free(substream, codec_dai);
+       if (codec_dai->ops->hw_free)
+               codec_dai->ops->hw_free(substream, codec_dai);
 
 codec_err:
        if (machine->ops && machine->ops->hw_free)
@@ -570,11 +570,11 @@ static int soc_pcm_hw_free(struct snd_pcm_substream *substream)
                platform->pcm_ops->hw_free(substream);
 
        /* now free hw params for the DAI's  */
-       if (codec_dai->ops.hw_free)
-               codec_dai->ops.hw_free(substream, codec_dai);
+       if (codec_dai->ops->hw_free)
+               codec_dai->ops->hw_free(substream, codec_dai);
 
-       if (cpu_dai->ops.hw_free)
-               cpu_dai->ops.hw_free(substream, cpu_dai);
+       if (cpu_dai->ops->hw_free)
+               cpu_dai->ops->hw_free(substream, cpu_dai);
 
        mutex_unlock(&pcm_mutex);
        return 0;
@@ -591,8 +591,8 @@ static int soc_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
        struct snd_soc_dai *codec_dai = machine->codec_dai;
        int ret;
 
-       if (codec_dai->ops.trigger) {
-               ret = codec_dai->ops.trigger(substream, cmd, codec_dai);
+       if (codec_dai->ops->trigger) {
+               ret = codec_dai->ops->trigger(substream, cmd, codec_dai);
                if (ret < 0)
                        return ret;
        }
@@ -603,8 +603,8 @@ static int soc_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
                        return ret;
        }
 
-       if (cpu_dai->ops.trigger) {
-               ret = cpu_dai->ops.trigger(substream, cmd, cpu_dai);
+       if (cpu_dai->ops->trigger) {
+               ret = cpu_dai->ops->trigger(substream, cmd, cpu_dai);
                if (ret < 0)
                        return ret;
        }
@@ -645,8 +645,8 @@ static int soc_suspend(struct platform_device *pdev, pm_message_t state)
        /* mute any active DAC's */
        for (i = 0; i < card->num_links; i++) {
                struct snd_soc_dai *dai = card->dai_link[i].codec_dai;
-               if (dai->ops.digital_mute && dai->playback.active)
-                       dai->ops.digital_mute(dai, 1);
+               if (dai->ops->digital_mute && dai->playback.active)
+                       dai->ops->digital_mute(dai, 1);
        }
 
        /* suspend all pcms */
@@ -741,8 +741,8 @@ static void soc_resume_deferred(struct work_struct *work)
        /* unmute any active DACs */
        for (i = 0; i < card->num_links; i++) {
                struct snd_soc_dai *dai = card->dai_link[i].codec_dai;
-               if (dai->ops.digital_mute && dai->playback.active)
-                       dai->ops.digital_mute(dai, 0);
+               if (dai->ops->digital_mute && dai->playback.active)
+                       dai->ops->digital_mute(dai, 0);
        }
 
        for (i = 0; i < card->num_links; i++) {
@@ -2051,8 +2051,8 @@ EXPORT_SYMBOL_GPL(snd_soc_put_volsw_s8);
 int snd_soc_dai_set_sysclk(struct snd_soc_dai *dai, int clk_id,
        unsigned int freq, int dir)
 {
-       if (dai->ops.set_sysclk)
-               return dai->ops.set_sysclk(dai, clk_id, freq, dir);
+       if (dai->ops->set_sysclk)
+               return dai->ops->set_sysclk(dai, clk_id, freq, dir);
        else
                return -EINVAL;
 }
@@ -2071,8 +2071,8 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_set_sysclk);
 int snd_soc_dai_set_clkdiv(struct snd_soc_dai *dai,
        int div_id, int div)
 {
-       if (dai->ops.set_clkdiv)
-               return dai->ops.set_clkdiv(dai, div_id, div);
+       if (dai->ops->set_clkdiv)
+               return dai->ops->set_clkdiv(dai, div_id, div);
        else
                return -EINVAL;
 }
@@ -2090,8 +2090,8 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_set_clkdiv);
 int snd_soc_dai_set_pll(struct snd_soc_dai *dai,
        int pll_id, unsigned int freq_in, unsigned int freq_out)
 {
-       if (dai->ops.set_pll)
-               return dai->ops.set_pll(dai, pll_id, freq_in, freq_out);
+       if (dai->ops->set_pll)
+               return dai->ops->set_pll(dai, pll_id, freq_in, freq_out);
        else
                return -EINVAL;
 }
@@ -2106,8 +2106,8 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_set_pll);
  */
 int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
 {
-       if (dai->ops.set_fmt)
-               return dai->ops.set_fmt(dai, fmt);
+       if (dai->ops->set_fmt)
+               return dai->ops->set_fmt(dai, fmt);
        else
                return -EINVAL;
 }
@@ -2125,8 +2125,8 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_set_fmt);
 int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai,
        unsigned int mask, int slots)
 {
-       if (dai->ops.set_sysclk)
-               return dai->ops.set_tdm_slot(dai, mask, slots);
+       if (dai->ops->set_sysclk)
+               return dai->ops->set_tdm_slot(dai, mask, slots);
        else
                return -EINVAL;
 }
@@ -2141,8 +2141,8 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_set_tdm_slot);
  */
 int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate)
 {
-       if (dai->ops.set_sysclk)
-               return dai->ops.set_tristate(dai, tristate);
+       if (dai->ops->set_sysclk)
+               return dai->ops->set_tristate(dai, tristate);
        else
                return -EINVAL;
 }
@@ -2157,8 +2157,8 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_set_tristate);
  */
 int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute)
 {
-       if (dai->ops.digital_mute)
-               return dai->ops.digital_mute(dai, mute);
+       if (dai->ops->digital_mute)
+               return dai->ops->digital_mute(dai, mute);
        else
                return -EINVAL;
 }
@@ -2211,6 +2211,9 @@ static int snd_soc_unregister_card(struct snd_soc_card *card)
        return 0;
 }
 
+static struct snd_soc_dai_ops null_dai_ops = {
+};
+
 /**
  * snd_soc_register_dai - Register a DAI with the ASoC core
  *
@@ -2225,6 +2228,9 @@ int snd_soc_register_dai(struct snd_soc_dai *dai)
        if (!dai->dev)
                printk(KERN_WARNING "No device for DAI %s\n", dai->name);
 
+       if (!dai->ops)
+               dai->ops = &null_dai_ops;
+
        INIT_LIST_HEAD(&dai->list);
 
        mutex_lock(&client_mutex);