1. 05 12月, 2014 1 次提交
  2. 25 11月, 2014 4 次提交
    • J
      ASoC: tlv320aic31xx: Fix off by one error in the loop stucture. · bbc686b3
      Jyri Sarha 提交于
      Fix off by one read beyond the end of a table.
      Reported-by: NDavid Binderman <dcb314@hotmail.com>
      Signed-off-by: NJyri Sarha <jsarha@ti.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      Cc: stable@vger.kernel.org
      bbc686b3
    • J
      ASoC: max98090: Fix right sidetone connection · 418382f2
      Jarkko Nikula 提交于
      It is right not left sidetone which goes to "DACR".
      Signed-off-by: NJarkko Nikula <jarkko.nikula@linux.intel.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      418382f2
    • J
      ASoC: max98090: Fix ill-defined sidetone route · 48826ee5
      Jarkko Nikula 提交于
      Commit 5fe5b767 ("ASoC: dapm: Do not pretend to support controls for non
      mixer/mux widgets") revealed ill-defined control in a route between
      "STENL Mux" and DACs in max98090.c:
      
      max98090 i2c-193C9890:00: Control not supported for path STENL Mux -> [NULL] -> DACL
      max98090 i2c-193C9890:00: ASoC: no dapm match for STENL Mux --> NULL --> DACL
      max98090 i2c-193C9890:00: ASoC: Failed to add route STENL Mux -> NULL -> DACL
      max98090 i2c-193C9890:00: Control not supported for path STENL Mux -> [NULL] -> DACR
      max98090 i2c-193C9890:00: ASoC: no dapm match for STENL Mux --> NULL --> DACR
      max98090 i2c-193C9890:00: ASoC: Failed to add route STENL Mux -> NULL -> DACR
      
      Since there is no control between "STENL Mux" and DACs the control name must
      be NULL not "NULL".
      Signed-off-by: NJarkko Nikula <jarkko.nikula@linux.intel.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      Cc: stable@vger.kernel.org
      48826ee5
    • J
      ASoC: max98090: Fix digital microphone · 4cf703a7
      Jarkko Nikula 提交于
      Commit e409dfbf ("ASoC: dapm: Add a few supply widget sanity checks")
      broke digital microphone support in max98090.c:
      
      max98090 i2c-193C9890:00: Conditional paths are not supported for supply widgets (DMICL_ENA -> [DMIC] -> DMIC Mux)
      max98090 i2c-193C9890:00: ASoC: no dapm match for DMICL_ENA --> DMIC --> DMIC Mux
      max98090 i2c-193C9890:00: ASoC: Failed to add route DMICL_ENA -> DMIC -> DMIC Mux
      max98090 i2c-193C9890:00: Conditional paths are not supported for supply widgets (DMICR_ENA -> [DMIC] -> DMIC Mux)
      max98090 i2c-193C9890:00: ASoC: no dapm match for DMICR_ENA --> DMIC --> DMIC Mux
      max98090 i2c-193C9890:00: ASoC: Failed to add route DMICR_ENA -> DMIC -> DMIC Mux
      
      Problem is partially caused by commit f69e3caa ("ASoC: max98090: Enable
      both DMIC channels also when using mono configuration") which connects
      "DMICL_ENA" and "DMICR_ENA" supply widgets to "DMIC Mux".
      
      Fix the breakage by reverting f69e3caa and then by adding additional
      "DMICR_ENA" to "DMICL" and "DMICL_ENA" to "DMICR" cross-connections. This
      disconnects these supply widgets from the mux and makes sure that both DMIC
      data channels are still enabled together.
      Signed-off-by: NJarkko Nikula <jarkko.nikula@linux.intel.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      4cf703a7
  3. 20 11月, 2014 1 次提交
  4. 19 11月, 2014 1 次提交
  5. 17 11月, 2014 1 次提交
  6. 14 11月, 2014 1 次提交
    • F
      ASoC: sgtl5000: Fix SMALL_POP bit definition · c251ea7b
      Fabio Estevam 提交于
      On a mx28evk with a sgtl5000 codec we notice a loud 'click' sound  to happen
      5 seconds after the end of a playback.
      
      The SMALL_POP bit should fix this, but its definition is incorrect:
      according to the sgtl5000 manual it is bit 0 of CHIP_REF_CTRL register, not
      bit 1.
      
      Fix the definition accordingly and enable the bit as intended per the code
      comment.
      
      After applying this change, no loud 'click' sound is heard after playback
      Signed-off-by: NFabio Estevam <fabio.estevam@freescale.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      Cc: stable@vger.kernel.org
      c251ea7b
  7. 12 11月, 2014 1 次提交
  8. 10 11月, 2014 3 次提交
  9. 09 11月, 2014 2 次提交
  10. 06 11月, 2014 3 次提交
  11. 05 11月, 2014 2 次提交
    • D
      ASoC: max98090: Correct pclk divisor settings · ece509c1
      Dylan Reid 提交于
      The Baytrail-based chromebooks have a 20MHz mclk, the code was setting
      the divisor incorrectly in this case.  According to the 98090
      datasheet, the divisor should be set to DIV1 for 10 <= mclk <= 20.
      Correct this and the surrounding clock ranges as well to match the
      datasheet.
      Signed-off-by: NDylan Reid <dgreid@chromium.org>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      ece509c1
    • T
      ASoC: dpcm: Fix race between FE/BE updates and trigger · ea9d0d77
      Takashi Iwai 提交于
      DPCM can update the FE/BE connection states totally asynchronously
      from the FE's PCM state.  Most of FE/BE state changes are protected by
      mutex, so that they won't race, but there are still some actions that
      are uncovered.  For example, suppose to switch a BE while a FE's
      stream is running.  This would call soc_dpcm_runtime_update(), which
      sets FE's runtime_update flag, then sets up and starts BEs, and clears
      FE's runtime_update flag again.
      
      When a device emits XRUN during this operation, the PCM core triggers
      snd_pcm_stop(XRUN).  Since the trigger action is an atomic ops, this
      isn't blocked by the mutex, thus it kicks off DPCM's trigger action.
      It eventually updates and clears FE's runtime_update flag while
      soc_dpcm_runtime_update() is running concurrently, and it results in
      confusion.
      
      Usually, for avoiding such a race, we take a lock.  There is a PCM
      stream lock for that purpose.  However, as already mentioned, the
      trigger action is atomic, and we can't take the lock for the whole
      soc_dpcm_runtime_update() or other operations that include the lengthy
      jobs like hw_params or prepare.
      
      This patch provides an alternative solution.  This adds a way to defer
      the conflicting trigger callback to be executed at the end of FE/BE
      state changes.  For doing it, two things are introduced:
      
      - Each runtime_update state change of FEs is protected via PCM stream
        lock.
      - The FE's trigger callback checks the runtime_update flag.  If it's
        not set, the trigger action is executed there.  If set, mark the
        pending trigger action and returns immediately.
      - At the exit of runtime_update state change, it checks whether the
        pending trigger is present.  If yes, it executes the trigger action
        at this point.
      Reported-and-tested-by: NQiao Zhou <zhouqiao@marvell.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      Acked-by: NLiam Girdwood <liam.r.girdwood@linux.intel.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      Cc: stable@vger.kernel.org
      ea9d0d77
  12. 04 11月, 2014 2 次提交
  13. 03 11月, 2014 2 次提交
  14. 30 10月, 2014 1 次提交
    • L
      ASoC: Fix snd_soc_find_dai() matching component by name · 1ffae361
      Lars-Peter Clausen 提交于
      Commit 14621c7e ("ASoC: Consolidate CPU and CODEC DAI lookup")
      consolidated the lookup of CPU DAIs and CODEC DAIs into a single function.
      When matching a component by name for CODEC DAIs the code previous to the
      patch compared the name in the DAI link table with component->name. For CPU
      DAIs the code compared to dev_name(component->dev). The newly introduced
      function ended up using the later as well.
      
      For most components dev_name(component->dev) and component->name are the
      same. The main notable exception are I2C devices where the driver name and
      the device name are concatenated to form the component name. By using
      dev_name(component->dev) instead of component->name the patch broke the
      matching of I2C CODECs by name.
      
      This patch restores the original behavior by using component->name instead
      of dev_name(component->dev). This will be safe even for CPU DAIs since for
      CPU DAIs both are the same.
      
      Fixes: 14621c7e ("ASoC: Consolidate CPU and CODEC DAI lookup")
      Reported-by: NDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      1ffae361
  15. 29 10月, 2014 8 次提交
  16. 28 10月, 2014 7 次提交
    • A
      ASoC: es8328-i2c: Fix i2c_device_id name field in es8328_id · b2a9a3b8
      Axel Lin 提交于
      The convention for i2c_device_id name does not need to have company prefix.
      Signed-off-by: NAxel Lin <axel.lin@ingics.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      b2a9a3b8
    • L
      ASoC: Use generic control handlers for S8 control · c1b4d1c7
      Lars-Peter Clausen 提交于
      Commit f227b88f ("ASoC: core: Add signed register volume control logic")
      added support for signed control to the generic volsw control handler.
      This makes it possible to use them for the S8 control as well, rather than
      having to use a custom control handler implementation.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      c1b4d1c7
    • L
      ASoC: dapm: Use more aggressive caching · 92a99ea4
      Lars-Peter Clausen 提交于
      Currently we cache the number of input and output paths going to/from a
      widget only within a power update sequence. But not in between power update
      sequences.
      
      But we know how changes to the DAPM graph affect the number of input (form a
      source) and output (to a sink) paths of a widget and only need to
      recalculate them if a operation has been performed that might have changed
      them.
      	* Adding/removing or connecting/disconnecting a path means that the for
      	  the source of the path the number of output paths can change and for
      	  the sink the number of input paths can change.
      	* Connecting/disconnecting a widget has the same effect has connecting/
      	  disconnecting all paths of the widget. So for the widget itself the
      	  number of inputs and outputs can change, for all sinks of the widget
      	  the number of inputs can change and for all sources of the widget the
      	  number of outputs can change.
      	* Activating/Deactivating a stream can either change the number of
      	  outputs on the sources of the widget associated with the stream or the
      	  number of inputs on the sinks.
      
      Instead of always invalidating all cached numbers of input and output paths
      for each power up or down sequence this patch restructures the code to only
      invalidate the cached numbers when a operation that might change them has
      been performed. This can greatly reduce the number of DAPM power checks for
      some very common operations.
      
      Since per DAPM operation typically only either change the number of inputs
      or outputs the number of path checks is reduced by at least 50%. The number
      of neighbor checks is also reduced about the same percentage, but since the
      number of neighbors encountered when walking from sink to source is not the
      same as when walking from source to sink the actual numbers will slightly
      vary from card to card (e.g. for a mixer we see 1 neighbor when walking from
      source to sink, but the number of inputs neighbors when walking from source
      to sink).
      
      Bigger improvements can be observed for widgets with multiple connected
      inputs and output (e.g. mixers probably being the most widespread form of
      this). Previously we had to re-calculate the number of inputs and outputs
      on all input and output paths. With this change we only have to re-calculate
      the number of outputs on the input path that got changed and the number of
      inputs on the output paths.
      
      E.g. imagine the following example:
      
      	A --> B ----.
      	            v
      	M --> N --> Z <-- S <-- R
      	            |
      	            v
      	            X
      
      Widget Z has multiple input paths, if any change was made that cause Z to be
      marked as dirty the power state of Z has to be re-computed. This requires to
      know the number of inputs and outputs of Z, which requires to know the
      number of inputs and outputs of all widgets on all paths from or to Z.
      Previously this meant re-computing all inputs and outputs of all the path
      going into or out of Z. With this patch in place only paths that actually
      have changed need to be re-computed.
      
      If the system is idle (or the part of the system affected by the changed
      path) the number of path checks drops to either 0 or 1, regardless of how
      large or complex the DAPM context is. 0 if there is no connected sink and no
      connected source. 1 if there is either a connected source or sink, but not
      both. The number of neighbor checks again will scale accordingly and will be
      a constant number that is the number of inputs or outputs of the widget for
      which we did the path check.
      
      When loading a state file or switching between different profiles typically
      multiple mixer and mux settings are changed, so we see the benefit of this
      patch multiplied for these kinds of operations.
      
      Testing with the ADAU1761 shows the following changes in DAPM stats for
      changing a single Mixer switch for a Mixer with 5 inputs while the DAPM
      context is idle.
      
               Power  Path  Neighbour
      Before:  2      12    30
      After:   2       1     2
      
      For the same switch, but with a active playback stream the stat changed are
      as follows.
      
               Power  Path  Neighbour
      Before:  10     20    54
      After:   10      7    21
      
      Cumulative numbers for switching the audio profile which changes 7 controls
      while the system is idle:
      
               Power  Path  Neighbour
      Before:  16      80   170
      After:   16       7    23
      
      Cumulative numbers for switching the audio profile which changes 7 controls
      while playback is active:
      
               Power  Path  Neighbour
      Before:  51     123   273
      After:   51      29   109
      
      Starting (or stopping) the playback stream:
      
               Power  Path  Neighbour
      Before:  34     34    117
      After:   34     17    69
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      92a99ea4
    • L
      ASoC: dapm: Add a few supply widget sanity checks · e409dfbf
      Lars-Peter Clausen 提交于
      Supply widgets are somewhat special and not all kinds of paths to or from
      supply widgets make sense. This patch adds a few sanity checks that errors
      out during the path instantiation for those invalid paths. This will prevent
      drivers to depend on weird behavior resulting from such paths as well as
      will allow the DAPM algorithms to assume that they never see such paths.
      
      This patch adds checks for the following three invalid types of paths:
      	* A path with a non-supply widget as a source connected to a supply
      	  widget as a sink. Such a path has no effect on either of the two
      	  connected widgets.
      	* Paths with a connected() callback that have a non-supply widget as the
      	  source. The DAPM algorithm only uses the conneceted() callback for
      	  supply widget power checks. And since it prevents caching of the DAPM
      	  state there is no intention to make it more generic as it has
      	  negative performance implications.
      	* Paths which connect a supply to a mixer or mux via a control. Controls
      	  are only meant to affect the routing of audio data.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      e409dfbf
    • L
      ASoC: dapm: Mark endpoints instead of IO widgets dirty during suspend/resume · 8be4da29
      Lars-Peter Clausen 提交于
      The state of endpoint widgets is affected by that card's power state.
      Endpoint widgets that do no have the ignore_suspend flag set will be
      considered inactive during suspend. So they have to be re-checked and marked
      dirty after the card's power state changes. Currently the input and output
      widgets are marked dirty instead, this works most of the time since
      typically a path from one endpoint to another will go via a input or output
      widget. But marking the endpoints dirty is technically more correct and will
      also work for odd corner cases.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      8be4da29
    • L
      ASoC: dapm: Add a flag to mark paths connected to supply widgets · c1862c8b
      Lars-Peter Clausen 提交于
      Supply widgets do not count towards the input and output widgets of their
      neighbors and for supply widgets themselves we do not care for the number
      of input or output paths. This means that a path that connects to a supply
      widget effectively behaves the same as a path that as the weak property set.
      This patch adds a new path flag that gets set to true when the path is
      connected to at least one supply widget. If a path with the flag set is
      encountered in is_connected_{input,output}_ep() is is skipped in the same
      way that weak paths are skipped. This slightly brings down the number of
      path checks.
      
      Since both the weak and the supply flag are implemented as bitfields which
      are stored in the same word there is no runtime overhead due to checking
      both rather than just one and also the size of the path struct is not
      increased by this patch. Another advantage is that we do not have to handle
      supply widgets in is_connected_{input,output}_ep() anymore since it will
      never be called for supply widgets. The only exception is from
      dapm_widget_power_read_file() where a check is added to special case supply
      widgets.
      
      Testing with the ADAU1761, which has a handful of supply widgets, shows the
      following changes in the DAPM stats for a playback stream start.
      
               Power  Path  Neighbour
      Before:  34     78    117
      After:   34     48    117
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      c1862c8b
    • L
      ASoC: dapm: Introduce toplevel widget categories · 6dd98b0a
      Lars-Peter Clausen 提交于
      DAPM widgets can be classified into four categories:
      	* supply: Supply widgets do not affect the power state of their
      		non-supply widget neighbors and unlike other widgets a
      		supply widget is not powered up when it is on an active
      		path, but when at least on of its neighbors is powered up.
      	* source: A source is a widget that receives data from outside the
      		DAPM graph or generates data. This can for example be a
      		microphone, the playback DMA or a signal generator. A source
      		widget will be considered powered up if there is an active
      		path to a sink widget.
      	* sink: A sink is a widget that transmits data to somewhere outside
      		of the DAPM graph. This can e.g. be a speaker or the capture
      		DMA. A sink widget will be considered powered up if there is
      		an active path from a source widget.
      	* normal: Normal widgets are widgets not covered by the categories
      		above. A normal widget will be considered powered up if it
      		is on an active path between a source widget and a sink
      		widget.
      
      The way the number of input and output paths for a widget is calculated
      depends on its category. There are a bunch of factors which decide which
      category a widget is. Currently there is no formal classification of these
      categories and we calculate the category of the widget based on these
      factors whenever we want to know it. This is at least once for every widget
      during each power update sequence. The factors which determine the category
      of the widgets are mostly static though and if at all change rather seldom.
      This patch introduces three new per widget flags, one for each of non-normal
      widgets categories. Instead of re-computing the category each time we want
      to know them the flags will be checked. For the majority of widgets the
      category is solely determined by the widget id, which means it never changes
      and only has to be set once when the widget is created. The only widgets
      with dynamic categories are:
      
      	snd_soc_dapm_dai_out: Is considered a sink iff the capture stream is
      		active, otherwise normal.
      	snd_soc_dapm_dai_in: Is considered a source iff the playback stream
      		is active, otherwise normal.
      	snd_soc_dapm_input: Is considered a sink iff it has no outgoing
      		paths, otherwise normal.
      	snd_soc_dapm_output: Is considered a source iff it has no incoming
      		paths, otherwise normal.
      	snd_soc_dapm_line: Is considered a sink iff it has no outgoing paths
      		and is considered a source iff it has no incoming paths,
      		otherwise normal.
      
      For snd_soc_dapm_dai_out/snd_soc_dapm_dai_in widgets the category will be
      updated when a stream is started or stopped. For the other dynamic widgets
      the category will be updated when a path connecting to it is added or
      removed.
      
      Introducing those new widget categories allows to make
      is_connected_{output,input}_ep, which are among the hottest paths of the
      DAPM algorithm, more generic and significantly shorter.
      
      The before and after sizes for is_connected_{output,input}_ep are:
      
      On ARM (defconfig + CONFIG_SND_SOC):
      	function                                     old     new   delta
      	is_connected_output_ep                       480     340    -140
      	is_connected_input_ep                        456     352    -104
      
      On amd64 (defconfig + CONFIG_SND_SOC):
      	function                                     old     new   delta
      	is_connected_output_ep                       579     427    -152
      	is_connected_input_ep                        563     427    -136
      
      Which is about a 25%-30% decrease, other architectures are expected to have
      similar numbers. At the same time the size of the snd_soc_dapm_widget struct
      does not change since the new flags are stored in the same word as the
      existing flags.
      
      Note: that since the per widget 'ext' flag was only used to decide whether a
      snd_soc_dapm_input or snd_soc_dapm_output widget was a source or a sink it
      is now unused and can be removed.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      6dd98b0a