23 Oct, 2019

1 commit


29 Aug, 2019

4 commits

  • Fix the following KASAN reported issue:
    ==================================================================
    [ 11.580278] BUG: KASAN: stack-out-of-bounds in find_next_bit+0x3c/0xc0
    [ 11.586815] Read of size 8 at addr ffffffc8c8d4f760 by task swapper/0/1
    [ 11.593440]
    [ 11.594943] CPU: 4 PID: 1 Comm: swapper/0 Tainted: G W 4.19.35-05042-g. #157
    [ 11.604259] Hardware name: Freescale i.MX8QM MEK (DT)
    [ 11.609323] Call trace:
    [ 11.611785] dump_backtrace+0x0/0x230
    [ 11.615458] show_stack+0x14/0x20
    [ 11.618787] dump_stack+0xbc/0xf4
    [ 11.622118] print_address_description+0x60/0x270
    [ 11.626830] kasan_report+0x230/0x360
    [ 11.630505] __asan_load8+0x84/0xa8
    [ 11.634005] find_next_bit+0x3c/0xc0
    [ 11.637595] fsl_sai_calc_dl_off+0x1c/0x50
    [ 11.641703] fsl_sai_read_dlcfg+0x184/0x368
    [ 11.645898] fsl_sai_probe+0x3ec/0xb48
    [ 11.649663] platform_drv_probe+0x70/0xd8
    [ 11.653683] really_probe+0x24c/0x370
    [ 11.657358] driver_probe_device+0x70/0x138
    [ 11.661554] __driver_attach+0x124/0x128
    [ 11.665489] bus_for_each_dev+0xe8/0x158
    [ 11.669425] driver_attach+0x30/0x40
    [ 11.673012] bus_add_driver+0x290/0x308
    [ 11.676861] driver_register+0xbc/0x1d0
    [ 11.680711] __platform_driver_register+0x7c/0x88
    [ 11.685431] fsl_sai_driver_init+0x18/0x20
    [ 11.689537] do_one_initcall+0xe8/0x5a8
    [ 11.693387] kernel_init_freeable+0x6b0/0x760
    [ 11.697759] kernel_init+0x10/0x120
    [ 11.701255] ret_from_fork+0x10/0x18
    ....
    ==================================================================
    [ 11.800186] Disabling lock debugging due to kernel taint

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

    Viorel Suman
     
  • Add multi context support for bps_iec958

    Signed-off-by: Shengjiu Wang
    Reviewed-by: Viorel Suman
    (cherry picked from commit 131408cc5b9f7957502c01bf3bff18c9c4b4fca0)

    Shengjiu Wang
     
  • support configuration of channel status for IEC958

    Signed-off-by: Shengjiu Wang
    Reviewed-by: Viorel Suman
    (cherry picked from commit 92aee54f844098080c878ae59878dadab28d8ea3)

    Shengjiu Wang
     
  • IEC958 is only supported for output according to the RM

    Signed-off-by: Shengjiu Wang
    Reviewed-by: Viorel Suman
    (cherry picked from commit bf36888526c420776c18ca06548b9d3798200beb)

    Shengjiu Wang
     

26 Aug, 2019

2 commits


16 Aug, 2019

5 commits

  • The rpmsg i2s audio is supported with codec wm8524 in imx8mn

    Signed-off-by: Shengjiu Wang
    (cherry picked from commit 68ad8218321cec6006acdb3df846da8bc6994792)

    Shengjiu Wang
     
  • In LPA drain state, if runtime->status->state is SUSPEND, after resume,
    ALSA would exit drain mode directly, that cause some data in end
    of song is missed.

    This patch is to enable ignore_suspend flags that
    the runtime->status->state will be not in SUSPEND always.

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

    Shengjiu Wang
     
  • Use the spin lock to protect the work_write_index and work_read_index,
    Use the spin lock to protect the period_done_msg_enabled flag
    That is to avoid the read and write flag confliction.

    Signed-off-by: Shengjiu Wang
    (cherry picked from commit 6de0ce94dd9fe0010f71c508cd0b73bb8f0a51b0)

    Shengjiu Wang
     
  • For we have dropped the cmd I2S_TX_POINTER, and M4 will send
    notification every period, so we don't need to enable timer
    every period to get the position of TX pointer.

    But we need a timer to send the notification to M4 that is
    to reduce the notificaition message number.

    Signed-off-by: Shengjiu Wang
    (cherry picked from commit 900628f0d551c8d4faeb3fe3d33ef4646e13b2e1)

    Shengjiu Wang
     
  • There is error log for short period size:

    [ 6977.102062] i2s_rpmsg virtio0.rpmsg-audio-channel.-1.1: rpmsg_send cmd 22 timeout!

    We use the I2S_TX_POINTER(cmd 22) to get the consumed period
    index from M4 every period time, and m4 should send feedback
    to A53. When the period time is small, there will too much
    cmd send to m4, m4 may not handle it quickly that cause
    timeout.

    This patch is to remove the I2S_TX_POINTER cmd, m4 should
    send notification to A53 every period time to be compatible
    with this change. with the patch the loading of this rpmsg
    channel is reduced.

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

    Shengjiu Wang
     

29 Jul, 2019

