1. 13 8月, 2013 1 次提交
  2. 06 8月, 2013 1 次提交
    • R
      ASoC: avoid duplicated DAI routes · 19c2c5f5
      Russell King 提交于
      ASoC automatically creates snd_soc_dapm_dai_in and snd_soc_dapm_dai_out
      widgets for DAI drivers, and adds them to the list.  Later on, ASoC
      creates automatic routes between these widgets and a widget with a
      stream name.
      
      We look for a snd_soc_dapm_dai_in or snd_soc_dapm_dai_out widget, and
      use this to obtain the DAI structure.  We then scan all widgets for
      any with a stream name refering to either the capture or the playback
      stream, and create routes.
      
      If you have both a snd_soc_dapm_dai_in and a snd_soc_dapm_dai_out
      referring to the same DAI structure, this ends up creating one set of
      routes for the DAI for the snd_soc_dapm_dai_in widget, and a duplicated
      set of routes for the snd_soc_dapm_dai_out widget.
      
      Fix this by checking that the stream name for the widget matches the
      DAI widget name.
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      19c2c5f5
  3. 05 8月, 2013 1 次提交
    • L
      ASoC: dapm: Implement mixer input auto-disable · 57295073
      Lars-Peter Clausen 提交于
      Some devices have the problem that if a internal audio signal source is disabled
      the output of the source becomes undefined or goes to a undesired state (E.g.
      DAC output goes to ground instead of VMID). In this case it is necessary, in
      order to avoid unwanted clicks and pops, to disable any mixer input the signal
      feeds into or to active a mute control along the path to the output. Often it is
      still desirable to expose the same mixer input control to userspace, so cerain
      paths can sill be disabled manually. This means we can not use conventional DAPM
      to manage the mixer input control. This patch implements a method for letting
      DAPM overwrite the state of a userspace visible control. I.e. DAPM will disable
      the control if the path on which the control sits becomes inactive. Userspace
      will then only see a cached copy of the controls state. Once DAPM powers the
      path up again it will sync the userspace setting with the hardware and give
      control back to userspace.
      
      To implement this a new widget type is introduced. One widget of this type will
      be created for each DAPM kcontrol which has the auto-disable feature enabled.
      For each path that is controlled by the kcontrol the widget will be connected to
      the source of that path. The new widget type behaves like a supply widget,
      which means it will power up if one of its sinks are powered up and will only
      power down if all of its sinks are powered down. In order to only have the mixer
      input enabled when the source signal is valid the new widget type will be
      disabled before all other widget types and only be enabled after all other
      widget types.
      
      E.g. consider the following simplified example. A DAC is connected to a mixer
      and the mixer has a control to enable or disable the signal from the DAC.
      
                           +-------+
        +-----+            |       |
        | DAC |-----[Ctrl]-| Mixer |
        +-----+       :    |       |
           |          :    +-------+
           |          :
          +-------------+
          | Ctrl widget |
          +-------------+
      
      If the control has the auto-disable feature enabled we'll create a widget for
      the control. This widget is connected to the DAC as it is the source for the
      mixer input. If the DAC powers up the control widget powers up and if the DAC
      powers down the control widget is powered down. As long as the control widget
      is powered down the hardware input control is kept disabled and if it is enabled
      userspace can freely change the control's state.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      57295073
  4. 02 8月, 2013 2 次提交
  5. 01 8月, 2013 1 次提交
  6. 31 7月, 2013 1 次提交
  7. 30 7月, 2013 9 次提交
  8. 24 7月, 2013 5 次提交
    • L
      ASoC: dapm: Add a update parameter to snd_soc_dapm_{mux,mixer}_update_power · 6b3fc03b
      Lars-Peter Clausen 提交于
      In order to avoid race conditions the assignment of dapm->update should happen
      while card->dapm_mutex is being held. To allow CODEC drivers to run a register
      update when using snd_soc_dapm_mux_update_power() or
      snd_soc_dapm_mixer_update_power() add a update parameter to these two functions.
      The update parameter will be assigned to dapm->update while card->dapm_mutex is
      locked.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      6b3fc03b
    • L
      ASoC: dapm: Run widget updates for shared controls at the same time · ce6cfaf1
      Lars-Peter Clausen 提交于
      Currently when updating a control that is shared between multiple widgets the
      whole power-up/power-down sequence is being run once for each widget. The
      control register is updated during the first run, which means the CODEC internal
      routing is also updated for all widgets during this first run. The input and
      output paths for each widgets are only updated though during the respective run
      for that widget. This leads to a slight inconsistency between the CODEC's
      internal state and ASoC's state, which causes non optimal behavior in regard to
      click and pop avoidance.
      
      E.g. consider the following setup where two MUXs share the same control.
      
                +------+
       A1 ------|      |
                | MUX1 |----- C1
       B1 ------|      |
                +------+
                   |
        control ---+
                   |
                +------+
       A2 ------|      |
                | MUX2 |----- C2
       B2 ------|      |
                +------+
      
      If the control is updated to switch the MUXs from input A to input B with the
      current code the power-up/power-down sequence will look like this:
      
      Run soc_dapm_mux_update_power for MUX1
        Power-down A1
        Update MUXing
        Power-up B1
      
      Run soc_dapm_mux_update_power for MUX2
        Power-down A2
        (Update MUXing)
        Power-up B2
      
      Note that the second 'Update Muxing' is a no-op, since the register was already
      updated.
      
      While the preferred order for avoiding pops and clicks should be:
      
      Run soc_dapm_mux_update_power for control
        Power-down A1
        Power-down A2
        Update MUXing
        Power-up B1
        Power-up B2
      
      This patch changes the behavior to the later by running the updates for all
      widgets that the control is attached to at the same time.
      
      The new code is also a bit simpler since callers of
      soc_dapm_{mux,muxer}_update_power don't have to loop over each widget anymore
      and neither do we need to keep track for which of the kcontrol's widgets the
      current update is.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      ce6cfaf1
    • L
      ASoC: dapm: Pass snd_soc_card directly to soc_dpcm_runtime_update() · c3f48ae6
      Lars-Peter Clausen 提交于
      soc_dpcm_runtime_update() operates on a ASoC card as a whole. Currently it takes
      a snd_soc_dapm_widget as its only parameter though. The widget is then used to
      look up the card and is otherwise unused. This patch changes the function to
      take a pointer to the card directly. This makes it possible to to call
      soc_dpcm_runtime_update() for updates which are not related to one specific
      widget.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      c3f48ae6
    • M
      ASoC: dapm: Use generic power check for everything except DAIs · 63c69a6e
      Mark Brown 提交于
      As noticed by Lars-Peter Clausen since the move to using widgets to hook
      into the DAIs we no longer directly manage the power of AIF or DAC/ADC
      widgets from the stream integration so they can just use the generic power
      checks instead of the custom stream integration ones they currently do.
      Signed-off-by: NMark Brown <broonie@linaro.org>
      63c69a6e
    • L
      ASoC: dapm: Fix return value of snd_soc_dapm_put_{volsw,enum_virt}() · 56a67834
      Lars-Peter Clausen 提交于
      The ALSA core expect the put callback of a control to return 1 if the value of
      the control changed and 0 if it did not. Both snd_soc_dapm_put_volsw() and
      snd_soc_dapm_put_enum_virt() currently always returns 0. For both functions we
      already have a 'change' variable which either contains 1 or 0 depending on
      whether the value has changed or not, so just return that.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      56a67834
  9. 23 7月, 2013 1 次提交
  10. 14 6月, 2013 5 次提交
  11. 07 6月, 2013 1 次提交
  12. 23 5月, 2013 1 次提交
  13. 14 5月, 2013 1 次提交
  14. 13 5月, 2013 1 次提交
  15. 01 5月, 2013 1 次提交
  16. 02 4月, 2013 2 次提交
  17. 31 3月, 2013 1 次提交
    • S
      ASoC: dapm: Implement mixer control sharing · 85762e71
      Stephen Warren 提交于
      This is the equivalent of commit af46800b "ASoC: Implement mux control
      sharing", but applied to mixers instead of muxes.
      
      This allows a single control to affect multiple mixer widgets at once,
      which is useful when there is a single set of register bits that affects
      multiple mixers in HW, for example both the L and R mixers of a stereo
      path.
      
      Without this, you either:
      
      1) End up with multiple controls that affect the same register bits, but
      whose DAPM state falls out of sync with HW, since the DAPM state is only
      updated for the specific control that is modified, and not for other
      paths that are affected by the register bit(s).
      
      2) False paths through DAPM, since you end up merging unconnected stereo
      paths together into a single widget which hosts the single control, and
      then branching back out again, thus conjoining the enable states of the
      two input paths.
      
      Now that the kcontrol creation logic is split out into a separate
      function, dapm_create_or_share_mixmux_kcontrol(), also use that to
      replace most of the body of dapm_new_mux(). This should produce no
      functional change, but simply eliminates some mostly duplicated code.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      85762e71
  18. 15 3月, 2013 1 次提交
  19. 08 3月, 2013 1 次提交
  20. 25 2月, 2013 1 次提交
    • M
      ASoC: dapm: Fix handling of loops · 8af294b4
      Mark Brown 提交于
      Currently if a path loops back on itself we correctly skip over it to
      avoid going into an infinite loop but this causes us to ignore the need
      to power up the path as we don't count the loop for the purposes of
      counting inputs and outputs. This means that internal loopbacks within a
      device that have powered devices on them won't be powered up.
      
      Fix this by treating any path that is currently in the process of being
      recursed as having a single input or output so that it is counted for
      the purposes of power decisions.
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      Acked-by: NLiam Girdwood <liam.r.girdwood@linux.intel.com>
      8af294b4
  21. 08 2月, 2013 1 次提交
    • M
      ASoC: core: Allow digital mute for capture · da18396f
      Mark Brown 提交于
      Help avoid noise from the power up of the capture path propagating through
      into the start of the recording (especially noise caused by the ramp of
      microphone biases) by keeping the capture muted until after we've finished
      powering things up with DAPM in the same manner we do for playback. This
      allows us to take advantage of soft mute support in the hardware more
      effectively and is more consistent.
      
      The core code using the existing digital mute operation is updated to take
      advantage of this. Some additional cases in the soc-pcm code and suspend
      will need separate handling but these are less practically relevant than
      the main runtime stream start/stop case.
      
      Rather than refactor the digital mute function in every single driver a
      new operation is added for drivers taking advantage of this functionality,
      the old operation should be phased out over time.
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      Acked-by Vinod Koul <vinod.koul@intel.com>
      Acked-by: NLiam Girdwood <liam.r.girdwood@linux.intel.com>
      da18396f
  22. 12 1月, 2013 1 次提交