02 Dec, 2011

1 commit

  • A signal generator behaves as an input would but is not considered for
    any of the special behaviour associated with external input pins. This
    is especially useful when automatically working out not connected widgets.

    Signed-off-by: Mark Brown
    Acked-by: Liam Girdwood

    Mark Brown
     

24 Nov, 2011

1 commit

  • A card is fully routed if the DAPM route table describes all connections on
    the board.

    When a card is fully routed, some operations can be automated by the ASoC
    core. The first, and currently only, such operation is described below, and
    implemented by this patch.

    Codecs often have a large number of external pins, and not all of these pins
    will be connected on all board designs. Some machine drivers therefore call
    snd_soc_dapm_nc_pin() for all the unused pins, in order to tell the ASoC core
    never to activate them.

    However, when a card is fully routed, the information needed to derive the
    set of unused pins is present in card->dapm_routes. In this case, have
    the ASoC core automatically call snd_soc_dapm_nc_pin() for each unused
    codec pin.

    This has been tested with soc/tegra/tegra_wm8903.c and soc/tegra/trimslice.c.

    Signed-off-by: Stephen Warren
    Signed-off-by: Mark Brown

    Stephen Warren
     

10 Oct, 2011

1 commit


09 Oct, 2011

1 commit

  • The number of connected input and output endpoints for a given widgets
    can't change during a DAPM run so there is no need to redo the recursion
    through branches of the tree we've already visited. Doing this on one of
    my test systems gives an improvement of:

    Power Path Neighbour
    Before: 63 607 731
    After: 63 141 181

    which scales up well as more widgets are involved in paths.

    Signed-off-by: Mark Brown

    Mark Brown
     

05 Oct, 2011

1 commit

  • Some widgets will get power_check() run on them more than once during a
    DAPM run, most commonly due to supply widgets checking to see if their
    consumers are powered up. It's wasteful to do this so cache the result
    of power_check() during a run. For one system I tested this on I got an
    improvement of:

    Power Path Neighbour
    Before: 106 970 1186
    After: 69 727 905

    from this.

    Signed-off-by: Mark Brown

    Mark Brown
     

04 Oct, 2011

1 commit

  • In order to reduce the number of DAPM power checks we run keep a list of
    widgets which have been changed since the last DAPM run and iterate over
    that rather than the full widget list. Whenever we change the power state
    for a widget we add all the source and sink widgets it has to the dirty
    list, ensuring that all widgets in the path are checked.

    This covers more widgets than we need to as some of the neighbour widgets
    won't be connected but it's simpler as a first step. On one system I tried
    this gave:

    Power Path Neighbour
    Before: 207 1939 2461
    After: 114 1066 1327

    which seems useful.

    Signed-off-by: Mark Brown

    Mark Brown
     

23 Sep, 2011

1 commit


21 Sep, 2011

1 commit

  • One of the longest standing areas for improvement in ASoC has been the
    DAPM algorithm - it repeats the same checks many times whenever it is run
    and makes no effort to limit the areas of the graph it checks meaning we
    do an awful lot of walks over the full graph. This has never mattered too
    much as the size of the graph has generally been small in relation to the
    size of the devices supported and the speed of CPUs but it is annoying.

    In preparation for work on improving this insert a trace point after the
    graph walk has been done. This gives us specific timing information for
    the walk, and in order to give quantifiable (non-benchmark) numbers also
    count every time we check a link or check the power for a widget and report
    those numbers. Substantial changes in the algorithm may require tweaks to
    the stats but they should be useful for simpler things.

    Signed-off-by: Mark Brown

    Mark Brown
     

26 Jul, 2011

1 commit

  • In preparation for Dynamic PCM (AKA DSP) support.

    This adds a callback function to be called at the completion of a DAPM stream
    event.

    This can be used by DSP components to perform calculations based on DAPM graphs
    after completion of stream events.

    Signed-off-by: Liam Girdwood
    Signed-off-by: Mark Brown

    Liam Girdwood
     

21 Jul, 2011

1 commit


06 Jul, 2011

1 commit


14 Jun, 2011

2 commits

  • Signed-off-by: Mark Brown

    Mark Brown
     
  • Normally DAPM will power up any connected audio path. This is not ideal
    for sidetone paths as with sidetone paths the audio path is not wanted in
    itself, it is only desired if the two paths it provides a sidetone between
    are both active. If the sidetone path causes a power up then it can be
    hard to minimise pops as we first power up either the sidetone or the main
    output path and then power the other, with the second power up potentially
    introducing a DC offset.

    Address this by introducing the concept of a weak path. If a path is marked
    as weak then DAPM will ignore that path when walking the graph, though all
    the relevant controls are still available to the application layer to allow
    these paths to be configured.

    Signed-off-by: Mark Brown
    Acked-by: Liam Girdwood

    Mark Brown
     

