1. 17 4月, 2012 4 次提交
    • M
      ASoC: core: Support transparent CODEC<->CODEC DAI links · c74184ed
      Mark Brown 提交于
      Rather than having the user half start a stream but avoid any DMA to
      trigger data flow on links which don't pass through the CPU create a
      DAPM route between the two DAI widgets using a hw_params configuration
      provided by the machine driver with the new 'params' member of the
      dai_link struct.  If no configuration is provided in the dai_link then
      use the old style even for CODEC<->CODEC links to avoid breaking
      systems.
      
      This greatly simplifies the userspace usage of such links, making them
      as simple as analogue connections with the stream configuration being
      completely transparent to them.
      
      This is achieved by defining a new dai_link widget type which is created
      when CODECs are linked and triggering the configuration of the link via
      the normal PCM operations from there.  It is expected that the bias
      level callbacks will be used for clock configuration.
      
      Currently only the DAI format, rate and channel count can be configured
      and currently the only DAI operations which can be called are hw_params
      and digital_mute().  This corresponds well to the majority of CODEC
      drivers which only use other callbacks for constraint setting but there
      is obviously much room for extension here.  We can't simply call
      hw_params() on startup as things like the system clocking configuration
      may change at runtime and in future it will be desirable to offer some
      configurability of the link parameters.
      
      At present we are also restricted to a single DAPM link for the entire
      DAI.  Once we have better support for channel mapping it would also be
      desirable to extend this feature so that we can propagate per-channel
      power state over the link.
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      Acked-by: NLiam Girdwood <lrg@ti.com>
      c74184ed
    • M
      ASoC: core: Bind DAIs to CODECs at registration time · 054880fe
      Mark Brown 提交于
      We should always have a CODEC already there when registering a CODEC DAI
      and for CODEC<->CODEC links a dai_link will have two CODECs so it's much
      simpler to do things at registration time.
      
      This results in a slight change in the error handling for failed CODEC
      DAI registrations but practically speaking these are never supposed to
      fail so there shouldn't be much issue. The change is that we don't fail
      the overall CODEC registration if the DAI registration fails; this seems
      more robust anyway as we may not need to use a given DAI in a particular
      system.
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      054880fe
    • M
      ASoC: core: Flip master for CODECs in the CPU slot of a CODEC<->CODEC link · f04209a7
      Mark Brown 提交于
      When two CODEC DAIs are linked directly to each other then if we give the
      same master mode settings to both devices things won't work as either
      neither will drive or they'll drive against each other. Flip the settings
      for the DAI in the CPU slot of the DAI link.
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      f04209a7
    • M
      ASoC: core: Return -ENOTSUPP instead of -EINVAL if mute is not supported · 04570c62
      Mark Brown 提交于
      This helps us ignore errors in callers if the operation failed due to not
      being available as opposed to an error.
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      Acked-by: NLiam Girdwood <lrg@ti.com>
      04570c62
  2. 06 4月, 2012 1 次提交
    • S
      simple_open: automatically convert to simple_open() · 234e3405
      Stephen Boyd 提交于
      Many users of debugfs copy the implementation of default_open() when
      they want to support a custom read/write function op.  This leads to a
      proliferation of the default_open() implementation across the entire
      tree.
      
      Now that the common implementation has been consolidated into libfs we
      can replace all the users of this function with simple_open().
      
      This replacement was done with the following semantic patch:
      
      <smpl>
      @ open @
      identifier open_f != simple_open;
      identifier i, f;
      @@
      -int open_f(struct inode *i, struct file *f)
      -{
      (
      -if (i->i_private)
      -f->private_data = i->i_private;
      |
      -f->private_data = i->i_private;
      )
      -return 0;
      -}
      
      @ has_open depends on open @
      identifier fops;
      identifier open.open_f;
      @@
      struct file_operations fops = {
      ...
      -.open = open_f,
      +.open = simple_open,
      ...
      };
      </smpl>
      
      [akpm@linux-foundation.org: checkpatch fixes]
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Julia Lawall <Julia.Lawall@lip6.fr>
      Acked-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      234e3405
  3. 04 4月, 2012 1 次提交
  4. 03 4月, 2012 1 次提交
  5. 01 4月, 2012 5 次提交
    • M
      ASoC: core: Use driver core probe deferral · b19e6e7b
      Mark Brown 提交于
      In version 3.4 the driver core acquired probe deferral which is a core way
      of doing essentially the same thing as ASoC has been doing since forever
      to make sure that all the devices needed to make up the card are present
      without needing open coding in the subsystem.
      
      Make basic use of this probe deferral mechanism for the cards, removing the
      need to handle partially instantiated cards. We should be able to remove
      even more code than this, though some of the checks we're currently doing
      should stay since they're about things like suppressing unneeded DAPM runs
      rather than deferring probes.
      
      In order to avoid robustness issues with our teardown paths (which do need
      quite a bit of TLC) add a check for aux_devs prior to attempting to set
      things up, this means that we've got a reasonable idea that everything will
      be there before we start. As with the removal of partial instantiation
      support more work will be needed to make this work neatly.
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      Acked-by: NLiam Girdwood <lrg@ti.com>
      b19e6e7b
    • L
      ASoC: dapm: Add platform stream event support · d9b0951b
      Liam Girdwood 提交于
      Currently stream events are only perfomed on codec stream widgets only.
      There is now a need to be able to perform stream events on platform
      widgets too.
      
      e.g. we have the ABE platform driver with several DAI links
      to dummy codecs. We need to be able to perform stream events on any
      of the dummy codec DAI links.
      
      This patch also removes the snd_soc_dai * parameter since it's already
      contained within the rtd * parameter.
      
      Finally makle stream event return void since no one checks it anyway.
      Signed-off-by: NLiam Girdwood <lrg@ti.com>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      d9b0951b
    • L
      ASoC: core: Add platform DAI widget mapping · be09ad90
      Liam Girdwood 提交于
      Add platform driver support for CPU DAI DAPM widgets.
      Signed-off-by: NLiam Girdwood <lrg@ti.com>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      be09ad90
    • L
      ASoC: dapm: Use DAPM mutex for DAPM ops instead of codec mutex · a73fb2df
      Liam Girdwood 提交于
      It has now become necessary to use a DAPM mutex instead of the codec
      mutex to lock the DAPM operations. This is due to the recent multi
      component support and forth coming Dynamic PCM updates.
      
      Currently we lock DAPM operations with the codec mutex of the calling
      RTD context. However, DAPM operations can span the whole card context
      and all components.
      
      This patch updates the DAPM operations that use the codec mutex to
      now use the DAPM mutex PCM subclass for all DAPM ops.
      
      We also add a mutex subclass for DAPM init and PCM operations.
      Signed-off-by: NLiam Girdwood <lrg@ti.com>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      a73fb2df
    • L
      ASoC: core: Add card mutex locking subclasses · 01b9d99a
      Liam Girdwood 提交于
      This is the first part of a change that is intended to improve
      ASoC locking protection for DAPM and PCM operations.
      
      This part of the series adds a mutex class for the soc_card mutex. The
      SND_SOC_CARD_CLASS_INIT class is used for card initialisation only whilst the
      SND_SOC_CARD_CLASS_PCM class is used for the forth coming Dynamic
      PCM operations. The new mutex classes are required otherwise we will see a false
      positive mutex deadlock warning between the card initialisation and the PCM
      operations (something that would never deadlock in real life).
      Signed-off-by: NLiam Girdwood <lrg@ti.com>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      01b9d99a
  6. 15 3月, 2012 1 次提交
  7. 09 3月, 2012 1 次提交
  8. 07 3月, 2012 1 次提交
  9. 03 3月, 2012 2 次提交
  10. 24 2月, 2012 1 次提交
  11. 22 2月, 2012 2 次提交
    • M
      ASoC: core: Add support for masking out parts of coefficient blocks · f831b055
      Mark Brown 提交于
      Chip designers frequently include things like the enable and disable
      controls for algorithms in the register blocks which also hold the
      coefficients. Since it's desirable to split out the enable/disable
      control from userspace the plain SND_SOC_BYTES() isn't optimal for
      these devices.
      
      Add a SND_SOC_BYTES_MASK() which allows a bitmask from the first word
      of the block to be excluded from the control. This supports the needs
      of devices I've looked at and lets us have a reasonably simple API.
      Further controls can be added in future if that's needed.
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      Acked-by: NLiam Girdwood <lrg@ti.com>
      f831b055
    • M
      ASoC: core: Add SND_SOC_BYTES control for coefficient blocks · 71d08516
      Mark Brown 提交于
      Allow devices to export blocks of registers to the application layer,
      intended for use for reading and writing coefficient data which can't
      usefully be worked with by the kernel at runtime (for example, due to
      requiring complex and expensive calculations or being the results of
      callibration procedures). Currently drivers are using platform data to
      provide configurations for coefficient blocks which isn't at all
      convenient for runtime management or configuration development.
      
      Currently only devices using regmap are supported, an error will be
      generated for any attempt to work with a byte control on a non-regmap
      device. There's no fundamental block to other devices so support could
      be added if required.
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      Acked-by: NLiam Girdwood <lrg@ti.com>
      71d08516
  12. 18 2月, 2012 4 次提交
  13. 16 2月, 2012 1 次提交
  14. 15 2月, 2012 1 次提交
  15. 09 2月, 2012 1 次提交
  16. 04 2月, 2012 1 次提交
    • L
      ASoC: core: Add support for DAI and machine kcontrols. · 022658be
      Liam Girdwood 提交于
      Currently ASoC can only add kcontrols using codec and platform component device
      handles. It's also desirable to add kcontrols for DAIs (i.e. McBSP) and for
      SoC card machine drivers too. This allows the kcontrol to have a direct handle to
      the parent ASoC component DAI/SoC Card/Platform/Codec device and hence easily
      get it's private data.
      
      This change makes snd_soc_add_controls() static and wraps it in the folowing
      calls (card and dai are new) :-
      
      snd_soc_add_card_controls()
      snd_soc_add_codec_controls()
      snd_soc_add_dai_controls()
      snd_soc_add_platform_controls()
      
      This patch also does a lot of small mechanical changes in individual codec drivers
      to replace snd_soc_add_controls() with snd_soc_add_codec_controls().
      
      It also updates the McBSP DAI driver to use snd_soc_add_dai_controls().
      
      Finally, it updates the existing machine drivers that register controls to either :-
      
      1) Use snd_soc_add_card_controls() where no direct codec control is required.
      2) Use snd_soc_add_codec_controls() where there is direct codec control.
      
      In the case of 1) above we also update the machine drivers to get the correct
      component data pointers from the kcontrol (rather than getting the machine pointer
      via the codec pointer).
      Signed-off-by: NLiam Girdwood <lrg@ti.com>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      022658be
  17. 01 2月, 2012 2 次提交
    • M
      ASoC: core: Support suspend to disk · 5aa44b13
      Mark Brown 提交于
      Use the same pm_ops for all system suspend and resume paths. This isn't
      ideal for suspend to disk with older CODECs as we'll suspend and then
      resume the CODEC before powering off all of which takes a long time due
      to VMID ramps but it's very simple to implement and for modern CODECs the
      overhead should be minimal.
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      Acked-by: NLiam Girdwood <lrg@ti.com>
      5aa44b13
    • M
      ASoC: core: Better support for idle_bias_off suspend ignores · 125a25da
      Mark Brown 提交于
      If an idle_bias_off device is in any state other than off then it is still
      active for some reason (typically a low power function such as accessory
      detection). This wasn't an issue when the feature was implemented as we
      always went to _ON for any active function, subsequent power improvements
      have changed things.
      
      With the modern way of doing things we should overhaul the infrastructure
      to allow devices to explicitly take references for these functions but
      that's a much more invasive change and will require driver updates to
      deploy, this will bring the framework into line with the existing driver
      set before we do that work.
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      Acked-by: NLiam Girdwood <lrg@ti.com>
      125a25da
  18. 22 1月, 2012 1 次提交
  19. 20 1月, 2012 1 次提交
  20. 16 1月, 2012 1 次提交
  21. 11 1月, 2012 1 次提交
  22. 23 12月, 2011 1 次提交
  23. 22 12月, 2011 1 次提交
  24. 20 12月, 2011 2 次提交
  25. 11 12月, 2011 1 次提交
  26. 09 12月, 2011 1 次提交