ASoC: Set idle_bias_off flag in snd_soc_codec_driver
[deliverable/linux.git] / sound / soc / codecs / twl4030.c
index f798247ac1b2071e7316200be605734ed87faf6d..3039ba209d1d7e5848e44a66788151920f96a361 100644 (file)
@@ -1689,7 +1689,6 @@ static int twl4030_startup(struct snd_pcm_substream *substream,
        struct snd_soc_codec *codec = rtd->codec;
        struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
 
-       snd_pcm_hw_constraint_msbits(substream->runtime, 0, 32, 24);
        if (twl4030->master_substream) {
                twl4030->slave_substream = substream;
                /* The DAI has one configuration for playback and capture, so
@@ -2149,7 +2148,7 @@ static int twl4030_voice_set_tristate(struct snd_soc_dai *dai, int tristate)
 #define TWL4030_RATES   (SNDRV_PCM_RATE_8000_48000)
 #define TWL4030_FORMATS         (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE)
 
-static struct snd_soc_dai_ops twl4030_dai_hifi_ops = {
+static const struct snd_soc_dai_ops twl4030_dai_hifi_ops = {
        .startup        = twl4030_startup,
        .shutdown       = twl4030_shutdown,
        .hw_params      = twl4030_hw_params,
@@ -2158,7 +2157,7 @@ static struct snd_soc_dai_ops twl4030_dai_hifi_ops = {
        .set_tristate   = twl4030_set_tristate,
 };
 
-static struct snd_soc_dai_ops twl4030_dai_voice_ops = {
+static const struct snd_soc_dai_ops twl4030_dai_voice_ops = {
        .startup        = twl4030_voice_startup,
        .shutdown       = twl4030_voice_shutdown,
        .hw_params      = twl4030_voice_hw_params,
@@ -2175,13 +2174,15 @@ static struct snd_soc_dai_driver twl4030_dai[] = {
                .channels_min = 2,
                .channels_max = 4,
                .rates = TWL4030_RATES | SNDRV_PCM_RATE_96000,
-               .formats = TWL4030_FORMATS,},
+               .formats = TWL4030_FORMATS,
+               .sig_bits = 24,},
        .capture = {
                .stream_name = "Capture",
                .channels_min = 2,
                .channels_max = 4,
                .rates = TWL4030_RATES,
-               .formats = TWL4030_FORMATS,},
+               .formats = TWL4030_FORMATS,
+               .sig_bits = 24,},
        .ops = &twl4030_dai_hifi_ops,
 },
 {
@@ -2202,7 +2203,7 @@ static struct snd_soc_dai_driver twl4030_dai[] = {
 },
 };
 
-static int twl4030_soc_suspend(struct snd_soc_codec *codec, pm_message_t state)
+static int twl4030_soc_suspend(struct snd_soc_codec *codec)
 {
        twl4030_set_bias_level(codec, SND_SOC_BIAS_OFF);
        return 0;
@@ -2226,7 +2227,6 @@ static int twl4030_soc_probe(struct snd_soc_codec *codec)
        snd_soc_codec_set_drvdata(codec, twl4030);
        /* Set the defaults, and power up the codec */
        twl4030->sysclk = twl4030_audio_get_mclk() / 1000;
-       codec->dapm.idle_bias_off = 1;
 
        twl4030_init_chip(codec);
 
@@ -2252,6 +2252,7 @@ static struct snd_soc_codec_driver soc_codec_dev_twl4030 = {
        .read = twl4030_read_reg_cache,
        .write = twl4030_write,
        .set_bias_level = twl4030_set_bias_level,
+       .idle_bias_off = true,
        .reg_cache_size = sizeof(twl4030_reg),
        .reg_word_size = sizeof(u8),
        .reg_cache_default = twl4030_reg,
@@ -2294,17 +2295,7 @@ static struct platform_driver twl4030_codec_driver = {
        },
 };
 
-static int __init twl4030_modinit(void)
-{
-       return platform_driver_register(&twl4030_codec_driver);
-}
-module_init(twl4030_modinit);
-
-static void __exit twl4030_exit(void)
-{
-       platform_driver_unregister(&twl4030_codec_driver);
-}
-module_exit(twl4030_exit);
+module_platform_driver(twl4030_codec_driver);
 
 MODULE_DESCRIPTION("ASoC TWL4030 codec driver");
 MODULE_AUTHOR("Steve Sakoman");
This page took 0.03385 seconds and 5 git commands to generate.