07 Jun, 2011

1 commit

  • Rather than a simple flag to say if we want the DAPM context to be at full
    power specify the target bias state. This should have no current effect
    but is a bit more direct and so makes it easier to change our decisions
    about the which bias state to go into in future.

    Signed-off-by: Mark Brown
    Acked-by: Liam Girdwood

    Mark Brown
     

04 May, 2011

4 commits

  • A future change will allow multiple widgets to be affected by the same
    control. For example, a single register bit that controls separate muxes
    in both the L and R audio paths.

    This change updates the code that handles relevant controls to be able
    to iterate over a list of affected widgets. Note that only the put
    functions need significant modification to implement the iteration; the
    get functions do not need to iterate, nor unify the results, since all
    affected widgets reference the same kcontrol.

    When creating the list of widgets, always create a 1-sized list, since
    the control sharing is not implemented in this change.

    Signed-off-by: Stephen Warren
    Acked-by: Liam Girdwood
    Signed-off-by: Mark Brown

    Stephen Warren
     
  • Future changes will need reference to the kcontrol created for a given
    kcontrol_new. Store the created kcontrol values now.

    Signed-off-by: Stephen Warren
    Acked-by: Liam Girdwood
    Signed-off-by: Mark Brown

    Stephen Warren
     
  • A future change will modify struct snd_soc_dapm_widget to store the
    actual kcontrol pointers for each kcontrol_new in a field named
    kcontrols. Rename the existing kcontrols field to enable this.

    Signed-off-by: Stephen Warren
    Acked-by: Liam Girdwood
    Signed-off-by: Mark Brown

    Stephen Warren
     
  • Move the creation of the DAPM debugfs directory to snd_soc_dapm_debugfs_init
    instead of having the same duplicated code in both codec and card DAPM setup.

    Signed-off-by: Lars-Peter Clausen
    Acked-by: Liam Girdwood
    Signed-off-by: Mark Brown

    Lars-Peter Clausen
     

20 Apr, 2011

1 commit


08 Apr, 2011

1 commit


31 Mar, 2011

1 commit


24 Mar, 2011

1 commit


27 Jan, 2011

1 commit


25 Jan, 2011

1 commit


19 Jan, 2011

2 commits

  • Many modern devices have features such as DC servos which take time to start.
    Currently these are handled by per-widget events but this makes it difficult
    to paralleise operations on multiple widgets, meaning delays can end up
    being needlessly serialised. By providing a callback to drivers when all
    widgets of a given type have been handled during a DAPM sequence the core
    allows drivers to start operations separately and wait for them to complete
    much more simply.

    Signed-off-by: Mark Brown
    Acked-by: Liam Girdwood

    Mark Brown
     
  • With larger devices there may be many widgets of the same type in series
    in an audio path. Allow drivers to specify an additional level of ordering
    within each widget type by adding a subsequence number to widgets and then
    splitting operations on widgets so that widgets of the same type but
    different sequence numbers are processed separately. A typical example
    would be a supply widget which requires that another widget be enabled
    to provide power or clocking.

    SND_SOC_DAPM_PGA_S() and SND_SOC_DAPM_SUPPLY_S() macros are provided
    allowing this to be used with PGAs and supplies as these are the most
    commonly affected widgets.

    Signed-off-by: Mark Brown
    Acked-by: Liam Girdwood

    Mark Brown
     

18 Dec, 2010

1 commit

  • This new type is a virtual version of snd_soc_dapm_mux. It is used
    when a backing register value is not necessary for deciding which
    input path to connect. A simple virtual enumeration control e.g.
    SOC_DAPM_ENUM_VIRT() can be exposed to userspace which will be used
    to choose which path to connect.

    The snd_soc_dapm_virt_mux type ensures that during the initial
    path setup, the first (which is also the default) input path will
    be connected.

    Signed-off-by: Dimitris Papastamos
    Acked-by: Liam Girdwood
    Signed-off-by: Mark Brown

    Dimitris Papastamos
     

17 Dec, 2010

1 commit

  • Attempt to minimise audible effects from mixer and mux updates by
    implementing the actual register changes between powering down widgets
    that have become unused and powering up widgets that are newly used.

    This means that we're making the change with the minimum set of widgets
    powered, that the input path is connected when we're powering up widgets
    (so things like DC offset correction can run with their signal active)
    and that we bring things down to cold before switching away. Since
    hardware tends to be designed for the power on/off case more than for
    dynamic reconfiguration this should minimise pops and clicks during
    reconfiguration while active.

    Signed-off-by: Mark Brown
    Acked-by: Peter Ujfalusi
    Tested-by: Peter Ujfalusi
    Acked-by: Liam Girdwood

    Mark Brown
     

