obj-$(CONFIG_SND_SOC_PHYCORE_AC97) += snd-soc-phycore-ac97.o
obj-$(CONFIG_SND_SOC_MX27VIS_AIC32X4) += snd-soc-mx27vis-aic32x4.o
obj-$(CONFIG_SND_MXC_SOC_WM1133_EV1) += snd-soc-wm1133-ev1.o
+obj-$(CONFIG_SND_SOC_IMX_WM8958) += snd-soc-imx-wm8958.o
obj-$(CONFIG_SND_SOC_IMX_SGTL5000) += snd-soc-imx-sgtl5000.o
obj-$(CONFIG_SND_SOC_IMX_CS42888) += snd-soc-imx-cs42888.o
obj-$(CONFIG_SND_SOC_IMX_SPDIF) += snd-soc-imx-spdif.o
-obj-$(CONFIG_SND_SOC_IMX_HDMI) += snd-soc-imx-hdmi.o
-obj-$(CONFIG_SND_SOC_IMX_WM8958) += snd-soc-imx-wm8958.o
\ No newline at end of file
+obj-$(CONFIG_SND_SOC_IMX_HDMI) += snd-soc-imx-hdmi.o
\ No newline at end of file
#include <linux/io.h>
#include <linux/fsl_devices.h>
#include <linux/slab.h>
+#include <linux/clk.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
};
static struct imx_priv card_priv;
static struct snd_soc_card snd_soc_card_imx;
-
+struct clk *codec_mclk;
static struct snd_soc_jack hs_jack;
/* Headphones jack detection DAPM pins */
static int imx_hifi_startup(struct snd_pcm_substream *substream)
{
+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_soc_dai *codec_dai = rtd->codec_dai;
+
+ if (!codec_dai->active)
+ clk_enable(codec_mclk);
+
return 0;
}
static void imx_hifi_shutdown(struct snd_pcm_substream *substream)
{
+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_soc_dai *codec_dai = rtd->codec_dai;
+
+ if (!codec_dai->active)
+ clk_disable(codec_mclk);
+
return;
}
static const struct snd_soc_dapm_widget imx_dapm_widgets[] = {
SND_SOC_DAPM_MIC("Headset Mic", NULL),
SND_SOC_DAPM_MIC("Main Mic", NULL),
- SND_SOC_DAPM_HP("Headset Phone", NULL),
+ SND_SOC_DAPM_HP("Headphone Jack", NULL),
SND_SOC_DAPM_SPK("Ext Spk", NULL),
};
/* ----output------------------- */
/* HP_OUT --> Headphone Jack */
- {"Headset Phone", NULL, "HPOUT1L"},
- {"Headset Phone", NULL, "HPOUT1R"},
+ {"Headphone Jack", NULL, "HPOUT1L"},
+ {"Headphone Jack", NULL, "HPOUT1R"},
/* LINE_OUT --> Ext Speaker */
{"Ext Spk", NULL, "SPKOUTLP"},
/* Set up imx specific audio path audio_map */
snd_soc_dapm_add_routes(&codec->dapm, audio_map, ARRAY_SIZE(audio_map));
- snd_soc_dapm_enable_pin(&codec->dapm, "Headset Phone");
+ snd_soc_dapm_enable_pin(&codec->dapm, "Headphone Jack");
snd_soc_dapm_sync(&codec->dapm);
struct wm8994 *wm8958 = plat->priv;
int ret = 0;
+ codec_mclk = clk_get(NULL, "clko_clk");
+ if (IS_ERR(codec_mclk)) {
+ printk(KERN_ERR "can't get CLKO clock.\n");
+ return PTR_ERR(codec_mclk);
+ }
+
priv->pdev = pdev;
priv->wm8958 = wm8958;
if (plat->finit)
plat->finit();
+ clk_disable(codec_mclk);
+ clk_put(codec_mclk);
+
return 0;
}