1. 23 Jan, 2013 1 commit
    • Takashi Iwai's avatar
      ALSA: hda - Fix inconsistent pin states after resume · 31614bb8
      Takashi Iwai authored
      The commit [26a6cb6c
      : ALSA: hda - Implement a poll loop for jacks as a
      module parameter] introduced the polling jack detection code, but it
      also moved the call of snd_hda_jack_set_dirty_all() in the resume path
      after resume/init ops call.  This caused a regression when the jack
      state has been changed during power-down (e.g. in the power save
      mode).  Since the driver doesn't probe the new jack state but keeps
      using the cached value due to no dirty flag, the pin state remains
      also as if the jack is still plugged.
      The fix is simply moving snd_hda_jack_set_dirty_all() to the original
      Reported-by: default avatarManolo Díaz <diaz.manolo@gmail.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
  2. 03 Jan, 2013 1 commit
  3. 07 Dec, 2012 1 commit
  4. 30 Nov, 2012 1 commit
  5. 28 Nov, 2012 1 commit
    • Takashi Iwai's avatar
      ALSA: hda - Call snd_array_init() early and only once · 361dab3e
      Takashi Iwai authored
      This is a preliminary patch for introducing a protection to access
      races of snd_array instances.  Call snd_array_init() appropriately
      at the initialization time and don't call it twice.
      Also the allocations of codec-spec structs are cleaned up by helper
      functions in patch_sigmatel.c and patch_analog.c.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
  6. 24 Nov, 2012 1 commit
  7. 22 Nov, 2012 1 commit
    • Takashi Iwai's avatar
      ALSA: hda - Don't overwrite the pin default configs · 3fdf1469
      Takashi Iwai authored
      Since we keep the pin default config values anyway internally, we
      don't have to set the values in the codec.  This patch removes the
      code writing the pincfg values.
      As a gratis bonus, we can remove also the code restoring the original
      pincfg values at PM resume or module free.  This will give us more
      benefit, as it can reduce the unnecessary power-up of codecs.
      This won't change the driver functionality.  The only difference would
      be that the codec proc file will show the original pincfg values
      instead of the actually referred values.  The actually referred values
      can be determined from sysfs *_pin_configs files.
      (Also hda-emu was updated to follow this change.)
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
  8. 19 Nov, 2012 1 commit
  9. 08 Nov, 2012 1 commit
  10. 04 Nov, 2012 1 commit
  11. 17 Oct, 2012 1 commit
    • Takashi Iwai's avatar
      ALSA: hda - Add workaround for conflicting IEC958 controls · dcda5806
      Takashi Iwai authored
      When both an SPDIF and an HDMI device are created on the same card
      instance, multiple IEC958 controls are created with indices=0, 1, ...
      But the alsa-lib configuration can't know which index corresponds
      actually to which PCM device, and both the SPDIF and the HDMI
      configurations point to the first IEC958 control wrongly.
      This patch introduces a (hackish and ugly) workaround: the IEC958
      controls for the SPDIF device are re-labeled with device=1 when HDMI
      coexists.  The device=1 corresponds to the actual PCM device for
      SPDIF, so it's anyway a better representation.  In future, HDMI
      controls should be moved with the corresponding PCM device number,
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
  12. 15 Oct, 2012 1 commit
  13. 10 Oct, 2012 1 commit
  14. 06 Oct, 2012 1 commit
    • Dylan Reid's avatar
      ALSA: hda - Fix hang caused by race during suspend. · d17344b3
      Dylan Reid authored
      There was a race condition when the system suspends while hda_power_work
      is running in the work queue.  If system suspend (snd_hda_suspend)
      happens after the work queue releases power_lock but before it calls
      hda_call_codec_suspend,  codec_suspend runs with power_on=0, causing the
      codec to power up for register reads, and hanging when it calls
      cancel_delayed_work_sync from the running work queue.
      The call chain from the work queue will look like this:
      hda_power_work <<- power_on = 1, unlock, then power_on cleard by suspend
      	        cancel_delayed_work_sync <<-- cancelling executing wq
      Fix this by waiting for the work queue to finish before starting suspend
      if suspend is not happening on the work queue.
      Signed-off-by: default avatarDylan Reid <dgreid@chromium.org>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
  15. 10 Sep, 2012 1 commit
    • Takashi Iwai's avatar
      ALSA: hda - Fix Oops at codec reset/reconfig · 07dc59f0
      Takashi Iwai authored
      snd_hda_codec_reset() calls restore_pincfgs() where the codec is
      powered up again, which eventually tries to resume and initialize via
      the callbacks of the codec.  However, it's the place just after codec
      free callback, thus no codec callbacks should be called after that.
      On a codec like CS4206, it results in Oops due to the access in init
      This patch fixes the issue by clearing the codec callbacks properly
      after freeing codec.
      Reported-by: default avatarDaniel J Blueman <daniel@quora.org>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
  16. 06 Sep, 2012 1 commit
  17. 31 Aug, 2012 2 commits
  18. 30 Aug, 2012 3 commits
    • Takashi Iwai's avatar
      ALSA: hda - Clean up CONFIG_SND_HDA_POWER_SAVE · 83012a7c
      Takashi Iwai authored
      CONFIG_SND_HDA_POWER_SAVE is no longer an experimental feature and its
      behavior can be well controlled via the default value and module
      parameter.  Let's just replace it with the standard CONFIG_PM.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
    • Takashi Iwai's avatar
      ALSA: hda - Fix D3 clock stop check for codecs with own set_power_state op · 432c641e
      Takashi Iwai authored
      When a codec provides its own set_power_state op, the D3-clock-stop
      isn't checked correctly.  And the recent changes for repeating the
      state-setting operation isn't applied to such a codec, too.
      This patch fixes these issues by moving the call of codec's own op to
      the place where the generic power-set operation is done, and move the
      power-state synchronization code out of
      snd_hda_set_power_state_to_all() so that it can be called always at
      the end of power-up/down sequence, and updates the D3 clock-stop flag
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
    • Takashi Iwai's avatar
      ALSA: hda - Fix runtime PM leftover refcounts · 68467f51
      Takashi Iwai authored
      When the HD-audio is removed, it leaves the refcounts when codecs are
      powered up (usually yes) in the destructor.  For fixing the unbalance,
      and cleaning up the code mess, this patch changes the following:
      - change pm_notify callback to take the explicit power on/off state,
      - check of D3 stop-clock and keep_link_on flags is moved to the caller
      - call pm_notify callback in snd_hda_codec_new() and snd_hda_codec_free()
        so that the refcounts are proprely updated.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
  19. 28 Aug, 2012 2 commits
  20. 24 Aug, 2012 1 commit
  21. 23 Aug, 2012 1 commit
    • Mengdong Lin's avatar
      ALSA: hda - add runtime PM support · b8dfc462
      Mengdong Lin authored
      Runtime PM can bring more power saving:
      - When the controller is suspended, its parent device will also have a chance
        to suspend.
      - PCI subsystem can choose the lowest power state the controller can signal
        wake up from. This state can be D3cold on platforms with ACPI PM support.
      And runtime PM can provide a gerneral sysfs interface for a system policy
      Runtime PM support is based on current HDA power saving implementation. The user
      can enable runtime PM on platfroms that provide acceptable latency on transition
      from D3 to D0.
      - When both power saving and runtime PM are enabled:
        -- If a codec supports 'stop-clock' in D3, it will request suspending the
           controller after it enters D3 and request resuming the controller before
           back to D0. Thus the controller will be suspended only when all codecs are
           suspended and support stop-clock in D3.
        -- User IO operations and HW wakeup signal can resume the controller back to
      - If runtime PM is disabled, power saving just works as before.
      - If power saving is disabled, the controller won't be suspended because the
        power usage counter can never be 0.
      More about 'stop-clock' feature:
      If a codec can support targeted pass-through operations in D3 state when there
      is no BCLK present on the link, it will set CLKSTOP flag in the supported power
      states and report PS-ClkStopOk when entering D3 state. Please refer to HDA spec
      section Power state and Supported Power State.
      [Fixed CONFIG_PM_RUNTIME dependency in hda_intel.c by tiwai]
      Signed-off-by: default avatarMengdong Lin <mengdong.lin@intel.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
  22. 22 Aug, 2012 1 commit
  23. 20 Aug, 2012 3 commits
  24. 10 Aug, 2012 1 commit
  25. 09 Aug, 2012 1 commit
  26. 08 Aug, 2012 1 commit
  27. 03 Jul, 2012 2 commits
  28. 26 Jun, 2012 2 commits
  29. 22 Jun, 2012 1 commit
  30. 18 Jun, 2012 1 commit
    • Dylan Reid's avatar
      ALSA: hda - Handle open while transitioning to D3. · b4a91cf0
      Dylan Reid authored
      This addresses an issue encountered when a pcm is opened while
      transitioning to low power state (codec->power_on == 1 &&
      codec->power_transition == -1).  Add snd_pcm_power_up_d3wait to
      hda_codec.  This function is used to power up from azx_open as opposed
      to snd_hda_power_up used from codec_exec_verb. When powering up from
      azx_open, wait for pending power downs to complete, avoiding the power
      up continuing in parallel with the power down on the work queue.
      The specific issue seen was with the CS4210 codec, it powers off the ADC
      and DAC nid in its suspend handler.  If it is re-opened before the
      ~100ms power down process completes, the ADC and DAC nid are initialized
      while powered down and audio is lost until another suspend/resume cycle.
      Signed-off-by: default avatarDylan Reid <dgreid@chromium.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
  31. 08 Jun, 2012 1 commit
  32. 07 Jun, 2012 1 commit