#include <mach/clock.h>
#include <mach/audmux.h>
#include <mach/gpio.h>
+#include <asm/mach-types.h>
#include "imx-ssi.h"
#include "../codecs/wm8962.h"
unsigned int sample_format = SNDRV_PCM_FMTBIT_S16_LE;
static struct imx_priv card_priv;
static struct snd_soc_card snd_soc_card_imx;
-struct clk *wm8962_mclk;
static struct snd_soc_codec *gcodec;
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;
+ struct imx_priv *priv = &card_priv;
+ struct mxc_audio_platform_data *plat = priv->pdev->dev.platform_data;
if (!codec_dai->active)
- clk_enable(wm8962_mclk);
+ plat->clock_enable(1);
return 0;
}
{
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_dai *codec_dai = rtd->codec_dai;
+ struct imx_priv *priv = &card_priv;
+ struct mxc_audio_platform_data *plat = priv->pdev->dev.platform_data;
if (!codec_dai->active)
- clk_disable(wm8962_mclk);
+ plat->clock_enable(0);
return;
}
{ "MICBIAS", NULL, "AMIC" },
{ "IN3R", NULL, "MICBIAS" },
-
{ "DMIC", NULL, "MICBIAS" },
{ "DMICDAT", NULL, "DMIC" },
struct imx_priv *priv = &card_priv;
int ret = 0;
- wm8962_mclk = clk_get(NULL, "clko_clk");
- if (IS_ERR(wm8962_mclk)) {
- printk(KERN_ERR "can't get CLKO clock.\n");
- return PTR_ERR(wm8962_mclk);
- }
-
priv->pdev = pdev;
imx_audmux_config(plat->src_port, plat->ext_port);
{
struct mxc_audio_platform_data *plat = pdev->dev.platform_data;
+ plat->clock_enable(0);
+
if (plat->finit)
plat->finit();
- clk_disable(wm8962_mclk);
- clk_put(wm8962_mclk);
-
return 0;
}
if (ret < 0)
goto exit;
+ if (machine_is_mx6q_sabresd())
+ imx_dai[0].codec_name = "wm8962.0-001a";
+ else if (machine_is_mx6sl_arm2())
+ imx_dai[0].codec_name = "wm8962.1-001a";
+
imx_snd_device = platform_device_alloc("soc-audio", 5);
if (!imx_snd_device)
goto err_device_alloc;