AnsweredAssumed Answered

WM8960:no voice on headphone

Question asked by Qingyuan Lam on Jan 22, 2015

Hi,

    We worked on the following platform:

   1.Android 4.0.4(android-13.5.0-ga.01);

   2.CPU:Freescale i.MX 6SoloLite EVK Board;

   3.Codec: WM8960;

   4.Bootup from SD card +LPDDR2;

  5. Now the situation is:

       Codec had been registered,but I can't hear any sounds when I play mp3 music.it is no voice on headphone.

   6.Here is the source codes:

     6.1).Board files configuration of WM8960:    

static struct imx_ssi_platform_data mx6sl_evk_ssi_pdata = {

  .flags = IMX_SSI_DMA | IMX_SSI_SYN,

};

static struct mxc_audio_platform_data wm8960_pdata;

 

static struct platform_device mx6sl_evk_audio_wm8960_device = {

  .name = IMX_WM8960_DRIVE_NAME,

};

static struct wm8960_data wm8960_config_data = {

 

};

 

static int wm8960_clk_enable(int enable)

{

  imx6Sl_debug("enable=%d",enable);

       if (IS_ERR(extern_audio_root)) {

                pr_err("audio clock source is not found!\n");

                return -1;

        }

  if (enable)

  clk_enable(extern_audio_root);

  else

  clk_disable(extern_audio_root);

  return 0;

}

 

 

static int mxc_wm8960_init(void)

{

  struct clk *pll4;

  int rate;

  imx6Sl_debug();

  extern_audio_root = clk_get(NULL, "extern_audio_clk");

  if (IS_ERR(extern_audio_root)) {

  pr_err("can't get extern_audio_root clock.\n");

  return PTR_ERR(extern_audio_root);

  }

  pll4 = clk_get(NULL, "pll4");

  if (IS_ERR(pll4)) {

  pr_err("can't get pll4 clock.\n");

  return PTR_ERR(pll4);

  }

  clk_set_parent(extern_audio_root, pll4);

  rate = clk_round_rate(extern_audio_root,11289600);

  clk_set_rate(extern_audio_root, rate);

  imx6Sl_debug("rate =%d",rate);

  wm8960_pdata.sysclk = rate;

  return 0;

}

static struct mxc_audio_platform_data wm8960_pdata = {

  .ssi_num = 1,

  .src_port = 2,

  .ext_port = 3,

  .hp_gpio =-1,

  .hp_active_low = 1,

  .mic_gpio =-1,

  .mic_active_low = 1,

  .init = mxc_wm8960_init,

  .clock_enable = wm8960_clk_enable,

};

static int __init mx6_evk_init_audio(void)

{

  imx6Sl_debug();

  mxc_register_device(&mx6sl_evk_audio_wm8960_device,

  &wm8960_pdata);

  /*imx-ssi.c*/

  imx6q_add_imx_ssi(1, &mx6sl_evk_ssi_pdata);

 

  return 0;

}

6.2).WM8960.c and imx-wm8960.c please see attachment files(wm8960.txt,imx-wm8960.txt).

 

7. The log of wm8960 can see this log(wm8960_log_0122.txt).

 

Can you tell me where was wrong ?

 

Thanks very much in advance.

Original Attachment has been moved to: wm8960.txt.zip

Original Attachment has been moved to: wm8960_log_0122.txt.zip

Original Attachment has been moved to: imx-wm8960.txt.zip

Outcomes