1. 19 12月, 2017 7 次提交
  2. 29 11月, 2017 3 次提交
    • M
      ASoC: fsl_ssi: add 20-bit sample format for AC'97 and use it for capture · 10582635
      Maciej S. Szmigiero 提交于
      When testing AC'97 capture on UDOO board (currently the only user of
      fsl_ssi driver in the AC'97 mode) it become obvious that there is a massive
      distortion above certain, small input signal.
      
      This problem has been traced to silicon errata ERR003778:
      "In AC97, 16-bit mode, received data is shifted by 4-bit locations" that
      has "No fix scheduled".
      This errata suggests a workaround of doing a 4-bit shift back in SDMA
      script for this specific operation mode, however our SDMA scripts are
      shared between various SoC peripherals so we can't really modify them.
      
      There is a simple way to avoid this problem, however, that is to disallow
      recording in 16-bit mode and only support it in AC'97-native 20-bit mode.
      We have to use a 4-byte format for this since SSI FIFOs do not allow 3-byte
      accesses (and these aren't supported by imx-sdma driver anyway).
      With this change the capture distortion is gone.
      
      We can also add this format as an additional one supported for playback,
      using this opportunity to make sure that we use CPU-endian-native formats
      in AC'97 mode as we already do in I2S mode.
      
      There is no problem in using different bit widths in playback and capture
      in AC'97 mode so allow this, too.
      Signed-off-by: NMaciej S. Szmigiero <mail@maciej.szmigiero.name>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      10582635
    • M
      ASoC: fsl_ssi: only enable proper channel slots in AC'97 mode · 01ca4851
      Maciej S. Szmigiero 提交于
      We need to make sure that only proper channel slots (in SACCST register)
      are enabled at playback start time since some AC'97 CODECs (like VT1613 on
      UDOO board) were observed requesting via SLOTREQ spurious ones just after
      an AC'97 link is started but before the CODEC is configured by its driver.
      When a bit for some channel slot is set in a SLOTREQ request then SSI sets
      the relevant bit in SACCST automatically, which then 'sticks' until it is
      manually unset.
      The SACCST register is not writable directly, we have to use SACCDIS and
      SACCEN registers to configure it instead (these aren't normal registers:
      writing a '1' bit at some position in SACCEN sets the relevant bit in
      SACCST; SACCDIS operates in a similar way but allows unsetting bits in
      SACCST).
      
      Theoretically, this should be necessary only for the very first playback
      but since some CODECs are so untrustworthy and extra channel slots enabled
      mean ruined playback let's play safe here and make sure that no extra
      slots are enabled in SACCST every time a playback is started.
      Signed-off-by: NMaciej S. Szmigiero <mail@maciej.szmigiero.name>
      Acked-by: NNicolin Chen <nicoleotsuka@gmail.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      01ca4851
    • M
      ASoC: fsl_ssi: call _fsl_ssi_set_dai_fmt() just once in AC'97 mode · c997a92a
      Maciej S. Szmigiero 提交于
      In AC'97 mode we configure and start SSI RX / TX on probe path via
      a call to _fsl_ssi_set_dai_fmt() function.
      We don't need to call this function again later and in fact don't want to
      do it since this function temporarily sets STCR, SRCR and SCR to some
      intermediate values.
      Signed-off-by: NMaciej S. Szmigiero <mail@maciej.szmigiero.name>
      Acked-by: NNicolin Chen <nicoleotsuka@gmail.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      c997a92a
  3. 28 11月, 2017 3 次提交
  4. 19 9月, 2017 1 次提交
    • N
      ASoC: fsl_ssi: Caculate bit clock rate using slot number and width · b0a7043d
      Nicolin Chen 提交于
      The set_sysclk() now is used to override the output bit clock rate.
      But this is not a common way to implement a set_dai_sysclk(). And
      this creates a problem when a general machine driver (simple-card
      for example) tries to do set_dai_sysclk() by passing an input clock
      rate for the baud clock instead of setting the bit clock rate as
      fsl_ssi driver expected.
      
      So this patch solves this problem by firstly removing set_sysclk()
      since the hw_params() can calculate the bit clock rate. Secondly,
      in order not to break those TDM use cases which previously might
      have been using set_sysclk() to override the bit clock rate, this
      patch changes the driver to calculate the bit clock rate using the
      slot number and the slot width from the via set_tdm_slot().
      
      The patch also removes an obsolete comment of the dir parameter.
      Signed-off-by: NNicolin Chen <nicoleotsuka@gmail.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      b0a7043d
  5. 15 8月, 2017 1 次提交
  6. 11 4月, 2017 2 次提交
  7. 05 1月, 2017 1 次提交
    • C
      ASoC: fsl_ssi: set fifo watermark to more reliable value · 4ee437fb
      Caleb Crome 提交于
      The fsl_ssi fifo watermark is by default set to 2 free spaces (i.e.
      activate DMA on FIFO when only 2 spaces are left.)  This means the
      DMA must service the fifo within 2 audio samples, which is just not
      enough time  for many use cases with high data rate.  In many
      configurations the audio channel slips (causing l/r swap in stereo
      configurations, or channel slipping in multi-channel configurations).
      
      This patch gives more breathing room and allows the SSI to operate
      reliably by changing the fifio refill watermark to 8.
      
      There is no change in behavior for older chips (with an 8-deep fifo).
      Only the newer chips with a 15-deep fifo get the new behavior. I
      suspect a new fifo depth setting could be optimized on the older
      chips too, but I have not tested.
      Signed-off-by: NCaleb Crome <caleb@crome.org>
      Reviewed-by: NFabio Estevam <fabio.estevam@nxp.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      4ee437fb
  8. 30 9月, 2016 1 次提交
  9. 21 9月, 2016 2 次提交
  10. 30 6月, 2016 1 次提交
    • A
      ASoC: fsl_ssi: Fix number of words per frame for I2S-slave mode · 4f14f5c1
      Alexander Shiyan 提交于
      The i.MX51 datasheet says:
      Chapter 56.1.2.4 I2S Mode
      ...
      When I2S modes are entered (I2S master (01) or I2S slave (10)),
      the following settings are recommended:
      ...
      - TX Frame Rate should be 2 i.e. (STCCR[12:8] = 1)
      - RX Frame Rate should be 2 i.e. (SRCCR[12:8] = 1)
      
      Chapter 56.3.3.12 SSI Transmit and Receive Clock Control Registers (STCCR & SRCCR)
      ...
      Bits 12-8 DC4-DC0
      Frame Rate Divider Control. These bits are used to control the divide ratio
      for the programmable frame rate dividers. The divide ratio works on the word
      clock. In Normal mode, this ratio determines the word transfer rate.
      In Network mode, this ratio sets the number of words per frame. The divide
      ratio ranges from 1 to 32 in Normal mode and from 2 to 32 in Network mode.
      In Normal mode, a divide ratio of 1 (DC=00000) provides continuous periodic
      data word transfer. A bit-length frame sync must be used in this case.
      
      Function fsl_ssi_hw_params() setup Normal mode for MONO output,
      so with DC=0, SSI enters to continuous periodic data word transfer.
      To fix this, setup DC for any I2S mode.
      Patch has tested on custom board based on Digi CCMX-51 module (i.MX51).
      Signed-off-by: NAlexander Shiyan <shc_work@mail.ru>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      4f14f5c1
  11. 13 5月, 2016 6 次提交
  12. 29 4月, 2016 1 次提交
  13. 22 2月, 2016 2 次提交
  14. 25 1月, 2016 1 次提交
  15. 10 1月, 2016 2 次提交
  16. 25 11月, 2015 1 次提交
  17. 16 11月, 2015 1 次提交
  18. 06 10月, 2015 1 次提交
  19. 20 9月, 2015 1 次提交
  20. 15 8月, 2015 2 次提交