]> Pileus Git - ~andy/linux/blobdiff - sound/soc/samsung/speyside.c
Merge branch 'next/timer' of git://git.linaro.org/people/arnd/arm-soc
[~andy/linux] / sound / soc / samsung / speyside.c
index d6dee4d02036c0f605a8478e3db2231acea5edb6..b9e213f6cc0630f179d9b811d6b382dac6c64777 100644 (file)
 #include <sound/jack.h>
 #include <linux/gpio.h>
 
-#include "../codecs/wm8915.h"
+#include "../codecs/wm8996.h"
 #include "../codecs/wm9081.h"
 
-#define WM8915_HPSEL_GPIO 214
+#define WM8996_HPSEL_GPIO 214
 
 static int speyside_set_bias_level(struct snd_soc_card *card,
                                   struct snd_soc_dapm_context *dapm,
@@ -31,12 +31,12 @@ static int speyside_set_bias_level(struct snd_soc_card *card,
 
        switch (level) {
        case SND_SOC_BIAS_STANDBY:
-               ret = snd_soc_dai_set_sysclk(codec_dai, WM8915_SYSCLK_MCLK2,
+               ret = snd_soc_dai_set_sysclk(codec_dai, WM8996_SYSCLK_MCLK2,
                                             32768, SND_SOC_CLOCK_IN);
                if (ret < 0)
                        return ret;
 
-               ret = snd_soc_dai_set_pll(codec_dai, WM8915_FLL_MCLK2,
+               ret = snd_soc_dai_set_pll(codec_dai, WM8996_FLL_MCLK2,
                                          0, 0, 0);
                if (ret < 0) {
                        pr_err("Failed to stop FLL\n");
@@ -65,7 +65,7 @@ static int speyside_set_bias_level_post(struct snd_soc_card *card,
        case SND_SOC_BIAS_PREPARE:
                if (card->dapm.bias_level == SND_SOC_BIAS_STANDBY) {
                        ret = snd_soc_dai_set_pll(codec_dai, 0,
-                                                 WM8915_FLL_MCLK2,
+                                                 WM8996_FLL_MCLK2,
                                                  32768, 48000 * 256);
                        if (ret < 0) {
                                pr_err("Failed to start FLL\n");
@@ -73,7 +73,7 @@ static int speyside_set_bias_level_post(struct snd_soc_card *card,
                        }
 
                        ret = snd_soc_dai_set_sysclk(codec_dai,
-                                                    WM8915_SYSCLK_FLL,
+                                                    WM8996_SYSCLK_FLL,
                                                     48000 * 256,
                                                     SND_SOC_CLOCK_IN);
                        if (ret < 0)
@@ -125,10 +125,6 @@ static struct snd_soc_jack_pin speyside_headset_pins[] = {
                .pin = "Headset Mic",
                .mask = SND_JACK_MICROPHONE,
        },
-       {
-               .pin = "Headphone",
-               .mask = SND_JACK_HEADPHONE,
-       },
 };
 
 /* Default the headphone selection to active high */
@@ -149,29 +145,30 @@ static void speyside_set_polarity(struct snd_soc_codec *codec,
                                  int polarity)
 {
        speyside_jack_polarity = !polarity;
-       gpio_direction_output(WM8915_HPSEL_GPIO, speyside_jack_polarity);
+       gpio_direction_output(WM8996_HPSEL_GPIO, speyside_jack_polarity);
 
        /* Re-run DAPM to make sure we're using the correct mic bias */
        snd_soc_dapm_sync(&codec->dapm);
 }
 
-static int speyside_wm8915_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_codec *codec = rtd->codec;
        int ret;
 
-       ret = snd_soc_dai_set_sysclk(dai, WM8915_SYSCLK_MCLK2, 32768, 0);
+       ret = snd_soc_dai_set_sysclk(dai, WM8996_SYSCLK_MCLK2, 32768, 0);
        if (ret < 0)
                return ret;
 
-       ret = gpio_request(WM8915_HPSEL_GPIO, "HP_SEL");
+       ret = gpio_request(WM8996_HPSEL_GPIO, "HP_SEL");
        if (ret != 0)
                pr_err("Failed to request HP_SEL GPIO: %d\n", ret);
-       gpio_direction_output(WM8915_HPSEL_GPIO, speyside_jack_polarity);
+       gpio_direction_output(WM8996_HPSEL_GPIO, speyside_jack_polarity);
 
        ret = snd_soc_jack_new(codec, "Headset",
-                              SND_JACK_HEADSET | SND_JACK_BTN_0,
+                              SND_JACK_LINEOUT | SND_JACK_HEADSET |
+                              SND_JACK_BTN_0,
                               &speyside_headset);
        if (ret)
                return ret;
@@ -182,7 +179,7 @@ static int speyside_wm8915_init(struct snd_soc_pcm_runtime *rtd)
        if (ret)
                return ret;
 
-       wm8915_detect(codec, &speyside_headset, speyside_set_polarity);
+       wm8996_detect(codec, &speyside_headset, speyside_set_polarity);
 
        return 0;
 }
@@ -205,16 +202,16 @@ static struct snd_soc_dai_link speyside_dai[] = {
                .name = "CPU",
                .stream_name = "CPU",
                .cpu_dai_name = "samsung-i2s.0",
-               .codec_dai_name = "wm8915-aif1",
+               .codec_dai_name = "wm8996-aif1",
                .platform_name = "samsung-audio",
-               .codec_name = "wm8915.1-001a",
-               .init = speyside_wm8915_init,
+               .codec_name = "wm8996.1-001a",
+               .init = speyside_wm8996_init,
                .ops = &speyside_ops,
        },
        {
                .name = "Baseband",
                .stream_name = "Baseband",
-               .cpu_dai_name = "wm8915-aif2",
+               .cpu_dai_name = "wm8996-aif2",
                .codec_dai_name = "wm1250-ev1",
                .codec_name = "wm1250-ev1.1-0027",
                .ops = &speyside_ops,
@@ -227,7 +224,7 @@ static int speyside_wm9081_init(struct snd_soc_dapm_context *dapm)
        snd_soc_dapm_nc_pin(dapm, "LINEOUT");
 
        /* At any time the WM9081 is active it will have this clock */
-       return snd_soc_codec_set_sysclk(dapm->codec, WM9081_SYSCLK_MCLK,
+       return snd_soc_codec_set_sysclk(dapm->codec, WM9081_SYSCLK_MCLK, 0,
                                        48000 * 256, 0);
 }
 
@@ -252,6 +249,7 @@ static const struct snd_kcontrol_new controls[] = {
        SOC_DAPM_PIN_SWITCH("Main AMIC"),
        SOC_DAPM_PIN_SWITCH("WM1250 Input"),
        SOC_DAPM_PIN_SWITCH("WM1250 Output"),
+       SOC_DAPM_PIN_SWITCH("Headphone"),
 };
 
 static struct snd_soc_dapm_widget widgets[] = {