Commit Graph

353 Commits

Author SHA1 Message Date
Mark Brown 59a3aed73b Merge remote-tracking branch 'asoc/topic/dapm' into tmp 2013-09-01 21:15:50 +01:00
Lars-Peter Clausen 2daabd7848 ASoC: dapm: Fix auto-disable for inverted controls
We need to make sure that the control's cached value is initialized to the same
value as the control's widget->on_val. Otherwise updates might be lost.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-30 16:41:06 +01:00
Lars-Peter Clausen 824ef826f3 ASoC: Pass card instead of dapm context to snd_soc_dapm_new_widgets()
snd_soc_dapm_new_widgets() works on the ASoC card as a whole not on a specific
DAPM context. The DAPM context that is passed as the parameter is only used to
look up the pointer to the card. This patch updates the signature of
snd_soc_dapm_new_widgets() to take the card directly.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-27 15:41:16 +01:00
Lars-Peter Clausen 34742cb02b ASoC: dapm: Fix marking widgets dirty when a route is added
The current calls to dapm_mark_dirty() in snd_soc_dapm_add_path() are on a path
that is only reached if the sink widget is either a mixer or a mux. Move the
calls further up so they are called for all widget types.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-27 15:32:49 +01:00
Mark Brown 69c2d346e8 ASoC: dapm: Ensure kcontrol list is initialised
Ensure that the recently added path kcontrol list is initialised otherwise
we may crash trying to delete routes that don't have kcontrols.

Signed-off-by: Mark Brown <broonie@linaro.org>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2013-08-13 10:19:59 +01:00
Mark Brown 946d92a100 ASoC: dapm: Don't create routes when creating kcontrols
Attempting to create the route as part of adding a mux control causes us
to attempt to add the same route twice since we loop over all sources
for the mux after creating the control. Instead do the addition in the
callers.

Signed-off-by: Mark Brown <broonie@linaro.org>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2013-08-13 10:19:57 +01:00
Mark Brown f2e537425a Merge remote-tracking branch 'asoc/fix/dapm' into asoc-dapm 2013-08-13 10:19:52 +01:00
Russell King 19c2c5f55e ASoC: avoid duplicated DAI routes
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: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-05 17:16:41 +01:00
Lars-Peter Clausen 57295073b6 ASoC: dapm: Implement mixer input auto-disable
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: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-05 15:50:27 +01:00
Lars-Peter Clausen fe58139114 ASoC: dapm: Fix empty list check in dapm_new_mux()
list_first_entry() will always return a valid pointer, even if the list is
empty. So the check whether path is NULL will always be false. So we end up
calling dapm_create_or_share_mixmux_kcontrol() with a path struct that points
right in the middle of the widget struct and by trying to modify the path the
widgets memory will become corrupted. Fix this by using list_emtpy() to check if
the widget doesn't have any paths.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Tested-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org
2013-08-01 19:25:16 +01:00
Lars-Peter Clausen 2c75bdf3fd ASoC: dapm: Fix kcontrol path list corruption
When calling krealloc for the kcontrol data the items in the path list that
point back to the head of the list will now point to freed memory, which causes
the list to become corrupted. To fix this, instead of resizing the whole data
struct, only resize the widget list.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-01 19:24:28 +01:00
Lars-Peter Clausen 9356e9d51c ASoC: dapm: Check return value of snd_soc_cnew()
snd_soc_cnew() can return NULL, so we should check the result before trying to
use it.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-01 14:12:59 +01:00
Dan Carpenter 46a02c978f ASoC: dapm: using freed pointer in dapm_kcontrol_add_widget()
There is a typo here so we end up using the old freed pointer instead of
the newly allocated one.  (If the "n" is zero then the code works,
obviously).

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-31 12:19:25 +01:00
Lars-Peter Clausen 39eb5fd13d ASoC: dapm: Delay w->power update until the changes are written
Wait with updating the widgets power field until the changes are actually
written to the hardware in dapm_seq_run_coalesced(). This will allow us to query
the current hardware state between calling dapm_power_one_widget() and actually
writing the new power state to hardware.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-29 18:41:00 +01:00
Lars-Peter Clausen 2553628e19 ASoC: dapm: Add snd_soc_dapm_add_path() helper function
snd_soc_dapm_add_path() is similar to snd_soc_dapm_add_route() except that it
expects the pointer to the source and sink widgets instead of their names. This
allows us to simplify the case where we already have a pointer to widgets. (E.g.
as we have in snd_soc_dapm_link_dai_widgets()). snd_soc_dapm_add_route() will be
updated to just look up the widget and then use snd_soc_dapm_add_path() to
handle everything else.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-29 18:41:00 +01:00
Lars-Peter Clausen de9ba98b6d ASoC: dapm: Make widget power register settings more flexible
Currently the DAPM code is limited to only setting or clearing a single bit in a
register to power a widget up or down. This patch extends the DAPM code to be
more flexible in that regard and allow widgets to use arbitrary values to be
used to put a widget in either on or off state.

