04 Jan, 2015

1 commit


19 Dec, 2014

1 commit


17 Dec, 2014

2 commits


11 Dec, 2014

1 commit

  • The kernel log is

    [] (__dabt_svc+0x38/0x60) from [] (mutex_lock+0xc/0x4c)
    [] (mutex_lock+0xc/0x4c) from [] (snd_soc_dapm_stream_event+0x20/0xe4)
    [] (snd_soc_dapm_stream_event+0x20/0xe4) from [] (close_delayed_work+0x3c/0x48)
    [] (close_delayed_work+0x3c/0x48) from [] (process_one_work+0xfc/0x34c)
    [] (process_one_work+0xfc/0x34c) from [] (worker_thread+0x144/0x3a4)
    [] (worker_thread+0x144/0x3a4) from [] (kthread+0xa4/0xb0)
    [] (kthread+0xa4/0xb0) from [] (ret_from_fork+0x14/0x3c)

    The alsa driver use shedule_delayed_work when close pcm in remove module.
    But after remove module the resource is released, so there will be kernel dump.
    So here use ignore_pmdown_time to avoid to use shedule_delayed_work, then this
    issue can be avoided.

    Signed-off-by: Shengjiu Wang

    Shengjiu Wang
     

10 Nov, 2014

2 commits


03 Nov, 2014

2 commits


28 Oct, 2014

