1. 26 5月, 2014 1 次提交
    • S
      ASoC: tegra: free jack GPIOs before the sound card is freed · fb6b8e71
      Stephen Warren 提交于
      snd_soc_jack_add_gpios() schedules a work queue item to poll the GPIO to
      generate an initial jack status report. If sound card initialization
      fails, that work item needs to be cancelled, so it doesn't run after the
      card has been freed. Specifically, freeing the card calls
      snd_jack_dev_free() which calls snd_jack_dev_disconnect() which sets
      jack->input_dev = NULL, and input_dev is used by snd_jack_report(), which
      is called from the work queue item.
      
      snd_soc_jack_free_gpios() cancels the work item. The Tegra ASoC machine
      drivers do call this function in the platform driver remove() callback.
      However, this happens after the sound card is freed, at least when the
      card is freed due to errors late during snd_soc_instantiate_card(). This
      leaves a window where the work item can execute after the card is freed.
      In next-20140522, sound card initialization does fail for unrelated
      reasons, and hits the problem described above.
      
      To solve this, fix the Tegra ASoC machine drivers to clean up the Jack
      GPIOs during the snd_soc_card's .remove() callback, which is executed
      before the overall card object is freed. also, gGuard the cleanup call
      based on whether we actually setup up the GPIOs in the first place.
      Ideally, we'd do the cleanup in a struct snd_soc_dai_link .fini/remove
      function to match where the GPIOs get set up. However, there is no such
      callback.
      
      This change fixes all Tegra machine drivers. By code inspection, I
      believe some non-Tegra machine drivers have the same issue. I'll send a
      patch for that separately, once this is reviewed.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      fb6b8e71
  2. 17 7月, 2013 1 次提交
  3. 04 3月, 2013 1 次提交
  4. 09 12月, 2012 1 次提交
  5. 20 11月, 2012 1 次提交
  6. 29 8月, 2012 1 次提交
  7. 27 7月, 2012 1 次提交
  8. 08 6月, 2012 1 次提交
  9. 03 6月, 2012 3 次提交
    • S
      ASoC: make snd_soc_dai_link more symmetrical · bc92657a
      Stephen Warren 提交于
      Prior to this patch, the CPU side of a DAI link was specified using a
      single name. Often, this was the result of calling dev_name() on the
      device providing the DAI, but in the case of a CPU DAI driver that
      provided multiple DAIs, it needed to mix together both the device name
      and some device-relative name, in order to form a single globally unique
      name.
      
      However, the CODEC side of the DAI link was specified using separate
      fields for device (name or OF node) and device-relative DAI name.
      
      This patch allows the CPU side of a DAI link to be specified in the same
      way as the CODEC side, separating concepts of device and device-relative
      DAI name.
      
      I believe this will be important in multi-codec and/or dynamic PCM
      scenarios, where a single CPU driver provides multiple DAIs, while also
      booting using device tree, with accompanying desire not to hard-code the
      CPU side device's name into the original .cpu_dai_name field.
      
      Ideally, both the CPU DAI and CODEC DAI loops in soc_bind_dai_link()
      would now be identical. However, two things prevent that at present:
      
      1) The need to save rtd->codec for the CODEC side, which means we have
      to search for the CODEC explicitly, and not just the CODEC side DAI.
      
      2) Since we know the CODEC side DAI is part of a codec, and not just
      a standalone DAI, it's slightly more efficient to convert .codec_name/
      .codec_of_node into a codec first, and then compare each DAI's .codec
      field, since this avoids strcmp() on each DAI's CODEC's name within
      the loop.
      
      However, the two loops are essentially semantically equivalent.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      bc92657a
    • S
      ASoC: tegra+alc5632: unconditionally free jack GPIOs in remove · 9f6328d9
      Stephen Warren 提交于
      The headphone jack GPIOs are added/initialized in the DAI link's init()
      method, and hence in theory may not always have been added before remove()
      is called in some unusual cases. In order to prevent calling
      snd_soc_jack_free_gpios() if snd_soc_jack_add_gpios() had not been, the
      code kept track of the initialization state to avoid the free call when
      necessary.
      
      However, it appears that snd_soc_jack_free_gpios() is robust in the face
      of being called without snd_soc_jack_add_gpios() first succeeding, so
      there is little point manually tracking this information. Hence, remove
      the tracking code. All other machine drivers already operate this way.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      9f6328d9
    • S
      ASoC: tegra+alc5632: move all GPIO setup into probe · aef9a37c
      Stephen Warren 提交于
      Now that deferred probe exists, we can parse device tree and request
      GPIOs from probe(), rather than deferring this to the DAI link's init().
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      aef9a37c
  10. 01 4月, 2012 3 次提交
  11. 07 3月, 2012 1 次提交
  12. 14 2月, 2012 1 次提交
  13. 03 2月, 2012 2 次提交
  14. 01 2月, 2012 1 次提交
  15. 23 12月, 2011 1 次提交
  16. 20 12月, 2011 1 次提交