1 commit

  • The audio float point data range is (-1, 1), the asrc would output
    all zero for float point input and integer output case, that is to
    drop the fractional part of the data directly.

    In order to support float to int conversion or int to float conversion
    we need to do special operation on the coefficient to enlarge/reduce
    the data to the expected range.

    For float to int case:
    Up sampling:
    1. Create a 1 tap filter with center tap (only tap) of 2^31
    in 64 bits floating point.
    double value = (double)(((uint64_t)1) << 31);
    2. Program 1 tap prefilter with center tap above.

    Down sampling,
    1. If the filter is single stage filter, add "shift" to the exponent of
    stage 1 coefficients.
    2. If the filter is two stage filter , add "shift" to the exponent of
    stage 2 coefficients.

    The "shift" is 31, same for int16, int24, int32 case.

    For int to float case:
    Up sampling:
    1. Create a 1 tap filter with center tap (only tap) of 2^-31
    in 64 bits floating point.
    2. Program 1 tap prefilter with center tap above.

    Down sampling,
    1. If the filter is single stage filter, subtract "shift" to the
    exponent of stage 1 coefficients.
    2. If the filter is two stage filter , subtract "shift" to the
    exponent of stage 2 coefficients.

    The "shift" is 15,23,31, different for int16, int24, int32 case.

    Signed-off-by: Shengjiu Wang
    (cherry picked from commit 8a18a7a2dd1184814c6c61cb116f4d868b003447)

    Shengjiu Wang
     

23 Jul, 2019

2 commits

  • Fix build warning with CONFIG_PM_SLEEP=n, the message is

    In file included from sound/soc/fsl/fsl_easrc.c:2204:0:
    sound/soc/fsl/fsl_easrc_m2m.c:960:13: warning: ‘fsl_easrc_m2m_resume’ defined but not used [-Wunused-function]
    static void fsl_easrc_m2m_resume(struct fsl_easrc *easrc)
    ^~~~~~~~~~~~~~~~~~~~
    sound/soc/fsl/fsl_easrc_m2m.c:927:13: warning: ‘fsl_easrc_m2m_suspend’ defined but not used [-Wunused-function]
    static void fsl_easrc_m2m_suspend(struct fsl_easrc *easrc)
    ^~~~~~~~~~~~~~~~~~~~~

    Signed-off-by: Shengjiu Wang
    Reviewed-by: Daniel Baluta
    Reviewed-by: Viorel Suman
    (cherry picked from commit 0b6e34f8aaac3a6e5a5e1459a9fc6a42d8a8c127)

    Shengjiu Wang
     
  • fix build warning with CONFIG_PM_SLEEP=n, the warning message is

    In file included from sound/soc/fsl/fsl_asrc.c:968:0:
    sound/soc/fsl/fsl_asrc_m2m.c:1021:13: warning: ‘fsl_asrc_m2m_resume’ defined but not used [-Wunused-function]
    static void fsl_asrc_m2m_resume(struct fsl_asrc *asrc_priv)
    ^~~~~~~~~~~~~~~~~~~
    sound/soc/fsl/fsl_asrc_m2m.c:990:13: warning: ‘fsl_asrc_m2m_suspend’ defined but not used [-Wunused-function]
    static void fsl_asrc_m2m_suspend(struct fsl_asrc *asrc_priv)
    ^~~~~~~~~~~~~~~~~~~~

    Signed-off-by: Shengjiu Wang
    Reviewed-by: Daniel Baluta
    Reviewed-by: Viorel Suman
    (cherry picked from commit a3ec5433cfd6fd2b90113a78d5045e04f6a8328c)

    Shengjiu Wang
     

19 Jul, 2019

16 commits


18 Jul, 2019

2 commits

  • Base on latest power management design in MLK-17074, every driver
    need to enter runtime suspend state in suspend, so the driver should
    call the pm_runtime_force_suspend in suspend. with this implementation
    the suspend function almost same as runtime suspend function. so remove
    the suspend function, just use pm_runtime_force_suspend instead.

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

    Shengjiu Wang
     
  • In imx8 when systerm enter suspend state, the power of subsystem will be
    off, The clock enable state will be lost after resume, but the runtime
    resume function will be called after resume by pm, so need to move clock
    enablement to runtime resume and clock disablement to runtime suspend.
    Then after resume the clock enable state can be recovered.

    Signed-off-by: Shengjiu Wang

    Shengjiu Wang
     

17 Jul, 2019

1 commit

  • There is warning log after switching to component in driver:

    [ 2.135785] fsl-rpmsg-i2s rpmsg-i2s: ASoC: Failed to create component debugfs directory

    The reason is there is two component attached with one device,
    the components' name are same, then creating debugfs for second
    component failed.

    This patch is to add debugfs_prefix for platform component to fix
    the warning issue.

    Signed-off-by: Shengjiu Wang

    Shengjiu Wang
     

16 Jul, 2019

1 commit

  • With command: arecord -D hw:$num,0 -f dat | aplay -D hw:0,0 -f dat &

    There is error:
    fsl-ssi-dai 202c000.ssi: invalid slot width: 32
    fsl-ssi-dai 202c000.ssi: failed to set dai tdm slot
    imx-tuner-si476x sound-fm: ASoC: machine hw_params failed: -22

    The reason is that slot width 32 is not valid and and set_sysclk
    api is removed by commit b0a7043d5c2c ("ASoC: fsl_ssi: Caculate bit clock
    rate using slot number and width").

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

    Shengjiu Wang
     

12 Jul, 2019

4 commits


11 Jul, 2019

1 commit