ssm4567 驱动初始化时soft_reset写入0,出错,返回-5,其它寄存器写入默认值正常,可以正常读出

Hi ADI,

   we using ssm4567 on linux 3.10, while driver init, write soft_reset(0xff) to 0, return error code -5. other register can read write ok. what's the problem?



attach debug log
[edited by: sarvdo at 1:43 AM (GMT -5) on 10 Nov 2021]
  • Hi ADI,

       we using ssm4567 on  allwinner A40i platform(Linux 3.10).i2c(0x34) interface can detect and read register value as following,but while insmod the codec driver module which got from github.com, the Soft_reset(0xff) return -5.(issue #1)

       #2 issue, which we are using tinymix cmd, to config the control path, there is no any control path return.

      #3. how to config the control path?

  • Hello sarvdo,

    I moved this over to the Linux part of the forum. I think they can help more than I can. The address you are writing to is 0xFF, that is not the address of the Soft Reset register so the driver must be translating to the correct address? 0xF890 is the correct address. I am not certain why it would return a -5. When you engage the soft reset the DSP will need to be reprogrammed. I am not sure if you are using Selfboot or not. 

    You mentioned the control path. This part has no standard or default signal path. You have to program the DSP using SigmaStudio and then the control objects will have addresses that have to be defined in any control programs. I think the Linux driver is only for the registers. This is why I moved this over to this forum so someone who is more knowledgeable of the Linux drivers. 

    We do have this tutorial for microcontroller interfacing which might be helpful for you. 

    Interfacing SigmaDSP Processors with a Microcontroller [Analog Devices Wiki]

    Dave T

  • Hi Dave Thib # echo -n "file soc-core.c +p" >/sys/kernel/debug/dynamic_debug/control # insmod /lib/modules/3.10.65/snd-soc-ssm4567.ko # insmod /lib/modules/3.10.65/snd-soc-ssm4567-i2c.ko [ 685.418075] ssm4567 4-0034: probe [ 685.422026] ssm4567 4-0034: Error in caching of register: f890 ret: -5 [ 685.429207] ssm4567 4-0034: codec register 4-0034 [ 685.434634] ssm4567 4-0034: ASoC: dai register 4-0034 #1 [ 685.440578] ssm4567 4-0034: ASoC: Mapped DAI ssm4567-hifi to CODEC ssm4567.4-0034 [ 685.448784] ssm4567 4-0034: ASoC: Registered DAI 'ssm4567-hifi' [ 685.455531] ssm4567 4-0034: ASoC: Registered codec 'ssm4567.4-0034' [ 685.462694] i2c-core: driver [ssm4567] registered the addr of soft_reset in the spec of ssm4567  is 0xFF, not 0xF890, Thanks.

  • Hi,

      Change soft_reset to 0xF890 still has error. the addr of soft_reset in the spec of ssm4567  is 0xFF, not 0xF890, Thanks.

    # mount -t debugfs none /sys/kernel/debug/
    # echo -n "file soc-core.c +p" >/sys/kernel/debug/dynamic_debug/control
    # insmod /lib/modules/3.10.65/snd-soc-ssm4567.ko
    # insmod /lib/modules/3.10.65/snd-soc-ssm4567-i2c.ko
    [   58.767379] ssm4567 4-0034: probe
    [   58.771305] ssm4567 4-0034: Error in caching of register: ff ret: -5
    [   58.778253] ssm4567 4-0034: codec register 4-0034
    [   58.783631] ssm4567 4-0034: ASoC: dai register 4-0034 #1
    [   58.789440] ssm4567 4-0034: ASoC: Mapped DAI ssm4567-hifi to CODEC ssm4567.4-0034
    [   58.797928] ssm4567 4-0034: ASoC: Registered DAI 'ssm4567-hifi'
    [   58.804613] ssm4567 4-0034: ASoC: Registered codec 'ssm4567.4-0034'
    [   58.811792] i2c-core: driver [ssm4567] registered
    [   58.812103] snddaudio0 sound.4: ASoC: binding sysvoice at idx 0
    [   58.812388] ssm4567 4-0034: read 0 => 81
    [   58.812454] snddaudio0 sound.4: ASoC: probe snddaudio0 dai link 0 late -2
    [   58.812460] snddaudio0 sound.4: ASoC: probe snddaudio0 dai link 0 late -1
    [   58.812466] snddaudio0 sound.4: ASoC: probe snddaudio0 dai link 0 late 0
    [   58.812504] snddaudio0 sound.4: ASoC: probe snddaudio0 dai link 0 late 1
    [   58.812509] snddaudio0 sound.4: ASoC: probe snddaudio0 dai link 0 late 2
    [   58.812544] ssm4567 4-0034: read 0 => 81
    [   58.812558] ssm4567 4-0034: read 0 => 81
    [   58.812573] ssm4567 4-0034: read 0 => 81
    [   58.812595] ssm4567 4-0034: read 0 => 81
    [   58.812634] ssm4567 4-0034: read 0 => 81
    [   58.812764] i2c i2c-4: master_xfer[0] W, addr=0x34, len=2
    [   58.813182] i2c i2c-4: master_xfer[0] W, addr=0x34, len=2
    [   58.813481] i2c i2c-4: master_xfer[0] W, addr=0x34, len=2
    # [   58.907585] snddaudio0 sound.4:  ssm4567-hifi <-> 1c22000.daudio mapping ok

    Our Questions #2. how to config/ctrl the audio path let the speak play wav file by tinymix and aplay tools?  Thanks. It's so urgent issue for us. Please help us on it. Thanks.

    Mixer name: 'snddaudio0'
    Number of controls: 10
    ctl     type    num     name                                     value
    0       BOOL    1       DAC High Pass Filter Switch              On
    1       BOOL    1       DAC Low Power Switch                     On
    2       INT     1       Master Playback Volume                   225
    3       BOOL    1       Low-EMI Switch                           On
    4       ENUM    1       Limiter Mode                             Enable Limiter
    5       ENUM    1       Limiter Attack Rate                      20 us/dB
    6       ENUM    1       Limiter Release Rate                     1600 ms/dB
    7       ENUM    1       Limiter Attack Threshold                 6.0Vp
    8       ENUM    1       sunxi daudio audio hub mode              hub_enable
    9       BOOL    1       Amplifier Boost Switch                   On

  • Questions #2. how to config/ctrl the audio path by tinymix tool.

    Please supply the config/control cmd list:

    X is ctrl index number/name

    tinymix  X 0/1/X

    tinymix  X On/Off

    tinymix  X  XX