14 commits

  • Implement machine driver for mqs, which use the sai as cpu dai.
    sai work on master mode.

    Signed-off-by: Shengjiu Wang

    Shengjiu Wang
     
  • Implement codec driver for mqs. mqs is a very simple IP. which support:

    Word length: 16bit.
    DAI format: Left-Justified, slave mode.

    Signed-off-by: Shengjiu Wang

    Shengjiu Wang
     
  • After several open/close sai test with ctrl+c, there will be I/O error.
    The SAI can't work anymore, can't recover. There will be no frame clock.
    With adding the software reset in trigger stop, the issue can be fixed.

    Signed-off-by: Shengjiu Wang

    Shengjiu Wang
     
  • SAI has 4 mclk source, and the divider is 8bit. fsl_sai_set_bclk will
    select proper mclk source and calculate the divider.
    After fsl_sai_set_bclk, enable the selected mclk in hw_params(), and
    add hw_free() to disable the mclk.

    Signed-off-by: Shengjiu Wang

    Shengjiu Wang
     
  • There is one design rule according to SAI's reference manual:
    If the transmitter bit clock and frame sync are to be used by both transmitter
    and receiver, the transmitter must be configured for asynchronous operation
    and the receiver for synchronous operation.

    And SYNC of TCR2 is a 2-width control bit:
    00 Asynchronous mode.
    01 Synchronous with receiver.
    10 Synchronous with another SAI transmitter.
    11 Synchronous with another SAI receiver.

    So the driver should have set SYNC bit of TCR2 to 0x0, and meanwhile set SYNC
    bit of RCR2 to 0x1 (Synchronous with transmitter).

    Signed-off-by: Nicolin Chen
    Signed-off-by: Mark Brown
    (cherry picked from commit 855675f6e6a65688a7f4cf45b9b5a98cf6c6f5c3)

    Nicolin Chen
     
  • The previous patch (ASoC: fsl_sai: Add asynchronous mode support) added
    new Device Tree bindings for Asynchronous and Synchronous modes support.
    However, these two shall not be present at the same time.

    So this patch just simply makes them exclusive so as to avoid incorrect
    Device Tree binding usage.

    Signed-off-by: Nicolin Chen
    Signed-off-by: Mark Brown
    (cherry picked from commit ce7344a4ebabe90e064d3e087727f45624cdc942)

    Nicolin Chen
     
  • SAI supports these operation modes:
    1) asynchronous mode
    Both Tx and Rx are set to be asynchronous.
    2) synchronous mode (Rx sync with Tx)
    Tx is set to be asynchronous, Rx is set to be synchronous.
    3) synchronous mode (Tx sync with Rx)
    Rx is set to be asynchronous, Tx is set to be synchronous.
    4) synchronous mode (Tx/Rx sync with another SAI's Tx)
    5) synchronous mode (Tx/Rx sync with another SAI's Rx)

    * 4) and 5) are beyond this patch because they are related with another SAI.

    As the initial version of this SAI driver, it supported 2) as default while
    the others were totally missing.

    So this patch just adds supports for 1) and 3).

    Signed-off-by: Nicolin Chen
    Signed-off-by: Mark Brown
    (cherry picked from commit 08fdf65e37d560581233e06a659f73deeb3766f9)

    Nicolin Chen
     
  • There is one design rule according to SAI's reference manual:
    If the transmitter bit clock and frame sync are to be used by both transmitter
    and receiver, the transmitter must be configured for asynchronous operation
    and the receiver for synchronous operation.

    And SYNC of TCR2 is a 2-width control bit:
    00 Asynchronous mode.
    01 Synchronous with receiver.
    10 Synchronous with another SAI transmitter.
    11 Synchronous with another SAI receiver.

    So the driver should have set SYNC bit of TCR2 to 0x0, and meanwhile set SYNC
    bit of RCR2 to 0x1 (Synchronous with transmitter).

    Signed-off-by: Nicolin Chen
    Signed-off-by: Mark Brown
    (cherry picked from commit af96ff5b7448dc776dc24a5c4313c6ec1ee94e53)

    Nicolin Chen
     
  • This patch adds software reset code in dai_probe() so as to make a true init
    by clearing SAI's internal logic, including the bit clock generation, status
    flags, and FIFO pointers.

    Signed-off-by: Nicolin Chen
    Signed-off-by: Mark Brown
    (cherry picked from commit 376d1a92ca587d3974d4791cdb99baa8b8e7f0dd)

    Nicolin Chen
     
  • The previous enable flow:
    1, Enable TE&RE (SAI starts to consume tx FIFO and feed rx FIFO)
    2, Mask IRQ of Tx/Rx to enable its interrupt.
    3, Enable DMA request of Tx/Rx.

    As this flow would enable DMA request later than TERE, the Tx FIFO
    would be easily emptied into underrun while Rx FIFO would be easily
    stuffed into overrun due to the delayed DMA transfering.

    This issue happened merely occational before the patch 'ASoC: fsl_sai:
    Reset FIFOs after disabling TE/RE' because there were useless data
    remaining in the FIFO for the gap. However, it manifested after FIFO
    reset's implemented.

    After this patch, the new flow:
    1, Enable DMA request of Tx/Rx.
    2, Enable TE&RE (SAI starts to consume tx FIFO and feed rx FIFO)
    3, Mask IRQ of Tx/Rx to enable its interrupt.

    Signed-off-by: Nicolin Chen
    Signed-off-by: Mark Brown
    (cherry picked from commit a3fdc6749edf4dcb07df3a10bbdd9850ed5fd01a)

    Nicolin Chen
     
  • TE/RE bit of T/RCSR will remain set untill the current frame is physically
    finished. The FIFO reset operation should wait this bit's totally cleared
    rather than ignoring its status which might cause TE/RE disabling failed.

    This patch adds delay and timeout to wait for its completion before FIFO
    reset.

    Signed-off-by: Nicolin Chen
    Signed-off-by: Mark Brown
    (cherry picked from commit c44b56af9ca3a6f135d8f22b9a240f53909b371e)

    Nicolin Chen
     
  • For trigger start, we don't need to check if it's the first time to
    enable TE/RE or second time. It doesn't hurt to enable them any way,
    which in the meantime can reduce race condition for TE/RE enabling.

    For trigger stop, we will definitely clear FRDE of current direction.
    Thus the driver only needs to read the opposite one's.

    Signed-off-by: Nicolin Chen
    Signed-off-by: Mark Brown
    (cherry picked from commit f4075a8f452aff5465c6522c92da9db71ed11b7f)

    Nicolin Chen
     
  • In the rx irq handling part, we should clear the flags in RCSR not TCSR.

    Signed-off-by: Nicolin Chen
    Signed-off-by: Mark Brown
    (cherry picked from commit 4800f88b615f194ae3c1577038a7ccd871c907c9)

    Nicolin Chen
     
  • SAI will not clear their FIFOs after disabling TE/RE. Therfore, the driver
    should take care the task so as not to let useless data remain in the FIFO.

    Signed-off-by: Nicolin Chen
    Signed-off-by: Mark Brown
    (cherry picked from commit eff952b733d4c1ff3a6b35accce940b223372978)

    Nicolin Chen
     

15 Oct, 2014

4 commits


28 Aug, 2014

13 commits