16 Dec, 2010

3 commits

  • Power change event like stream start/stop or kcontrol change in a
    cross-device path originates from one device but codec bias and widget power
    changes must be populated to another devices on that path as well.

    This patch modifies the dapm_power_widgets so that all the widgets on a
    sound card are checked for a power change, not just those that are specific
    to originating device. Also bias management is extended to check all the
    devices. Only exception in bias management are widgetless codecs whose bias
    state is changed only if power change is originating from that context.

    DAPM context test is added to dapm_seq_run to take care of if power sequence
    extends to an another device which requires separate register writes.

    Signed-off-by: Jarkko Nikula
    Acked-by: Liam Girdwood
    Signed-off-by: Mark Brown

    Jarkko Nikula
     
  • Decoupling widgets from DAPM context is required when extending the ASoC
    core to cross-device paths. Even the list of widgets are now kept in
    struct snd_soc_card, the widget listing in sysfs and debugs remain sorted
    per device.

    This patch makes possible to build cross-device paths but does not extend
    yet the DAPM to handle codec bias and widget power changes of an another
    device.

    Cross-device paths are registered by listing the widgets from device A in
    a map for device B. In case of conflicting widget names between the devices,
    a uniform name prefix is needed to separate them. See commit ead9b91
    "ASoC: Add optional name_prefix for kcontrol, widget and route names" for
    help.

    An example below shows a path that connects MONO out of A into Line In of B:

    static const struct snd_soc_dapm_route mapA[] = {
    {"MONO", NULL, "DAC"},
    };

    static const struct snd_soc_dapm_route mapB[] = {
    {"Line In", NULL, "MONO"},
    };

    Signed-off-by: Jarkko Nikula
    Acked-by: Liam Girdwood
    Signed-off-by: Mark Brown

    Jarkko Nikula
     
  • Decoupling DAPM paths from DAPM context is a first prerequisite when
    extending ASoC core to cross-device paths. This patch is almost a nullop and
    does not allow to construct cross-device setup but the path clean-up part in
    dapm_free_widgets is prepared to remove cross-device paths between a device
    being removed and others.

    Signed-off-by: Jarkko Nikula
    Acked-by: Liam Girdwood
    Signed-off-by: Mark Brown

    Jarkko Nikula
     

15 Dec, 2010

1 commit


14 Dec, 2010

1 commit

  • In some cases it was not possible to follow the appropiate power
    ON/OFF sequence like in cases where the PGA needs to be enabled
    before the driver and disabled before the PGA for pop reduction.

    Add a widget to support output driver (speaker, haptic, vibra, etc)
    drivers where power ON/OFF ordering is important.

    Signed-off-by: Margarita Olaya Cabrera
    Acked-by: Liam Girdwood
    Signed-off-by: Mark Brown

    Olaya, Margarita
     

22 Nov, 2010

1 commit


06 Nov, 2010

2 commits

  • Based on discussion the dapm_pop_time in debugsfs should be per card rather
    than per device. Single pop time value for entire card is cleaner when the
    DAPM sequencing is extended to cross-device paths.

    debugfs/asoc/{card->name}/{codec dir}/dapm_pop_time
    ->
    debugfs/asoc/{card->name}/dapm_pop_time

    Signed-off-by: Jarkko Nikula
    Signed-off-by: Mark Brown

    Jarkko Nikula
     
  • Decoupling Dynamic Audio Power Management (DAPM) from codec devices is
    required when developing ASoC further. Such as for other ASoC components to
    have DAPM widgets or when extending DAPM to handle cross-device paths.

    This patch decouples DAPM related variables from struct snd_soc_codec and
    moves them to new struct snd_soc_dapm_context that is used to encapsulate
    DAPM context of a device. ASoC core and API of DAPM functions are modified
    to use DAPM context instead of codec.

    This patch does not change current functionality and a large part of changes
    come because of structure and internal API changes.

    Core implementation is from Liam Girdwood with some
    minor core changes, codecs and machine driver conversions from
    Jarkko Nikula .

    Signed-off-by: Liam Girdwood
    Signed-off-by: Jarkko Nikula
    Cc: Nicolas Ferre
    Cc: Manuel Lauss
    Cc: Mike Frysinger
    Cc: Cliff Cai
    Cc: Kevin Hilman
    Cc: Ryan Mallon
    Cc: Timur Tabi
    Cc: Sascha Hauer
    Cc: Lars-Peter Clausen
    Cc: Arnaud Patard (Rtp)
    Cc: Wan ZongShun
    Cc: Eric Miao
    Cc: Jassi Brar
    Cc: Daniel Gloeckner
    Cc: Kuninori Morimoto
    Signed-off-by: Mark Brown

    Liam Girdwood
     

