Post Go back to editing

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]
Parents
  • 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

  • Thanks a lot for your help to answer the question from customer.Customer is urgent due to tight schedule.

    Really appreciate.

  • #4

    # tinyplay /mnt/test.wav  -D 1
    Sample is 2 channels, device only supports <= 1 channels

    what's the reason?

  • Hi,

    Sorry but I missed the link to wiki page for amixer. You can find it here: Linux Sound Driver [Analog Devices Wiki]

    Unfortunately we don't support that "tinyalsa" lib so you have to figure out by yourself the adaptations ad commands you have to issue through "tinyalsa"

    You ask if the driver you ported is ok but please provide its sources to be able to respond that. Otherwise we don't know what are you porting. DMESG looks fine. Did you probed the I2S  lines? Is your CPU putting any data out?

    SSM4567 is a single output channel (mono) part. That's why it has only one channel.

  • if we using alsamix, (not tinymix) pls list the setting cmd.

    the driver is download from your web site........

  • Hello sardo,

    Sorry, I was in error. I had read too fast and saw 1467 instead of 4567 so the soft reset address I stated was wrong. Rajeev is helping you now so that is good. Sorry for the confusion. 

    Dave T

  • Hi ,

      SSM4567 is a single output channel (mono) part?are you sure ?

       but why it has Stereo Modes?

      Please see attach file and confirm it carefully before you repsone.

  • Hi

      which we need as following:

    tinymix  -D 1 3 1
    tinymix  -D 1 4 1
    tinymix  -D 1 8 hub_enable

    .....

    BRs

  • I'm pretty sure that it is a mono part. In order to have stereo output you have to use two SSM4567 chips.

    The register you are referring (0x04) is used to configure the serial audio interface to accept I2S stereo mode frames. SSM4567 can be used in configurations of up to 4 chips (Multichip I2S) or up to 8 chips (TDM) sharing the same audio serial bus. So you can send stereo I2S frames from host processor but you have to have connected two SSM4567 chips for stereo output and configure one of the chips to take its data from FSYNC low and the other from FSYNC high.

    Also take care that the output of SSM4567 is created with an H bridge and that's why you have OUTN and OUTP. If you connected two loudspeakers with GND reference that's not how this part is designed to work!

  • Hi btogorean

       Thanks for your reply.

        what's the meaning of "If you connected two loudspeakers with GND reference that's not how this part is designed to work!"

  • Hi, I mean the right connection is the one showed in the datasheet with only one speaker connected to one SSM4567 part.

    Right connection

    If you connect two speakers like bellow that's wrong. You can tell that even from sense lines because current through speaker connected to OUTN would not be monitored.

    Wring connection

Reply Children
No Data