Since the snd_soc_dapm_widget struct already contains a on_val and off_val field
no additional fields need to be added and in fact the invert field can even be
removed. Also the generated code is slightly smaller.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-29 18:41:00 +01:00
Lars-Peter Clausen 5106b92f80 ASoC: dapm: Keep a list of paths per kcontrol
Currently we store for each path which control (if any at all) is associated
with that control. But we are only ever interested in the reverse relationship,
i.e. we want to know all the paths a certain control is associated with. This is
currently implemented by always iterating over all paths. This patch updates the
code to keep a list for each control which contains all the paths that are
associated with that control. This improves the run time of e.g.
soc_dapm_mixer_update_power() and soc_dapm_mux_update_power() from O(n) (with n
being the number of paths for the card) to O(1).

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-29 18:41:00 +01:00
Lars-Peter Clausen cf7c1de20c ASoC: dapm: Move 'value' field from widget to control
The 'value' field is really per control and not per widget. Currently it is only
used for virtual MUXes, which only have one control per widget. So in that case
there is not so much of a difference between whether it is stored per widget or
per control. Moving the 'value' field from the widget to the control will allow
us to use it also for cases where we have more than one control per widget. E.g.
for mixers with multiple input controls.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-29 18:41:00 +01:00
Lars-Peter Clausen e84357f760 ASoC: dapm: Wrap kcontrol widget list access
In preparation for adding additional per control data wrap all access to the
widget list in helper functions.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-29 18:40:59 +01:00
Lars-Peter Clausen eee5d7f99a ASoC: dapm: Add a helper to get the CODEC for DAPM kcontrol
We use the same 3 lines to get the CODEC for a kcontrol in a quite a few places.
This patch puts them into a common helper function. Having this encapsulated in
a helper function will also make it more easier to eventually change the data
layout of the kcontrol's private data.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-29 18:40:59 +01:00
Lars-Peter Clausen 95dd5cd6e1 ASoC: dapm: Pass card instead of dapm context to dapm_power_widgets()
DAPM operations are always performed on the card as a whole. Yet (primarily for
historic reasons) dapm_power_widgets() takes a DAPM context as its parameter.
The DAPM context is mainly used to look up a pointer to the card.  The same is
true for a couple of functions that are being called from dapm_power_widgets().
This patch changes the signature of dapm_power_widgets() and a couple of related
functions to take a snd_soc_card instead of a snd_soc_dapm_context.

