1. 19 12月, 2017 3 次提交
  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. 15 11月, 2017 1 次提交
  5. 11 11月, 2017 7 次提交
    • M
      ASoC: bcm2835: Support left/right justified and DSP modes · abd4f0e1
      Matthias Reichl 提交于
      DSP modes and left/right justified modes can be supported
      on bcm2835 by configuring the frame sync polarity and
      frame sync length registers and by adjusting the
      channel data position registers.
      
      Clock and frame sync polarity handling in hw_params has
      been refactored to make the interaction between logical
      rising/falling edge frame start and physical configuration
      (changed by normal/inverted polarity modes) clearer.
      
      Modes where the first active data bit is transmitted immediately
      after frame start (eg DSP mode B with slot 0 active)
      only work reliable if bcm2835 is configured as frame master.
      In frame slave mode channel swap (or shift, this isn't quite
      clear yet) can occur.
      
      Currently the driver only warns if an unstable configuration
      is detected but doensn't prevent using them.
      Signed-off-by: NMatthias Reichl <hias@horus.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      abd4f0e1
    • M
      ASoC: bcm2835: Enforce full symmetry · 3d2b3c70
      Matthias Reichl 提交于
      bcm2835's configuration registers can't be changed when a stream
      is running, which means asymmetric configurations aren't supported.
      
      Channel and rate symmetry are already enforced by constraints
      but samplebits had been missed.
      
      As hw_params doesn't check for symmetry constraints by itself
      and just returns success if a stream is running this led to
      situations where asymmetric configurations were seeming to
      succeed but of course didn't work because the hardware wasn't
      configured at all.
      
      Fix this by adding the missing samplerate symmetry constraint.
      Signed-off-by: NMatthias Reichl <hias@horus.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      3d2b3c70
    • M
      ASoC: bcm2835: Support additional samplerates up to 384kHz · 675c0ee5
      Matthias Reichl 提交于
      Sample rates are only restricted by the capabilities of the
      clock driver, so use SNDRV_PCM_RATE_CONTINUOUS instead of
      SNDRV_PCM_RATE_8000_192000.
      
      Tests (eg with pcm5122) have shown that bcm2835 works fine
      in 384kHz/32bit stereo mode, so change the maximum allowed
      rate from 192kHz to 384kHz.
      Signed-off-by: NMatthias Reichl <hias@horus.com>
      Reviewed-by: NEric Anholt <eric@anholt.net>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      675c0ee5
    • M
      ASoC: bcm2835: Add support for TDM modes · 9448572d
      Matthias Reichl 提交于
      bcm2835 supports arbitrary positioning of channel data within
      a frame and thus is capable of supporting TDM modes. Since
      the driver is limited to 2-channel operations only TDM setups
      with exactly 2 active slots are supported.
      
      Logical TDM slot numbering follows the usual convention:
      
      For I2S-like modes, with a 50% duty-cycle frame clock,
      slots 0, 2, ... are transmitted in the first half of a frame,
      slots 1, 3, ... are transmitted in the second half.
      
      For DSP modes slot numbering is ascending: 0, 1, 2, 3, ...
      
      Channel position calculation has been refactored to use
      TDM info and moved out of hw_params.
      
      set_tdm_slot, set_bclk_ratio and hw_params now check more
      strictly if the configuration is valid. Illegal configurations
      like odd number of slots in I2S mode, data lengths exceeding
      slot width or frame sizes larger than the hardware limit of
      1024 are rejected. Also hw_params now properly checks for
      errors from clk_set_rate.
      
      Allowed PCM formats are already guarded by stream constraints,
      thus the formats check in hw_params has been removed and
      data_length is now retrieved via params_width().
      
      Also standard functions like snd_soc_params_to_bclk are now
      being used instead of manual calculations to make the code
      more readable.
      
      Special care has been taken to ensure that set_bclk_ratio works
      as before. The bclk ratio is mapped to a 2-channel TDM config
      with a slot width of half the ratio. In order to support odd ratios,
      which can't be expressed via a TDM config, the ratio (frame length)
      is stored and used by hw_params.
      Signed-off-by: NMatthias Reichl <hias@horus.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      9448572d
    • O
      ASoC: add mclk-fs support to audio graph card · 757652dd
      Olivier Moysan 提交于
      Add mclk-fs support to audio graph card
      as it was previously implemented in simple card.
      Signed-off-by: NOlivier Moysan <olivier.moysan@st.com>
      Acked-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      757652dd
    • A
      ASoC: rt5514: work around link error · c5630877
      Arnd Bergmann 提交于
      The main rt5514 driver optionally calls into the SPI back-end to load
      the firmware. This causes a link error when one driver selects rt5514
      as built-in and another driver selects rt5514-spi as a loadable module:
      
      sound/soc/codecs/rt5514.o: In function `rt5514_dsp_voice_wake_up_put':
      rt5514.c:(.text+0xac8): undefined reference to `rt5514_spi_burst_write'
      
      As a workaround, this adds another silent symbol, to force rt5514-spi
      to be built-in for that configuration. I'm not overly happy with
      that solution, but couldn't come up with anything better. Using
      'IS_REACHABLE()' would break the case that relies on the loadable
      module, and all other ideas would result in more complexity.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      c5630877
    • A
      ASoC: rt5514: mark PM functions as __maybe_unused · 7e6358ec
      Arnd Bergmann 提交于
      The new functions are only used when CONFIG_PM is enabled,
      leading to a harmless warning:
      
      sound/soc/codecs/rt5514-spi.c:474:12: error: 'rt5514_resume' defined but not used [-Werror=unused-function]
      sound/soc/codecs/rt5514-spi.c:464:12: error: 'rt5514_suspend' defined but not used [-Werror=unused-function]
      
      This marks them as __maybe_unused to make the build silent
      again.
      
      Fixes: 58f1c07d ("ASoC: rt5514: Voice wakeup support.")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      7e6358ec
  6. 10 11月, 2017 3 次提交
  7. 09 11月, 2017 20 次提交