Skip to content
  1. May 24, 2023
    • Srinivas Kandagatla's avatar
      ASoC: codecs: wsa883x: do not set can_multi_write flag · 40ba0411
      Srinivas Kandagatla authored
      
      
      regmap-sdw does not support multi register writes, so there is
      no point in setting this flag. This also leads to incorrect
      programming of WSA codecs with regmap_multi_reg_write() call.
      
      This invalid configuration should have been rejected by regmap-sdw.
      
      Fixes: 43b8c7dc ("ASoC: codecs: add wsa883x amplifier support")
      Signed-off-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
      Link: https://lore.kernel.org/r/20230523154605.4284-1-srinivas.kandagatla@linaro.org
      
      
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      40ba0411
    • Maxim Kochetkov's avatar
      ASoC: dwc: move DMA init to snd_soc_dai_driver probe() · 011a8719
      Maxim Kochetkov authored
      
      
      When using DMA mode we are facing with Oops:
      [  396.458157] Unable to handle kernel access to user memory without uaccess routines at virtual address 000000000000000c
      [  396.469374] Oops [#1]
      [  396.471839] Modules linked in:
      [  396.475144] CPU: 0 PID: 114 Comm: arecord Not tainted 6.0.0-00164-g9a8eccdaf2be-dirty #68
      [  396.483619] Hardware name: YMP ELCT FPGA (DT)
      [  396.488156] epc : dmaengine_pcm_open+0x1d2/0x342
      [  396.493227]  ra : dmaengine_pcm_open+0x1d2/0x342
      [  396.498140] epc : ffffffff807fe346 ra : ffffffff807fe346 sp : ffffffc804e138f0
      [  396.505602]  gp : ffffffff817bf730 tp : ffffffd8042c8ac0 t0 : 6500000000000000
      [  396.513045]  t1 : 0000000000000064 t2 : 656e69676e65616d s0 : ffffffc804e13990
      [  396.520477]  s1 : ffffffd801b86a18 a0 : 0000000000000026 a1 : ffffffff816920f8
      [  396.527897]  a2 : 0000000000000010 a3 : fffffffffffffffe a4 : 0000000000000000
      [  396.535319]  a5 : 0000000000000000 a6 : ffffffd801b87040 a7 : 0000000000000038
      [  396.542740]  s2 : ffffffd801b94a00 s3 : 0000000000000000 s4 : ffffffd80427f5e8
      [  396.550153]  s5 : ffffffd80427f5e8 s6 : ffffffd801b44410 s7 : fffffffffffffff5
      [  396.557569]  s8 : 0000000000000800 s9 : 0000000000000001 s10: ffffffff8066d254
      [  396.564978]  s11: ffffffd8059cf768 t3 : ffffffff817d5577 t4 : ffffffff817d5577
      [  396.572391]  t5 : ffffffff817d5578 t6 : ffffffc804e136e8
      [  396.577876] status: 0000000200000120 badaddr: 000000000000000c cause: 000000000000000d
      [  396.586007] [<ffffffff806839f4>] snd_soc_component_open+0x1a/0x68
      [  396.592439] [<ffffffff807fdd62>] __soc_pcm_open+0xf0/0x502
      [  396.598217] [<ffffffff80685d86>] soc_pcm_open+0x2e/0x4e
      [  396.603741] [<ffffffff8066cea4>] snd_pcm_open_substream+0x442/0x68e
      [  396.610313] [<ffffffff8066d1ea>] snd_pcm_open+0xfa/0x212
      [  396.615868] [<ffffffff8066d39c>] snd_pcm_capture_open+0x3a/0x60
      [  396.622048] [<ffffffff8065b35a>] snd_open+0xa8/0x17a
      [  396.627421] [<ffffffff801ae036>] chrdev_open+0xa0/0x218
      [  396.632893] [<ffffffff801a5a28>] do_dentry_open+0x17c/0x2a6
      [  396.638713] [<ffffffff801a6d9a>] vfs_open+0x1e/0x26
      [  396.643850] [<ffffffff801b8544>] path_openat+0x96e/0xc96
      [  396.649518] [<ffffffff801b9390>] do_filp_open+0x7c/0xf6
      [  396.655034] [<ffffffff801a6ff2>] do_sys_openat2+0x8a/0x11e
      [  396.660765] [<ffffffff801a735a>] sys_openat+0x50/0x7c
      [  396.666068] [<ffffffff80003aca>] ret_from_syscall+0x0/0x2
      [  396.674964] ---[ end trace 0000000000000000 ]---
      
      It happens because of play_dma_data/capture_dma_data pointers are NULL.
      Current implementation assigns these pointers at snd_soc_dai_driver
      startup() callback and reset them back to NULL at shutdown(). But
      soc_pcm_open() sequence uses DMA pointers in dmaengine_pcm_open()
      before snd_soc_dai_driver startup().
      Most generic DMA capable I2S drivers use snd_soc_dai_driver probe()
      callback to init DMA pointers only once at probe. So move DMA init
      to dw_i2s_dai_probe and drop shutdown() and startup() callbacks.
      
      Signed-off-by: default avatarMaxim Kochetkov <fido_max@inbox.ru>
      Link: https://lore.kernel.org/r/20230512110343.66664-1-fido_max@inbox.ru
      
      
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      011a8719
    • Stefan Binding's avatar
  2. May 22, 2023
  3. May 19, 2023
  4. May 17, 2023
  5. May 15, 2023
  6. May 12, 2023
    • Paweł Anikiel's avatar
      ASoC: ssm2602: Add workaround for playback distortions · f63550e2
      Paweł Anikiel authored
      Apply a workaround for what appears to be a hardware quirk.
      
      The problem seems to happen when enabling "whole chip power" (bit D7
      register R6) for the very first time after the chip receives power. If
      either "output" (D4) or "DAC" (D3) aren't powered on at that time,
      playback becomes very distorted later on.
      
      This happens on the Google Chameleon v3, as well as on a ZYBO Z7-10:
      https://ez.analog.com/audio/f/q-a/543726/solved-ssm2603-right-output-offset-issue/480229
      
      
      I suspect this happens only when using an external MCLK signal (which
      is the case for both of these boards).
      
      Here are some experiments run on a Google Chameleon v3. These were run
      in userspace using a wrapper around the i2cset utility:
      ssmset() {
              i2cset -y 0 0x1a $(($1*2)) $2
      }
      
      For each of the following sequences, we apply power to the ssm2603
      chip, set the configuration registers R0-R5 and R7-R8, run the selected
      sequence, and check for distortions on playback.
      
        ssmset 0x09 0x01 # core
        ssmset 0x06 0x07 # chip, out, dac
        OK
      
        ssmset 0x09 0x01 # core
        ssmset 0x06 0x87 # out, dac
        ssmset 0x06 0x07 # chip
        OK
      
        (disable MCLK)
        ssmset 0x09 0x01 # core
        ssmset 0x06 0x1f # chip
        ssmset 0x06 0x07 # out, dac
        (enable MCLK)
        OK
      
        ssmset 0x09 0x01 # core
        ssmset 0x06 0x1f # chip
        ssmset 0x06 0x07 # out, dac
        NOT OK
      
        ssmset 0x06 0x1f # chip
        ssmset 0x09 0x01 # core
        ssmset 0x06 0x07 # out, dac
        NOT OK
      
        ssmset 0x09 0x01 # core
        ssmset 0x06 0x0f # chip, out
        ssmset 0x06 0x07 # dac
        NOT OK
      
        ssmset 0x09 0x01 # core
        ssmset 0x06 0x17 # chip, dac
        ssmset 0x06 0x07 # out
        NOT OK
      
      For each of the following sequences, we apply power to the ssm2603
      chip, run the selected sequence, issue a reset with R15, configure
      R0-R5 and R7-R8, run one of the NOT OK sequences from above, and check
      for distortions.
      
        ssmset 0x09 0x01 # core
        ssmset 0x06 0x07 # chip, out, dac
        OK
      
        (disable MCLK)
        ssmset 0x09 0x01 # core
        ssmset 0x06 0x07 # chip, out, dac
        (enable MCLK after reset)
        NOT OK
      
        ssmset 0x09 0x01 # core
        ssmset 0x06 0x17 # chip, dac
        NOT OK
      
        ssmset 0x09 0x01 # core
        ssmset 0x06 0x0f # chip, out
        NOT OK
      
        ssmset 0x06 0x07 # chip, out, dac
        NOT OK
      
      Signed-off-by: default avatarPaweł Anikiel <pan@semihalf.com>
      Link: https://lore.kernel.org/r/20230508113037.137627-8-pan@semihalf.com
      
      
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      f63550e2
  7. May 11, 2023
  8. May 09, 2023
  9. May 08, 2023