Some of the functions also use the DAPM's device to print error and debug
messages. This can be a bit confusing though since this means the messages for
all widgets, also those from other contexts, will be printed with that device.
The patch updates those cases to use the device of the widget's DAPM context.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-29 18:40:59 +01:00
Lars-Peter Clausen 564c65049e ASoC: dapm: Move snd_soc_dapm_update from dapm context to card
The update field of a DAPM context is only assigned while the card's dapm_mutex
is locked, the field is also cleared again while the mutex is stil locked. So
there will only ever be one DAPM context at a time with a non-NULL update field.
So it is safe to move the update field from the DAPM context struct to the card
struct. Doing so will allow further cleanups in this area.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-29 18:40:59 +01:00
Mark Brown 60529c65ec Merge branch 'topic/core' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-dapm 2013-07-29 18:40:55 +01:00
Lars-Peter Clausen 6b3fc03b3b ASoC: dapm: Add a update parameter to snd_soc_dapm_{mux,mixer}_update_power
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: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-24 14:56:19 +01:00
Lars-Peter Clausen ce6cfaf1de ASoC: dapm: Run widget updates for shared controls at the same time
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: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-24 14:56:19 +01:00
Lars-Peter Clausen c3f48ae6fd ASoC: dapm: Pass snd_soc_card directly to soc_dpcm_runtime_update()
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: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-24 14:56:19 +01:00
Mark Brown 63c69a6e41 ASoC: dapm: Use generic power check for everything except DAIs
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: Mark Brown <broonie@linaro.org>
2013-07-24 14:56:15 +01:00
Lars-Peter Clausen 56a6783442 ASoC: dapm: Fix return value of snd_soc_dapm_put_{volsw,enum_virt}()
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: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-24 14:55:04 +01:00
Lars-Peter Clausen 5f6e7d52c4 ASoC: Remove unused dapm_get_snd_card() and dapm_get_soc_card()
These two functions were added two years ago in commit 4805608 ("ASoC: dapm -
Add methods to retrieve snd_card and soc_card from dapm context.") but have
remained unused so far. Considering that the dapm context actually has a direct
pointer to the card the functions also seem to be unnecessary. E.g. the
expressions 'dapm_get_soc_card(dapm)' and 'dapm->card' yield the same result.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-23 13:56:03 +01:00
Mark Brown 9805fe391d Merge remote-tracking branch 'asoc/topic/dapm' into asoc-next 2013-06-17 17:20:17 +01:00
Mark Brown 70fe99d8db Merge remote-tracking branch 'asoc/topic/core' into asoc-next 2013-06-17 17:20:16 +01:00
Mark Brown a87c863c7b Merge remote-tracking branch 'asoc/fix/dapm' into asoc-linus 2013-06-17 17:20:11 +01:00
Lars-Peter Clausen efc77e36ae ASoC: dapm: Add snd_soc_dapm_switch to the power up/down sequence table
The power up/down sequence order for DAPM switch widgets is not explicitly
initialized, causing them to be run always as the first widget type for both
power up and down. Move it to the same position in the sequence as other mixer
widget types.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-06-14 12:35:23 +01:00
Lars-Peter Clausen 656ca9d327 ASoC: dapm: Remove unused long_name field from snd_soc_dapm_path struct
Since commit 85762e71 ("ASoC: dapm: Implement mixer control sharing") the
long_name field of the snd_soc_dapm_path struct is unused. All of the name
handling now happens entirely in dapm_create_or_share_mixmux_kcontrol(). So we
can remove the long_name field from the snd_soc_dapm_path struct.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-06-14 12:34:11 +01:00
Lars-Peter Clausen 8872293fc3 ASoC: dapm: Add a helper function to free a DAPM path
We have the same code for freeing a DAPM path in three different locations.
Introduce a new helper function to take care of this.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-06-14 12:34:11 +01:00
Lars-Peter Clausen 58fee775b7 ASoC: dapm: Remove unnecessary loop
The condition 'i == item' is only true when, well, 'i' equals 'item'.
So just use 'item' directly as the index into the array.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-06-14 12:34:10 +01:00
Lars-Peter Clausen 6b75bf0c5b ASoC: dapm: Setup private_free callback for dapm kcontrols
The private data containing the widget list that is a assigned to a DAPM
kcontrol is never freed. Setup the private_free for DAPM kcontrols to take care
of this.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-06-14 12:34:10 +01:00
Mark Brown 4616274d33 ASoC: dapm: Treat DAI widgets like AIF widgets for power
Even though they are virtual widgets DAI widgets still get counted for the
DAPM context power management so we can't just use the active state to
check if they should be powered as they may not be part of a complete path.

Instead split them into input and output widgets and do the same power
checks as we perform on AIFs.

Reported-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-06-07 15:54:50 +01:00
Lars-Peter Clausen cf1f7c6e87 ASoC: Fix early event callback list iteration
The power_list field is used when adding a widget to a power sequence list. Use
the same field when iterating the list using list_for_each_entry, otherwise
we'll see undefined behavior.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-05-22 17:32:58 -05:00
Lars-Peter Clausen 2b58107435 ASoC: core: Use kasprintf instead of opencoding it
kasprintf calculates the size of the result string, allocates a buffer large
enough to hold the string and then performs the format string operation. There
are a couple of places in ASoC where these three steps are done by hand and
where kasprintf can be used instead.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-05-14 16:52:52 +04:00
Mark Brown 8011412999 ASoC: dapm: Provide early event callbacks for power up and down
Some devices may benefit from being able to start some parts of the widget
power up/down sequence earlier on in the sequence than the point at which
the final power state is committed. Support these by providing events which
are called before any power state changes are done.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2013-05-12 20:44:18 +04:00
Takashi Iwai f91eeeb595 ASoC: Updates for v3.10
A few more bug fixes, the DAPM clock fix is actually a driver specific
 one since currently there's only one user of the clock support due to
 the problems relying on the clock API.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJRg3/MAAoJELSic+t+oim9W+cP/3NERwICTNvllNOrZXii7akJ
 DnzzIaw0fEJ2+hIXJzU/lEI/KjqIT7SADQRWg+eid8ZrjaUB6LXUPPuv67V4TseD
 1+8ClQp1cDg1KepBcD2S1liVjPKvW64IpXwZNgLGigW6PP21yK8+DoQvVKPVB+sP
 q72jntTzy9qWenmjygpPEYDeOfe5EM7hAaa2tFuYIPEL+EkMOXXvjx8ojylwQV6V
 5xFQ+CBSS8WHz7CKlawF3JH8TkcFGZNT9Hibhv1fpGM+iJDCsh/+MNiBwOpO+1wk
 eCJSiCWWTGgVK+3AvlSIQr8ml0EDEbS8Aq6bbJb9w4wgV65oFt2hOxOpkcK/8NcP
 qnKNYc3nRQsb3H+dObMdQNPWDjOfwsolKUOjetxosRIq4Pzm8afY96gu06EqTnw9
 XYXqoSAVpCuPDpmlu87Lajoj4T5XNq3G7ONAMpsAfMrl/xxmV11Wrs4/7S0o3Csb
 tNhO5XjLbFNTw9nVT6qZQViH7Bm1ItDM2B/tLb1yqnlgBAjNW/WlUyFg4bE4Qeyr
 hUg7DwvYPSVnr25t8RmPMmB2MdD4N+PfRy+aIEIuE9KMeYUTPVr5kFdDP7uA7Yw2
 Dn7lmAdDEq33zfTGYhGWs87IdxhD3VyEWveR6alrtBW0LS7ArtsPlWKhA074XuJj
 AmAU6RS3+75nymA9ucY+
 =WQzu
 -----END PGP SIGNATURE-----

Merge tag 'asoc-v3.10-4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next

ASoC: Updates for v3.10

A few more bug fixes, the DAPM clock fix is actually a driver specific
one since currently there's only one user of the clock support due to
the problems relying on the clock API.
2013-05-03 11:39:36 +02:00
Fabio Baltieri 37c1b9273f ASoC: dapm: use clk_prepare_enable and clk_disable_unprepare
Update dapm_clock_event to use clk_prepare_enable and
clk_disable_unprepare.

Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-30 19:31:30 +01:00
Mark Brown 7b451962c7 Merge remote-tracking branch 'asoc/topic/dapm' into asoc-next 2013-04-12 13:57:02 +01:00
Mark Brown 56c32c751c Merge remote-tracking branch 'asoc/topic/core' into asoc-next 2013-04-12 13:56:58 +01:00
Ryo Tsutsui 1059ecfa0f ASoC: dapm: Only clear paths we've walked
When clearing the walked flags there is no need to clear all paths, we
only need to clear the paths we actually walked. This means we can split
dapm_clear_walk() into input and output versions and rather than going
through all DAPM paths we can recurse down the path until we encounter
paths we have not yet walked.

This reduces the number of operations we need to perform and improves
cache locality.

[Pulled out of the vendor tree that the patch was originally generated
for by me, any bugs were introduced in that process -- broonie]

Signed-off-by: Ryo Tsutsui <Ryo.Tsutsui@wolfsonmicro.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-01 22:10:20 +01:00
Ryo Tsutsui 0e669246dc ASoC: dapm: Remove redundant clear_walk() for supply widgets
We already clear the walked state in dapm_widget_power_check(), no need
to do it again.

Signed-off-by: Ryo Tsutsui <Ryo.Tsutsui@wolfsonmicro.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-04-01 22:10:01 +01:00
Stephen Warren 85762e71f1 ASoC: dapm: Implement mixer control sharing
This is the equivalent of commit af46800 "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: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-31 13:28:40 +01:00
Mark Brown a36b32402a Merge remote-tracking branch 'asoc/fix/dapm' into asoc-next 2013-03-26 14:07:58 +00:00
Peter Ujfalusi 7f08a89862 ASoC: dapm: Fix pointer dereference in is_connected_output_ep()
*path is not yet initialized when we check if the widget is connected.

The compiler also warns about this:
sound/soc/soc-dapm.c: In function 'is_connected_output_ep':
sound/soc/soc-dapm.c:824:18: warning: 'path' may be used uninitialized in this function

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-15 01:27:39 +00:00