1. 12 1月, 2013 6 次提交
    • T
      ALSA: hda - Revive snd_hda_get_conn_list() · ee8e765b
      Takashi Iwai 提交于
      Manage the connection list cache using linked lists instead of
      snd_array, and revive snd_hda_get_conn_list() again, so that we don't
      have to keep the expanded values locally.
      This will reduce the stack usage by recursive call of
      snd_hda_get_conn_index() or parse_nid_path() of the generic parser.
      
      The list management doesn't include any mutex protection, thus the
      caller needs to take care of race appropriately.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      ee8e765b
    • T
      ALSA: hda - Add codec->inv_jack_detect flag · 9cc159c6
      Takashi Iwai 提交于
      Yet another broken hardware workaround: there are hardware indicating
      the inverted jack detection bit result.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      9cc159c6
    • T
      ALSA: hda - Add inv_eapd flag to struct hda_codec · ecac3ed1
      Takashi Iwai 提交于
      Add the new flag, codec->inv_eapd, indicating that the EAPD
      implementation is inverted.
      
      There are always broken hardware in the world.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      ecac3ed1
    • T
      ALSA: hda - Add snd_hda_codec_flush_*_cache() aliases · 0c3d47b0
      Takashi Iwai 提交于
      It makes easier to understand although these are identical with
      snd_hda_codec_resume_*() functions.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      0c3d47b0
    • 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 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. 19 11月, 2012 1 次提交
  3. 09 11月, 2012 1 次提交
  4. 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
  5. 15 10月, 2012 1 次提交
  6. 07 9月, 2012 2 次提交
  7. 31 8月, 2012 1 次提交
    • T
      ALSA: hda - Yet another fix for D3 stop-clock refcounting · 08fa20ae
      Takashi Iwai 提交于
      The call of pm_notify callback in snd_hda_codec_free() should be with
      the check of the current state whether pm_notify(false) is called or
      not, instead of codec->power_on check.
      
      For improving the code readability and fixing this inconsistency,
      codec->d3_stop_clk_ok is renamed to codec->pm_down_notified, and this
      flag is set only when runtime PM down is called.  The new name reflects
      to a more direct purpose of the flag.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      08fa20ae
  8. 30 8月, 2012 3 次提交
  9. 29 8月, 2012 1 次提交
  10. 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
  11. 20 8月, 2012 1 次提交
  12. 13 8月, 2012 1 次提交
  13. 09 8月, 2012 1 次提交
  14. 08 8月, 2012 1 次提交
  15. 03 7月, 2012 1 次提交
  16. 18 6月, 2012 1 次提交
    • D
      ALSA: hda - Handle open while transitioning to D3. · b4a91cf0
      Dylan Reid 提交于
      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: NDylan Reid <dgreid@chromium.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      b4a91cf0
  17. 06 6月, 2012 1 次提交
  18. 19 5月, 2012 1 次提交
  19. 14 5月, 2012 1 次提交
  20. 10 5月, 2012 1 次提交
    • T
      ALSA: hda - Fix concurrent hash accesses · c3b6bcc2
      Takashi Iwai 提交于
      The amp and caps hashes aren't protected properly for concurrent
      accesses.  Protect them via a new mutex now.
      
      But it can't be so simple as originally thought: since the update of a
      hash table entry itself might trigger the power-up sequence which
      again accesses the hash table, we can't cover the whole function
      simply via mutex.  Thus the update part has to be split from the mutex
      and revalidated.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      c3b6bcc2
  21. 09 5月, 2012 4 次提交
    • T
      ALSA: hda - More robustify the power-up/down sequence · a2d96e77
      Takashi Iwai 提交于
      Check the power_transition up/down state instead of boolean bit, so
      that the power-up sequence can cancel the pending power-down work
      properly.  Also, by moving cancel_delayed_work_sync() before the
      actual power-up sequence, make sure that the delayed power-down is
      completed.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      a2d96e77
    • T
      ALSA: hda - Remove pre_resume and post_suspend ops · 607d4f7f
      Takashi Iwai 提交于
      Since the recent commit, the resume procedure is always performed at
      the resume time.  This makes the pre_resume hack for VREF mute LED on
      some HP laptops superfluous.  As this is the only user of pre_resume
      (and there is no user of post_suspend) ops, let's kill them again.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      607d4f7f
    • T
      ALSA: hda - Protect the power-saving count with spinlock · 5536c6d6
      Takashi Iwai 提交于
      To avoid some races.  Still not perfect, but now a bit safer.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      5536c6d6
    • T
      ALSA: hda - Always resume the codec immediately · 7f30830b
      Takashi Iwai 提交于
      This is a fix for the problem in commit 785f857d, the pop noise
      issue on some machines with ALC269.  The problem was the uninitialized
      state after the resume due to the delayed resume of the codec chips.
      In that commit, we tried to fix by forcibly putting the codec to D3 at
      suspend.  But, this still also leaves the uninitialized state after
      resume, and it _might_ be still problematic with some BIOS.  Since the
      commit turned out to regress another issues, we reverted it in the
      end.
      
      Now, in this fix, try to fix by turning on the codec immediately at
      the resume path.  We need to take care of the power-saving in this
      case.  When the device is woken up at the power-saved state, it should
      go power-saving again after the resume.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      7f30830b
  22. 07 4月, 2012 1 次提交
  23. 01 3月, 2012 1 次提交
    • T
      ALSA: hda - Add a fake mute feature · 3868137e
      Takashi Iwai 提交于
      Some codecs don't supply the mute amp-capabilities although the lowest
      volume gives the mute.  It'd be handy if the parser provides the mute
      mixers in such a case.
      
      This patch adds an extension amp-cap bit (which is used only in the
      driver) to represent the min volume = mute state.  Also modified the
      amp cache code to support the fake mute feature when this bit is set
      but the real mute bit is unset.
      
      In addition, conexant cx5051 parser uses this new feature to implement
      the missing mute controls.
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=42825
      
      Cc: <stable@kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      3868137e
  24. 13 2月, 2012 1 次提交
  25. 26 11月, 2011 1 次提交
    • T
      ALSA: hda - Supports more audio streams · 01b65bfb
      Takashi Iwai 提交于
      So far, the driver supports up to 10 streams.  This is a restriction in
      hda_intel.c and hda_codec.c: in the former, the fixed array size limits
      the amount, and in the latter, the fixed device-number assignment table
      (in get_empty_pcm_device()) limits the possibility.
      
      This patch reduces the restriction by
      - using linked list for managing PCM instances in hda_intel.c, and
      - assigning non-fixed device numbers for the extra devices
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      01b65bfb
  26. 16 11月, 2011 1 次提交
    • T
      ALSA: hda - Cache the jack-detection value · 1835a0f9
      Takashi Iwai 提交于
      Introduce a table containing the pins and their jack-detection states
      for avoiding the unnecessary verbs to check the pin status at each time.
      
      When the unsol event is enabled via snd_hda_jack_detect_enable(), it
      automatically adds the given NID to the table.  Then the driver supposes
      that the codec driver will set the dirty flag appropariately when an
      unsolicited event is invoked for that pin.
      
      The behavior for reading other pins that aren't registered in the table
      doesn't change.  Only the pins assigned to the table are cached, so far.
      
      In near futre, this table can be extended to use the central place for
      the unsolicited events of all pins, etc, and eventually include the
      jack-detect kcontrols that replace the current input-jack stuff.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      1835a0f9
  27. 10 11月, 2011 1 次提交
    • T
      ALSA: hda - Re-enable the check NO_PRESENCE misc bit · 2f451d2a
      Takashi Iwai 提交于
      We disabled the check of NO_PRESENCE bit of the default pin-config
      in commit f4419172 temporarily.  One problem was that the first
      implementation was wrong -- the bit after the shift must be checked.
      However, this would still give many regressions on machines with broken
      BIOS.  They set this bit wrongly even on active pins.
      
      A workaround is to check whether all pins contain this bit.  As far as
      I've checked, broken BIOSen set this bit on all pins, no matter whether
      active or not.  In such a case, the driver should ignore this bit check.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      2f451d2a
  28. 26 7月, 2011 2 次提交
    • T
      ALSA: hda - Allow codec-specific set_power_state ops · 4d7fbdbc
      Takashi Iwai 提交于
      The procedure for codec D-state change may have exceptional cases
      depending on the codec chip, such as a longer delay or suppressing D3.
      
      This patch adds a new codec ops, set_power_state() to override the system
      default function.  For ease of porting, snd_hda_codec_set_power_to_all()
      helper function is extracted from the default set_power_state() function.
      
      As an example, the Conexant codec-specific delay is removed from the
      default routine but moved to patch_conexant.c.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      4d7fbdbc
    • T
      ALSA: hda - Add post_suspend patch ops · e581f3db
      Takashi Iwai 提交于
      Add a new ops, post_suspend(), which is called after suspend() ops is
      performed.  This is called only in the case of the real PM suspend, and
      the codec driver can use this for further changing of D-state or
      clearing the LED, etc.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      e581f3db