ASoC: Drop unused state parameter from CODEC suspend callback
[deliverable/linux.git] / sound / soc / codecs / wm8753.c
index aa091a0d81873b9f09ceeb30bf7dcd46f6d05cd1..b114c19f530ab89c30ea9daa24cc2a0eef143f85 100644 (file)
@@ -38,7 +38,7 @@
 #include <linux/delay.h>
 #include <linux/pm.h>
 #include <linux/i2c.h>
-#include <linux/platform_device.h>
+#include <linux/of_device.h>
 #include <linux/spi/spi.h>
 #include <linux/slab.h>
 #include <sound/core.h>
@@ -189,6 +189,9 @@ static int wm8753_set_dai(struct snd_kcontrol *kcontrol,
        struct wm8753_priv *wm8753 = snd_soc_codec_get_drvdata(codec);
        u16 ioctl;
 
+       if (wm8753->dai_func == ucontrol->value.integer.value[0])
+               return 0;
+
        if (codec->active)
                return -EBUSY;
 
@@ -482,7 +485,7 @@ SND_SOC_DAPM_INPUT("MIC2"),
 SND_SOC_DAPM_VMID("VREF"),
 };
 
-static const struct snd_soc_dapm_route audio_map[] = {
+static const struct snd_soc_dapm_route wm8753_dapm_routes[] = {
        /* left mixer */
        {"Left Mixer", "Left Playback Switch", "Left DAC"},
        {"Left Mixer", "Voice Playback Switch", "Voice DAC"},
@@ -636,17 +639,6 @@ static const struct snd_soc_dapm_route audio_map[] = {
        {"ACOP", NULL, "ALC Mixer"},
 };
 
-static int wm8753_add_widgets(struct snd_soc_codec *codec)
-{
-       struct snd_soc_dapm_context *dapm = &codec->dapm;
-
-       snd_soc_dapm_new_controls(dapm, wm8753_dapm_widgets,
-                                 ARRAY_SIZE(wm8753_dapm_widgets));
-       snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
-
-       return 0;
-}
-
 /* PLL divisors */
 struct _pll_div {
        u32 div2:1;
@@ -1322,7 +1314,7 @@ 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_mode = {
+static const struct snd_soc_dai_ops wm8753_dai_ops_hifi_mode = {
        .hw_params      = wm8753_i2s_hw_params,
        .digital_mute   = wm8753_mute,
        .set_fmt        = wm8753_hifi_set_dai_fmt,
@@ -1331,7 +1323,7 @@ static struct snd_soc_dai_ops wm8753_dai_ops_hifi_mode = {
        .set_sysclk     = wm8753_set_dai_sysclk,
 };
 
-static struct snd_soc_dai_ops wm8753_dai_ops_voice_mode = {
+static const struct snd_soc_dai_ops wm8753_dai_ops_voice_mode = {
        .hw_params      = wm8753_pcm_hw_params,
        .digital_mute   = wm8753_mute,
        .set_fmt        = wm8753_voice_set_dai_fmt,
@@ -1388,7 +1380,7 @@ static void wm8753_work(struct work_struct *work)
        wm8753_set_bias_level(codec, dapm->bias_level);
 }
 
-static int wm8753_suspend(struct snd_soc_codec *codec, pm_message_t state)
+static int wm8753_suspend(struct snd_soc_codec *codec)
 {
        wm8753_set_bias_level(codec, SND_SOC_BIAS_OFF);
        return 0;
@@ -1463,10 +1455,6 @@ static int wm8753_probe(struct snd_soc_codec *codec)
        snd_soc_update_bits(codec, WM8753_LINVOL, 0x0100, 0x0100);
        snd_soc_update_bits(codec, WM8753_RINVOL, 0x0100, 0x0100);
 
-       snd_soc_add_controls(codec, wm8753_snd_controls,
-                            ARRAY_SIZE(wm8753_snd_controls));
-       wm8753_add_widgets(codec);
-
        return 0;
 }
 
@@ -1488,7 +1476,20 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8753 = {
        .reg_cache_size = ARRAY_SIZE(wm8753_reg),
        .reg_word_size = sizeof(u16),
        .reg_cache_default = wm8753_reg,
+
+       .controls = wm8753_snd_controls,
+       .num_controls = ARRAY_SIZE(wm8753_snd_controls),
+       .dapm_widgets = wm8753_dapm_widgets,
+       .num_dapm_widgets = ARRAY_SIZE(wm8753_dapm_widgets),
+       .dapm_routes = wm8753_dapm_routes,
+       .num_dapm_routes = ARRAY_SIZE(wm8753_dapm_routes),
+};
+
+static const struct of_device_id wm8753_of_match[] = {
+       { .compatible = "wlf,wm8753", },
+       { }
 };
+MODULE_DEVICE_TABLE(of, wm8753_of_match);
 
 #if defined(CONFIG_SPI_MASTER)
 static int __devinit wm8753_spi_probe(struct spi_device *spi)
@@ -1519,8 +1520,9 @@ static int __devexit wm8753_spi_remove(struct spi_device *spi)
 
 static struct spi_driver wm8753_spi_driver = {
        .driver = {
-               .name   = "wm8753-codec",
+               .name   = "wm8753",
                .owner  = THIS_MODULE,
+               .of_match_table = wm8753_of_match,
        },
        .probe          = wm8753_spi_probe,
        .remove         = __devexit_p(wm8753_spi_remove),
@@ -1563,8 +1565,9 @@ MODULE_DEVICE_TABLE(i2c, wm8753_i2c_id);
 
 static struct i2c_driver wm8753_i2c_driver = {
        .driver = {
-               .name = "wm8753-codec",
+               .name = "wm8753",
                .owner = THIS_MODULE,
+               .of_match_table = wm8753_of_match,
        },
        .probe =    wm8753_i2c_probe,
        .remove =   __devexit_p(wm8753_i2c_remove),
This page took 0.028986 seconds and 5 git commands to generate.