18 Dec, 2020

12 commits


15 Dec, 2020

1 commit


14 Dec, 2020

27 commits

  • To cope with upstream API change:
    e2978c45e5ed ("ASoC: soc-dai: remove .digital_mute")

    Signed-off-by: Dong Aisheng

    Dong Aisheng
     
  • To cope with upstream API change:
    e2978c45e5ed ("ASoC: soc-dai: remove .digital_mute")

    Signed-off-by: Dong Aisheng

    Dong Aisheng
     
  • in i.MX8MP, the audio codec is registered by DT, and we reserve
    a memory in DT that we can allocate dma memory from the
    reserved pool.

    Signed-off-by: Shengjiu Wang
    Reviewed-by: Viorel Suman

    Shengjiu Wang
     
  • rpmsg wm8960 also can be registered as an i2c device.

    Signed-off-by: Shengjiu Wang
    Reviewed-by: Viorel Suman

    Shengjiu Wang
     
  • Don't register codec driver if it is from DT.

    Signed-off-by: Shengjiu Wang
    Reviewed-by: Viorel Suman

    Shengjiu Wang
     
  • in i.MX8MP, the audio codec is registered by DT. So we add
    a new flag: codec_in_dt

    Signed-off-by: Shengjiu Wang
    Reviewed-by: Viorel Suman

    Shengjiu Wang
     
  • snd_soc_component_read32() was removed since:
    5b554b0a29ce ("ASoC: remove snd_soc_component_read32()")

    Signed-off-by: Dong Aisheng

    Dong Aisheng
     
  • API usage changed since:
    cf6e26c71bfd ("ASoC: soc-component: merge snd_soc_component_read() and snd_soc_component_read32()")

    Signed-off-by: Dong Aisheng

    Dong Aisheng
     
  • Switch to new API introduced by:
    c2233a266178 ("ASoC: soc: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer")

    Reviewed-by: Daniel Baluta
    Signed-off-by: Dong Aisheng

    Dong Aisheng
     
  • 67b06ba0 ("PM: QoS: Drop PM_QOS_CPU_DMA_LATENCY and rename related functions")
    changed the pm_qos_*() APIs.
    Updated the IMX usage of them to the new APIs.

    Signed-off-by: Dong Aisheng

    Dong Aisheng
     
  • This ioctl was removed since:
    e91f134c83b1 ("ASoC: sh: Drop superfluous ioctl PCM ops")

    ../sound/soc/fsl/imx-pcm-rpmsg.c:701:12: error: ‘snd_soc_pcm_lib_ioctl’ undeclared here (not in a function); did you mean ‘snd_pcm_lib_ioctl’?
    701 | .ioctl = snd_soc_pcm_lib_ioctl,
    | ^~~~~~~~~~~~~~~~~~~~~
    | snd_pcm_lib_ioctl

    Signed-off-by: Dong Aisheng

    Dong Aisheng
     
  • API changed since
    613fb50059cf ("ASoC: soc-core: remove snd_soc_rtdcom_list")

    In file included from ../sound/soc/soc-pcm.c:25:
    ../sound/soc/soc-pcm.c: In function ‘soc_rtdcom_ack’:
    ../include/sound/soc.h:1153:12: warning: comparison between pointer and integer
    1153 | ((i) < rtd->num_components) && ((component) = rtd->components[i]);\
    | ^
    ../sound/soc/soc-pcm.c:2881:2: note: in expansion of macro ‘for_each_rtd_components’
    2881 | for_each_rtd_components(rtd, rtdcom, component) {
    | ^~~~~~~~~~~~~~~~~~~~~~~
    ../include/sound/soc.h:1153:68: error: array subscript is not an integer
    1153 | ((i) < rtd->num_components) && ((component) = rtd->components[i]);\
    | ^
    ../sound/soc/soc-pcm.c:2881:2: note: in expansion of macro ‘for_each_rtd_components’
    2881 | for_each_rtd_components(rtd, rtdcom, component) {
    | ^~~~~~~~~~~~~~~~~~~~~~~
    ../include/sound/soc.h:1154:10: error: increment of pointer to an incomplete type ‘struct snd_soc_rtdcom_list’
    1154 | (i)++)
    | ^~
    ../sound/soc/soc-pcm.c:2881:2: note: in expansion of macro ‘for_each_rtd_components’
    2881 | for_each_rtd_components(rtd, rtdcom, component) {

    Signed-off-by: Dong Aisheng

    Dong Aisheng
     
  • Fix compile issue for upgrade to 5.5 that struct snd_pcm_ops
    is removed from struct snd_soc_component_driver.

    Signed-off-by: Shengjiu Wang

    Shengjiu Wang
     
  • In imx8mn, M7 image has poor quality for 8kHz ~ 22kHz sample rate
    case, but M7 side don't want to fix this issue in their image, so
    we remove these sample rate in supported list.

    Signed-off-by: Shengjiu Wang

    Shengjiu Wang
     
  • As we enabled WQ_FREEZABLE for workqueue, flush_workqueue in suspend
    stage will not success, for the workqueue is freezed.

    flush_workqueue in suspend is a wrong operation with WQ_FREEZABLE,
    so remove it.

    Fixes: 5b07f684deb1 ("LF-215: ASoC: fsl_rpmsg_i2s: Enable WQ_FREEZABLE for workqueue")
    Signed-off-by: Shengjiu Wang

    Shengjiu Wang
     
  • In the end of playback, when the suspend happen, there will be error
    in m4 side.

    RTM_SaiSdmaAdapter_SetParam: Tx in wrong state 2!
    SRTM_SaiSdmaAdapter_SetBuf: Tx in wrong state 2!
    SRTM_SaiSdmaAdapter_Start: Tx in wrong state 2!

    The reason is that the I2S_TX_TERMINATE happen in the middle of
    I2S_TX_SUSPEND and I2S_TX_RESUME, this sequence is not allowed.

    So we make the rpmsg message workqueue enter freeze in suspend
    to avoid such issue. that the command sequence will be
    I2S_TX_SUSPEND->I2S_TX_RESUME->I2S_TX_TERMINATE

    Signed-off-by: Shengjiu Wang

    Shengjiu Wang
     
  • prtd is not needed by this driver.

    Signed-off-by: Shengjiu Wang

    Shengjiu Wang
     
  • Signed-off-by: Leonard Crestez

    Leonard Crestez
     
  • When suspend, the widget "AK4497 DAC" is powered down
    then there is no sound output, which is not accepted
    by LPA definition.

    so ignore suspend with DAPM, that the widget will not
    be powered down

    Signed-off-by: Shengjiu Wang

    Shengjiu Wang
     
  • replace codec to component

    Signed-off-by: Shengjiu Wang

    Shengjiu Wang
     
  • replace codec to component

    Signed-off-by: Shengjiu Wang

    Shengjiu Wang
     
  • replace codec to component

    Signed-off-by: Shengjiu Wang

    Shengjiu Wang
     
  • 77be7d36a525 ("MLK-22400-1: ASoC: fsl_rpmsg_i2s: Add rpmsg i2s for imx8mn")
    31d5dfa44c20 ("MLK-22340-5: ASoC: imx-pcm-rpmsg: enable ignore_suspend for LPA")
    c5c41138d5c8 ("MLK-22340-4: ASoC: fsl_rpmsg_i2s: add lock to protect the resource")
    adb4b596d2ba ("MLK-22340-3: ASoC: imx-pcm-rpmsg: refine the timer")
    a5e80bf012c3 ("MLK-22340-2: ASoC: imx-pcm-rpmsg: drop the cmd I2S_TX_POINTER")
    404367d9316b ("MLK-21980: ASoC: imx-pcm-rpmsg: add debugfs_prefix for platform")
    971faf095246 ("MLK-21450: ASoC: fsl_rpmsg: fix timer issue for updating to 4.19")
    edbbcdc07bf1 ("MLK-21461: ASoC: fsl_rpmsg_i2s: clear buffer pointer in i2s_send_message")
    f5f2f38018d8 ("MLK-21447: ASoC: fsl_rpmsg_i2s: underrun in m4 for msg delayed")
    d9410ace757f ("MLK-21307: ASoC: fsl_rpmsg_i2s: optimize the message sent to m4")
    98633a4cd35b ("MLK-21440-1: ASoC: fsl_rpmsg_i2s: init spin lock")
    7bf6d3131863 ("MLK-21107-1: ASoC: Fix timer wake up system after suspend")
    eb422681ffa4 ("MLK-20661: ASoC: imx-pcm-rpmsg: remove the nonblock constraint")
    e36957e97ca9 ("MLK-21002-1: ASoC: imx-pcm-rpmsg: fix data consumed faster with pause")
    bc828e61693f ("MLK-19565-1: ASoC: fsl_rpmsg_i2s: support rpmsg on imx8qm")
    e56bedf71ae4 ("MLK-21107-2: ASoC: Drop msg if msg queue is full")

    Signed-off-by: Shengjiu Wang
    (cherry picked from commit 31def064871336af7780d01a6ed8c5ed075b7e48)

    Shengjiu Wang
     
  • With CONFIG_LOCKDEP=y, there will kernel dump

    [ 55.305563] INFO: trying to register non-static key.
    [ 55.310540] the code is fine but needs lockdep annotation.
    [ 55.316027] turning off the locking correctness validator.
    [ 55.321520] CPU: 0 PID: 32 Comm: kworker/0:1 Tainted: G W 4.14.78-00007-g524e1b1f0b3f #18
    [ 55.330827] Hardware name: FSL i.MX8MM EVK board (DT)
    [ 55.335892] Workqueue: events rpmsg_work_handler
    [ 55.340515] Call trace:
    [ 55.342971] [] dump_backtrace+0x0/0x270
    [ 55.348375] [] show_stack+0x24/0x30
    [ 55.353433] [] dump_stack+0xb8/0xf0
    [ 55.358490] [] register_lock_class+0x364/0x548
    [ 55.364501] [] __lock_acquire+0x7c/0x18a8
    [ 55.370077] [] lock_acquire+0xc8/0x290
    [ 55.375394] [] _raw_spin_lock_irqsave+0x54/0x70
    [ 55.381493] [] i2s_rpmsg_cb+0xe8/0x1b0
    [ 55.386810] [] rpmsg_recv_done+0x144/0x210
    [ 55.392476] [] vring_interrupt+0x44/0x78
    [ 55.397966] [] imx_mu_rpmsg_callback+0x6c/0x80
    [ 55.403977] [] notifier_call_chain+0x5c/0x98
    [ 55.409813] [] __blocking_notifier_call_chain+0x58/0xa0
    [ 55.416605] [] blocking_notifier_call_chain+0x3c/0x50
    [ 55.423223] [] rpmsg_work_handler+0x88/0xe8
    [ 55.428974] [] process_one_work+0x290/0x738
    [ 55.434723] [] worker_thread+0x58/0x460
    [ 55.440127] [] kthread+0x104/0x130
    [ 55.445096] [] ret_from_fork+0x10/0x1c

    The reason is that the spin lock is not initilized.

    Signed-off-by: Shengjiu Wang
    (cherry picked from commit 0e98ac55f17f6505f92c515c3c04581039e21865)
    (cherry picked from commit 314ef30b1bc75971c3e59f5ab9919586495ca556)

    Shengjiu Wang
     
  • Previously we add snd_soc_find_dai to check if the codec is probed or
    not, but this bring kernel dump issue when CONFIG_LOCKDEP=y.

    [ 2.823379] WARNING: CPU: 2 PID: 1 at sound/soc/soc-core.c:1016 snd_soc_find_dai+0x144/0x150
    [ 2.831827] Modules linked in:
    [ 2.834907] CPU: 2 PID: 1 Comm: swapper/0 Not tainted 4.14.78-00007-g524e1b1f0b3f #18
    [ 2.842748] Hardware name: FSL i.MX8MM EVK board (DT)
    [ 2.847811] task: ffff8000624f0000 task.stack: ffff000008078000
    [ 2.853745] PC is at snd_soc_find_dai+0x144/0x150
    [ 2.858462] LR is at snd_soc_find_dai+0x140/0x150

    ...

    [ 3.469675] Call trace:
    [ 3.472135] Exception stack(0xffff00000807ba40 to 0xffff00000807bb80)
    [ 3.478590] ba40: 0000000000000000 00000000ffffffff 0000000000000000 0000000000000002
    [ 3.4864333.596564] [] bus_add_driver+0x110/0x230
    [ 3.602149] [] driver_register+0x68/0x100
    [ 3.607735] [] __platform_driver_register+0x54/0x60
    [ 3.614191] [] imx_rpmsg_driver_init+0x20/0x28
    [ 3.620213] [] do_one_initcall+0x44/0x130
    [ 3.625801] [] kernel_init_freeable+0x1e0/0x280
    [ 3.631909] [] kernel_init+0x18/0x110
    [ 3.637148] [] ret_from_fork+0x10/0x1c

    So we could't resolve the warning "snd_soc_register_card failed (-517)".

    Fixes: 75632b22a332 ("MLK-20247: ASoC: imx-rpmsg: fix error when
    m4 image is not loaded")
    Signed-off-by: Shengjiu Wang

    (cherry picked from commit bbc1868d1c3ec448301d76606e7199f74aa35581)
    (cherry picked from commit ebf3fc59b84503a8da40a8e54a92e6de60e01dce)

    Shengjiu Wang
     
  • IMX RPMSG is still not ready.

    In file included from ../sound/soc/codecs/rpmsg_wm8960.c:27:0:
    ../sound/soc/codecs/../fsl/fsl_rpmsg_i2s.h:278:29: fatal error: linux/imx_rpmsg.h: No such file or directory
    #include
    ^
    compilation terminated.
    ../scripts/Makefile.build:278: recipe for target 'sound/soc/codecs/rpmsg_wm8960.o' failed
    make[4]: *** [sound/soc/codecs/rpmsg_wm8960.o] Error 1
    make[4]: *** Waiting for unfinished jobs....
    AR arch/arm/mach-imx/built-in.a
    In file included from ../sound/soc/codecs/rpmsg_cs42xx8.c:25:0:
    ../sound/soc/codecs/../fsl/fsl_rpmsg_i2s.h:278:29: fatal error: linux/imx_rpmsg.h: No such file or directory
    #include

    Signed-off-by: Dong Aisheng

    Dong Aisheng
     
  • support codec through rpmsg

    Signed-off-by: Shengjiu Wang
    (cherry picked from commit 8585d67e54c4c3607990a792718992de8be8fe58)
    [ Aisheng: split card imx-cs42888 changes ]
    Signed-off-by: Dong Aisheng

    Shengjiu Wang