06 Sep, 2010

1 commit


12 Aug, 2010

1 commit

  • This patch extends the ASoC API to allow sound cards to have more than one
    CODEC and more than one platform DMA controller. This is achieved by dividing
    some current ASoC structures that contain both driver data and device data into
    structures that only either contain device data or driver data. i.e.

    struct snd_soc_codec ---> struct snd_soc_codec (device data)
    +-> struct snd_soc_codec_driver (driver data)

    struct snd_soc_platform ---> struct snd_soc_platform (device data)
    +-> struct snd_soc_platform_driver (driver data)

    struct snd_soc_dai ---> struct snd_soc_dai (device data)
    +-> struct snd_soc_dai_driver (driver data)

    struct snd_soc_device ---> deleted

    This now allows ASoC to be more tightly aligned with the Linux driver model and
    also means that every ASoC codec, platform and (platform) DAI is a kernel
    device. ASoC component private data is now stored as device private data.

    The ASoC sound card struct snd_soc_card has also been updated to store lists
    of it's components rather than a pointer to a codec and platform. The PCM
    runtime struct soc_pcm_runtime now has pointers to all its components.

    This patch adds DAPM support for ASoC multi-component and removes struct
    snd_soc_socdev from DAPM core. All DAPM calls are now made on a card, codec
    or runtime PCM level basis rather than using snd_soc_socdev.

    Other notable multi-component changes:-

    * Stream operations now de-reference less structures.
    * close_delayed work() now runs on a DAI basis rather than looping all DAIs
    in a card.
    * PM suspend()/resume() operations can now handle N CODECs and Platforms
    per sound card.
    * Added soc_bind_dai_link() to bind the component devices to the sound card.
    * Added soc_dai_link_probe() and soc_dai_link_remove() to probe and remove
    DAI link components.
    * sysfs entries can now be registered per component per card.
    * snd_soc_new_pcms() functionailty rolled into dai_link_probe().
    * snd_soc_register_codec() now does all the codec list and mutex init.

    This patch changes the probe() and remove() of the CODEC drivers as follows:-

    o Make CODEC driver a platform driver
    o Moved all struct snd_soc_codec list, mutex, etc initialiasation to core.
    o Removed all static codec pointers (drivers now support > 1 codec dev)
    o snd_soc_register_pcms() now done by core.
    o snd_soc_register_dai() folded into snd_soc_register_codec().

    CS4270 portions:
    Acked-by: Timur Tabi

    Some TLV320aic23 and Cirrus platform fixes.
    Signed-off-by: Ryan Mallon

    TI CODEC and OMAP fixes
    Signed-off-by: Peter Ujfalusi
    Signed-off-by: Janusz Krzysztofik
    Signed-off-by: Jarkko Nikula

    Samsung platform and misc fixes :-
    Signed-off-by: Chanwoo Choi
    Signed-off-by: Joonyoung Shim
    Signed-off-by: Kyungmin Park
    Reviewed-by: Jassi Brar
    Signed-off-by: Seungwhan Youn

    MPC8610 and PPC fixes.
    Signed-off-by: Timur Tabi

    i.MX fixes and some core fixes.
    Signed-off-by: Sascha Hauer

    J4740 platform fixes:-
    Signed-off-by: Lars-Peter Clausen

    CC: Tony Lindgren
    CC: Nicolas Ferre
    CC: Kevin Hilman
    CC: Sascha Hauer
    CC: Atsushi Nemoto
    CC: Kuninori Morimoto
    CC: Daniel Gloeckner
    CC: Manuel Lauss
    CC: Mike Frysinger
    CC: Arnaud Patard
    CC: Wan ZongShun

    Acked-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Liam Girdwood
     

31 May, 2010

1 commit


10 May, 2010

1 commit

  • Some devices can usefully run audio while the Linux system is suspended.
    One of the most common examples is smartphone systems, which are normally
    designed to allow audio to be run between the baseband and the CODEC
    without passing through the CPU and so can suspend the CPU when on a
    voice call for additional power savings.

    Support such systems by providing an API snd_soc_dapm_ignore_suspend().
    This can be used to mark DAPM endpoints as not being sensitive to
    system suspend. When the system is being suspended paths between
    endpoints which are marked as ignoring suspend will be kept active.
    Both source and sink must be marked, and there must already be an
    active path between the two endpoints prior to suspend.

    When paths are active over suspend the bias management will hold the
    device bias in the ON state. This is used to avoid suspending the
    CODEC while it is still in use.

    Tested-by: Peter Ujfalusi
    Acked-by: Liam Girdwood
    Signed-off-by: Mark Brown

    Mark Brown