Post Go back to editing

sound: ASoC: ssm2602 : master clock

Hi there,

I am trying to setup the SSM2604 to run as clock master. I can't seem to get it to generate the clock (whilst I can get the SoC to generate the clocks).

I have copied the bf5xx-ssm2602.c method and this is in my codebase :

static int flatmax_ssm2602_dai_init(struct snd_soc_pcm_runtime *rtd)

{

     return snd_soc_dai_set_sysclk(rtd->codec_dai, SSM2602_SYSCLK, 12000000, SND_SOC_CLOCK_IN);

}


I am using a 12MHz crystal connected to XTI and XTO as suggested.

Any ideas or pointers ?

thanks

Matt

  • Hi,

    The first step is to configure the external clock correctly like you did in your snipped. The second step is to configure the DAI link in your board driver as SND_SOC_DAIFMT_CBM_CFM. This can be done by setting the dai_fmt field in the snd_soc_dai_link struct.

    - Lars

  • OK, still no clocks...

    My platform/codec ALSA file for my PCB is really simple (see below). However I still don't see I2S clk and LR clk coming from the SSM2604.

    Could it be a hardware problem ? Is it possible its a crystal problem ?

    Is there a way for me to probe the chip to see clock elsewhere (other then the LR_CLK and I2S_CLK).

    thanks

    Matt

    static int flatmax_ssm2602_dai_init(struct snd_soc_pcm_runtime *rtd)

    {

      return snd_soc_dai_set_sysclk(rtd->codec_dai, SSM2602_SYSCLK, 12000000, SND_SOC_CLOCK_IN);

    }

    static struct snd_soc_dai_link flatmax_ssm2604_dai[] = {

      {

      .name = "flatmax audio",

      .stream_name = "flatmax audio",

      .cpu_dai_name = "ath79-i2s",

      .codec_dai_name = "ssm2602-hifi",

      .platform_name = "ath79-pcm-audio",

      .codec_name = "ssm2602.0-001a",

      .init = flatmax_ssm2602_dai_init,

      .dai_fmt = SND_SOC_DAIFMT_CBM_CFM,

      },

    };

    static struct snd_soc_card snd_soc_flatmax = {

      .name = "flatmax-ssm2604",

      .dai_link = &flatmax_ssm2604_dai,

      .num_links = 1,

    };

    static struct platform_device *flatmax_snd_device;

    static int __init flatmax_ssm2604_init(void)

    {

      int ret;

      flatmax_snd_device = platform_device_alloc("soc-audio", -1);

      if(!flatmax_snd_device)

      return -ENOMEM;

      platform_set_drvdata(flatmax_snd_device, &snd_soc_flatmax);

      ret = platform_device_add(flatmax_snd_device);

      if (ret) {

      platform_device_put(flatmax_snd_device);

      }

      return ret;

    }

    static void __exit flatmax_ssm2604_exit(void)

    {

      platform_device_unregister(flatmax_snd_device);

    }

  • Hi,

    If everything is configured correctly and the hardware is setup correctly the SSM2604 will start generating the clocks as soon as playback or capture is started.

    The software setup looks good from what I can tell, so there might be an hardware issue.

    You can also check the clock on the CLKOUT pin, but again this will only become available when playback or capture is started. Also try to probe the clock signal that is coming out of your crystal.

    - Lars

Before You Switch


Switching languages will make ADI Explorer unavailable. Resume your session by switching back to English and reopening ADI Explorer.