1. 19 8月, 2014 9 次提交
    • L
      ASoC: Consolidate CPU and CODEC DAI removal · e60cd14f
      Lars-Peter Clausen 提交于
      CPU and CODEC DAI works exactly the same way. There is already a helper function
      for CODEC DAI removal, use that one as well for CPU DAI removal.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      e60cd14f
    • L
      ASoC: Cleanup DAI module reference counting · ffbd7dd7
      Lars-Peter Clausen 提交于
      Currently when a DAI has no CODEC associated to it the reference on the module
      containing the DAI driver is increased when the DAI is probed and decrease when
      the DAI is removed. For DAIs with CODECs the module reference count was already
      incremented when the CODEC is probed. Now that all components have their module
      reference count incremented when they are probed and all DAIs do have a
      component it is possible to remove the module reference counting on DAI probe
      and removal.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      ffbd7dd7
    • L
      ASoC: Move component->probed check into soc_{remove,probe}_component() · 70090bbb
      Lars-Peter Clausen 提交于
      Having the check in a centralized place makes the code a bit cleaner and
      shorter.
      
      Note: There is a slight semantic change in this patch. soc_probe_aux_dev() will
      no longer return -EBUSY if the AUX dev has already been probed before. This is
      fine though since it will simply do nothing in that case and return success.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      70090bbb
    • L
      ASoC: Pass component instead of DAPM context to AUX dev init callback · 57bf7726
      Lars-Peter Clausen 提交于
      Given that the component is the containing structure it makes more sense to pass
      the component rather than the DAPM context to the AUX dev init callback.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      57bf7726
    • L
      ASoC: Move AUX dev support to the component level · 65d9361f
      Lars-Peter Clausen 提交于
      This patch makes it possible to register arbitrary components as a AUX dev
      for a card. This was previously only possible for CODEC components. With
      componentization having made it possible for components to have DAPM contexts
      and controls there is no reason why AUX devs should be artificially limited to
      snd_soc_codec devices.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      65d9361f
    • L
      ASoC: Add component level probe/remove support · 61aca564
      Lars-Peter Clausen 提交于
      Now that we have a unified probe and remove path make sure to call them for all
      components. soc_{probe,remove}_component are responsible for setting up the DAPM
      context for the component, initialize the component prefix, manage the debugfs
      entries as well as do the registration of table based controls and DAPM
      elements. They also call the component drivers probe and remove callbacks. This
      patch makes these things available for generic snd_soc_component drivers rather
      than only having them for snd_soc_codec and snd_soc_platform drivers.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      61aca564
    • L
      ASoC: Make rtd->codec optional · 93c3ce76
      Lars-Peter Clausen 提交于
      There are some place in the ASoC core that expect rtd->codec to be non NULL
      (mainly CODEC specific sysfs files). With componentization going forward
      rtd->codec might be NULL in some cases. This patch prepares the core for this by
      not registering CODEC specific sysfs files if rtd->codec is NULL. sysfs file
      removal does not need to be conditionalized as it handles the removal of
      non-existing files just fine.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      93c3ce76
    • L
      ASoC: Consolidate platform and CODEC probe/remove · f1d45cc3
      Lars-Peter Clausen 提交于
      The platform and CODEC probe and remove code is now largely identical. This
      patch consolidates it at the component level.
      
      The resulting code is slightly larger due to all the boiler plate code setting
      up the indirection for the table based control and DAPM registration.  Once all
      drivers have been update to no longer use the snd_soc_codec_driver and
      snd_soc_platform_driver specific fields for this the indirection can be removed
      again.
      
      This patch contains two noteworthy hacks that are only meant to be temporary to
      be able to update drivers and the core in separate incremental patches.
      
      The first hack is related to that some DPCM platforms expect that the DAPM
      widgets for the DAIs of a snd_soc_component are created in the DAPM context of
      the snd_soc_platform that has the same parent device. For handling this the
      steal_sibling_dai_widgets attribute is introduced. It gets set for
      snd_soc_platforms that register DAPM elements. When creating the DAI widgets for
      a component this flag is checked and if it is found on one of the siblings the
      component will not create any DAI widgets in its own DAPM context. If the
      attribute is set on a platform it will look for siblings components and create
      DAI widgets for them in its own context. The fix for this will be to update
      the offending drivers to only register a single component rather than two.
      
      The second hack deals with the fact that the ASoC card suspend and resume code
      still needs a list of CODECs that have been registered for the card. To handle
      this the generic probe and remove path have a check to see if the component is
      CODEC and if yes add/remove it to the card's CODEC list. While it is possible to
      clean up the suspend/resume code to not need the CODEC list anymore this is a
      bit of a chicken and egg problem since it will become easier to clean up the
      suspend/resume code once there is a unified component layer.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      f1d45cc3
    • L
      ASoC: Move debugfs registration to the component level · 81c7cfd1
      Lars-Peter Clausen 提交于
      The debugfs registration is mostly identical between platforms and CODECs. This
      patches consolidates the two implementations at the component level.
      
      Unfortunately there are still a couple of CODEC specific debugfs files that are
      related to legacy ASoC IO that need to be registered. For this a new callback is
      added to the component struct that will be initialized when a CODEC is
      registered and will be used to register the CODEC specific files. Once there are
      no drivers left using legacy IO this can be removed again.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      81c7cfd1
  2. 23 7月, 2014 3 次提交
  3. 17 7月, 2014 2 次提交
  4. 09 7月, 2014 1 次提交
  5. 03 7月, 2014 4 次提交
  6. 02 7月, 2014 1 次提交
  7. 28 6月, 2014 1 次提交
  8. 22 6月, 2014 10 次提交
    • L
      ASoC: dapm: Remove platform field from widget and dapm context struct · 88a8fe3d
      Lars-Peter Clausen 提交于
      The platform field in the snd_soc_dapm_widget and snd_soc_dapm_context structs
      is now unused can be removed. New code that wants to get the platform for a
      widget or dapm context should use snd_soc_dapm_to_platform(w->dapm) or
      snd_soc_dapm_to_platform(dapm).
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      88a8fe3d
    • L
      ASoC: dapm: Remove DAI DAPM context · 9420d97b
      Lars-Peter Clausen 提交于
      The DAI DAPM context was added in commit be09ad90 ("ASoC: core: Add platform DAI
      widget mapping") and the only user was removed again in commit ae10e7e8 ("ASoC:
      core: Only add platform DAI widgets once."). Now that we have a per component
      DAPM context it is unlikely that we'll need the DAI DAPM context again.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      9420d97b
    • L
      ASoC: Add component level stream_event() and seq_notifier() support · 14e8bdeb
      Lars-Peter Clausen 提交于
      This patch adds stream_event() and seq_notifier() callbacks similar to those
      found in the snd_soc_codec_driver and snd_soc_platform driver struct to the
      snd_soc_component_driver struct. This is meant to unify the handling of these
      callbacks across different types of components and will eventually allow their
      removal from the CODEC and platfrom driver structs.
      
      The new callbacks are slightly different from the old ones in that they take a
      snd_soc_component as a parameter rather than a snd_soc_dapm_context. This was
      done since otherwise casting from the DAPM context to the component would
      typically be the first thing to do in the callback. And the interface becomes
      slightly cleaner by passing a snd_soc_component to all callbacks in the
      snd_soc_component_driver struct.
      
      The patch also already removes the stream_event() callback from the
      snd_soc_codec_driver and snd_soc_platform_driver structs as it is currently
      unused.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      14e8bdeb
    • L
      ASoC: Use component DAPM context for platforms · bc9af9fa
      Lars-Peter Clausen 提交于
      The snd_soc_platform dapm field is not accessed outside of the ASoC core. Switch
      it over to using the snd_soc_component DAPM context.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      bc9af9fa
    • L
      ASoC: Add DAPM support at the component level · ce0fc93a
      Lars-Peter Clausen 提交于
      This patch adds full DAPM support at the component level. Previously there was
      only full DAPM support for CODECs and partial DAPM support (e.g. no Mixers nor
      MUXs) for platforms. Having DAPM support at the component level will allow all
      types of components to use DAPM and also help in consolidating the DAPM support
      between CODECs and platforms.
      
      Since the DAPM context is directly embedded into the snd_soc_codec and
      snd_soc_platform struct and the 'dapm' field is directly referenced in a lot of
      drivers moving the field just right now is not possible without causing code
      churn. The approach this patch takes is to add two new fields to the component
      struct. One field which is the pointer to the actual DAPM context used by the
      component and one DAPM context that will be used as the default if no other
      context was specified. For CODECs and platforms the pointer is initialized to
      point to the CODEC or platform DAPM context. All generic code when referencing
      a component's DAPM struct will go via the pointer. This will make it possible to
      eventually seamlessly move the DAPM context from snd_soc_codec and
      snd_soc_platform struct over once all direct references have been eliminated.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      ce0fc93a
    • L
      ASoC: Add a set_bias_level() callback to the DAPM context struct · 68f831c2
      Lars-Peter Clausen 提交于
      Currently the DAPM code directly looks at the CODEC driver struct to get a
      handle to the set_bias_level() callback. This patch adds a new set_bias_level()
      callback to the DAPM context struct. The DAPM code will use this new callback
      instead of the CODEC callback. For CODECs the new callback is set up to call the
      CODEC specific set_bias_level callback(). Not looking directly at the CODEC
      driver struct will allow non CODEC DAPM contexts to implement a set_bias_level()
      callback.
      
      This is also similar to how the seq_notifier() and stream_event() callbacks are
      currently handled.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      68f831c2
    • L
      ASoC: Auto disconnect pins from all DAPM contexts · 7df37884
      Lars-Peter Clausen 提交于
      Currently only pins in CODEC DAPM contexts are automatically marked as
      non-connected if the card has the fully_routed flag set. This makes sense since
      widgets which qualify for auto-disconnection are only found in CODEC DAPM
      contexts. But with componentisation this is going to change, so consider all
      widgets for auto-disconnection.
      
      Also it is probably faster to walk the widgets list only once rather than once
      for each CODEC.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      7df37884
    • L
      ASoC: Split component registration into two steps · bb13109d
      Lars-Peter Clausen 提交于
      Split snd_soc_component_register() into snd_soc_component_initialize() and
      snd_soc_component_add(). Using a 2-stage registration approach has the advantage
      that it is possible to modify the component after it has been initialized, but
      before it is made visible to the system. This e.g. allows CODECs or platforms to
      overwrite some of the default settings made in snd_soc_component_initialize().
      
      Similar snd_soc_component_unregister() is split into two steps as well,
      snd_soc_component_delete(), which removes the component from the system, and
      snd_soc_component_cleanup(), which frees all the resources allocated by the
      component.
      
      Furthermore this patch makes sure that if a component is visible on two list
      (e.g. the component list and the CODEC list) it is added or removed to both
      lists atomically.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      bb13109d
    • L
      ASoC: Move name and id from CODEC/platform to component · f4333203
      Lars-Peter Clausen 提交于
      The component struct already has a name and id field which are initialized to
      the same values as the same fields in the CODEC and platform structs. So remove
      them from the CODEC and platform structs and used the ones from the component
      struct instead.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      f4333203
    • L
      ASoC: Move name_prefix from CODEC to component · 94f99c87
      Lars-Peter Clausen 提交于
      Move the name_prefix from the CODEC struct to the component struct. This will
      eventually allow to specify prefixes for all types of components. It is also
      necessary to make the DAPM code component type independent (i.e. a DAPM context
      does not need to know whether it belongs to a CODEC or a platform or something
      else).
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      94f99c87
  9. 07 5月, 2014 3 次提交
  10. 06 5月, 2014 1 次提交
  11. 03 5月, 2014 1 次提交
  12. 02 5月, 2014 1 次提交
  13. 30 4月, 2014 1 次提交
    • J
      ASoC: core: Fix component_list corruption when unloading modules · 4da53393
      Jarkko Nikula 提交于
      This fixes module unload regressions introduced by commits 98e639fb
      ("ASoC: Track which components have been registered with
      snd_soc_register_component()") and b37f1d12 ("ASoC: Let snd_soc_platform
      subclass snd_soc_component").
      
      First commit causes component_list to be corrupted when removing codec and
      second when removing platform. Reason for both is that components associated
      with platform or codec are never removed from the list because for them
      registered_as_component field in struct snd_soc_component is always false.
      
      Now list becomes corrupted when snd_soc_unregister_platform() or
      snd_soc_unregister_codec() frees the platform or codec structure and where
      the associated struct snd_soc_component is embedded.
      
      Fix these by moving component unregistration and cleanup to a new local
      function __snd_soc_unregister_component() that takes component as its
      argument.
      
      Since component is known for platforms and codecs the
      __snd_soc_unregister_component() can be called directly and
      snd_soc_unregister_component() takes care to find and unregister only
      components that were registered using snd_soc_register_component().
      Signed-off-by: NJarkko Nikula <jarkko.nikula@linux.intel.com>
      Acked-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      4da53393
  14. 27 4月, 2014 1 次提交
  15. 24 4月, 2014 1 次提交