1. 12 1月, 2013 6 次提交
    • T
      ALSA: hda - Clear cached_write flag in snd_hda_codec_resume_*() · aa88a355
      Takashi Iwai 提交于
      These functions are supposed to be called at finishing the cached
      sequential writes, so clear the flag properly for lazy developers who
      often forget details.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      aa88a355
    • T
      ALSA: hda - Clear dirty flag upon cache write · de1e37b7
      Takashi Iwai 提交于
      When verbs or amps are actually written to the hardware, we can clear
      dirty flag so that the later snd_hda_codec_resume_*() calls can skip
      these verbs / amps.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      de1e37b7
    • T
      ALSA: hda - Allow one chance for zero NID in connection list · 5fdaecdb
      Takashi Iwai 提交于
      The commit [2e9bf247: ALSA: hda_codec: Check for invalid zero
      connections] trims the whole connection list when an invalid value is
      reported by the hardware.  But some codecs (at least AD1986A) may give
      a zero NID in the middle of the connection list, so dropping the whole
      list isn't good for such cases.
      
      In this patch, as a workaround, allow a single zero NID in the read
      connection list.  If it hits zero twice, it's handled as an error, so
      that we can avoid "too many connections" errors.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      5fdaecdb
    • T
      ALSA: hda - Move fixup code into struct hda_codec · c9ce6b26
      Takashi Iwai 提交于
      Since the fixup code is used commonly, it's worth to move it to the
      common place, struct hda_codec, instead of keeping in hda_gen_spec.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      c9ce6b26
    • T
      ALSA: hda - Introduce snd_hda_codec_amp_init*() · 280e57d5
      Takashi Iwai 提交于
      The new function snd_hda_codec_amp_init() (and the stereo variant)
      initializes the amp value only once at the first access.  If the amp
      was already initialized or updated, this won't do anything more.
      
      It's useful for initializing the input amps that are in the part of
      the path but never used.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      280e57d5
    • T
      ALSA: hda - Introduce cache & flush cmd / amp writes · c370dd6e
      Takashi Iwai 提交于
      For optimizing the verb executions, a new mechanism to cache the verbs
      and amp update commands is introduced.  With the new "write to cache
      and flush" way, you can reduce the same verbs that have been written
      multiple times.
      
      When codec->cached_write flag is set, the further
      snd_hda_codec_write_cache() and snd_hda_codec_amp_stereo() calls will
      be performed only on the command or amp cache table, but not sent to
      the hardware yet.  Once after you call all commands and update amps,
      call snd_hda_codec_resume_amp() and snd_hda_codec_resume_cache().
      Then all cached writes and amp updates will be written to the
      hardware, and the dirty flags are cleared.
      
      In this implementation, the existing cache table is reused, so
      actually no big code change is seen here.  Each cache entry has a new
      dirty flag now (so the cache key is now reduced to 31bit).
      
      As a good side-effect by this change, snd_hda_codec_resume_*() will no
      longer execute verbs that have been already issued during the resume
      phase by checking the dirty flags.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      c370dd6e
  2. 03 1月, 2013 1 次提交
  3. 07 12月, 2012 1 次提交
  4. 01 12月, 2012 1 次提交
  5. 28 11月, 2012 1 次提交
    • T
      ALSA: hda - Call snd_array_init() early and only once · 361dab3e
      Takashi Iwai 提交于
      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: NTakashi Iwai <tiwai@suse.de>
      361dab3e
  6. 24 11月, 2012 1 次提交
  7. 23 11月, 2012 1 次提交
    • T
      ALSA: hda - Don't overwrite the pin default configs · 3fdf1469
      Takashi Iwai 提交于
      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: NTakashi Iwai <tiwai@suse.de>
      3fdf1469
  8. 19 11月, 2012 1 次提交
  9. 09 11月, 2012 1 次提交
  10. 04 11月, 2012 1 次提交
  11. 17 10月, 2012 1 次提交
    • T
      ALSA: hda - Add workaround for conflicting IEC958 controls · dcda5806
      Takashi Iwai 提交于
      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,
      too.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      dcda5806
  12. 15 10月, 2012 1 次提交
  13. 10 10月, 2012 1 次提交
  14. 06 10月, 2012 1 次提交
    • D
      ALSA: hda - Fix hang caused by race during suspend. · d17344b3
      Dylan Reid 提交于
      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
        hda_call_codec_suspend
          hda_set_power_state
            snd_hda_codec_read
              codec_exec_verb
                snd_hda_power_up
      	    snd_hda_power_save
      	      __snd_hda_power_up
      	        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: NDylan Reid <dgreid@chromium.org>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      d17344b3
  15. 10 9月, 2012 1 次提交
    • T
      ALSA: hda - Fix Oops at codec reset/reconfig · 07dc59f0
      Takashi Iwai 提交于
      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
      callback.
      
      This patch fixes the issue by clearing the codec callbacks properly
      after freeing codec.
      Reported-by: NDaniel J Blueman <daniel@quora.org>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      07dc59f0
  16. 07 9月, 2012 1 次提交
  17. 31 8月, 2012 2 次提交
  18. 30 8月, 2012 3 次提交
    • T
      ALSA: hda - Clean up CONFIG_SND_HDA_POWER_SAVE · 83012a7c
      Takashi Iwai 提交于
      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: NTakashi Iwai <tiwai@suse.de>
      83012a7c
    • T
      ALSA: hda - Fix D3 clock stop check for codecs with own set_power_state op · 432c641e
      Takashi Iwai 提交于
      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
      properly.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      432c641e
    • T
      ALSA: hda - Fix runtime PM leftover refcounts · 68467f51
      Takashi Iwai 提交于
      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
        side,
      - call pm_notify callback in snd_hda_codec_new() and snd_hda_codec_free()
        so that the refcounts are proprely updated.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      68467f51
  19. 29 8月, 2012 2 次提交
  20. 24 8月, 2012 1 次提交
  21. 23 8月, 2012 1 次提交
    • M
      ALSA: hda - add runtime PM support · b8dfc462
      Mengdong Lin 提交于
      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
      manager.
      
      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.
      
      Details:
      - 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
           D0.
      - 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 7.3.3.10 Power state and 7.3.4.12 Supported Power State.
      
      [Fixed CONFIG_PM_RUNTIME dependency in hda_intel.c by tiwai]
      Signed-off-by: NMengdong Lin <mengdong.lin@intel.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      b8dfc462
  22. 22 8月, 2012 1 次提交
  23. 21 8月, 2012 1 次提交
  24. 20 8月, 2012 2 次提交
  25. 10 8月, 2012 1 次提交
  26. 09 8月, 2012 1 次提交
  27. 08 8月, 2012 1 次提交
  28. 04 7月, 2012 1 次提交
  29. 03 7月, 2012 1 次提交
  30. 26 6月, 2012 1 次提交