1. 26 2月, 2015 1 次提交
    • T
      ALSA: hda - Drop power_save value indirection in hda_bus · bb573928
      Takashi Iwai 提交于
      We used to pass the power_save option value to hda_bus via a given
      pointer.  This was needed to refer to the value from the HD-audio core
      side.  However, after the transition to the runtime PM, this is no
      longer needed.
      
      This patch drops the power_save value indirection in hda_bus above,
      and let the controller driver reprograms the autosuspend value
      explicitly by a new helper, snd_hda_set_power_save().  Without this
      call, the HD-audio core doesn't set up the autosuspend and flip the
      runtime PM.  (User may still be able to set up via sysfs, though.)
      
      Along with this change, the pointer argument of azx_bus_create() is
      dropped as well.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      bb573928
  2. 23 2月, 2015 3 次提交
    • T
      ALSA: hda - Use standard runtime PM for codec power-save control · cc72da7d
      Takashi Iwai 提交于
      Like the previous transition of suspend/resume, now move the
      power-save code to the standard runtime PM.  As usual for runtime PM,
      it's a bit tricky, but this simplified codes a lot in the end.
      
      For keeping the usage compatibility, power_save module option still
      controls the whole power-saving behavior on all codecs.  The value is
      translated to pm_runtime_*_autosuspend() and pm_runtime_allow() /
      pm_runtime_forbid() calls.
      
      snd_hda_power_up() and snd_hda_power_down() are translated to
      pm_runtime_get_sync() and pm_runtime_put_autosuspend(), respectively.
      Since we can do call pm_runtime_get_sync() more reliably, the sync
      version is used always and snd_hda_power_up_d3wait() is dropped.
      Another slight difference is that snd_hda_power_up()/down() don't call
      runtime_pm code during the suspend/resume transition phase.  Calling
      them there isn't safe unlike our own code, resulted in unexpected
      behavior (endless wakeups).
      
      The hda_power_count tracepoint was removed, as it doesn't match well
      with the new code.
      
      Last but not least, we need to set ignore_children flag in the parent
      dev.power field so that the runtime PM of the controller chip won't
      get confused.  The notification is still done in the bus pm_notify
      callback.  We'll get rid of this hack in the later patch.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      cc72da7d
    • T
      ALSA: hda - Move codec suspend/resume to codec driver · 59ed1ead
      Takashi Iwai 提交于
      This patch moves the suspend/resume mechanisms down to each codec
      driver level, as we have a proper codec driver bound on the bus now.
      Then we get the asynchronous PM gratis without fiddling much in the
      driver level.
      
      As a soft-landing transition, implement the common suspend/resume pm
      ops for hda_codec_driver and keep the each codec driver intact.  Only
      the callers of suspend/resume in the controller side (azx_suspend()
      and azx_resume()) are removed.
      
      Another involved place is azx_bus_reset() calling the temporary
      suspend and resume as a hackish method of bus reset.  The HD-audio
      core provide a helper function snd_hda_bus_reset() instead.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      59ed1ead
    • T
      ALSA: hda - Bind codecs via standard bus · d8a766a1
      Takashi Iwai 提交于
      Now we create the standard HD-audio bus (/sys/bus/hdaudio), and bind
      the codec driver with the codec device over there.  This is the first
      step of the whole transition so that the changes to each codec driver
      are kept as minimal as possible.
      
      Each codec driver needs to register hda_codec_driver struct containing
      the currently existing preset via the new helper macro
      module_hda_codec_driver().  The old hda_codec_preset_list is replaced
      with this infrastructure.  The generic parsers (for HDMI and other)
      are also included in the preset with the special IDs to bind
      uniquely.
      
      In HD-audio core side, the device binding code is split to
      hda_bind.c.  It provides the snd_hda_bus_type implementation to match
      the codec driver with the given codec vendor ID.  It also manages the
      module auto-loading by itself like before: when the matching isn't
      found, it tries to probe the corresponding codec modules, and finally
      falls back to the generic drivers.  (The special ID mentioned above is
      set at this stage.)
      
      The only visible change to outside is that the hdaudio sysfs entry now
      appears in /sys/bus/devices, not as a sound class device.
      
      More works to move the suspend/resume and remove ops will be
      (hopefully) done in later patches.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      d8a766a1
  3. 17 2月, 2015 2 次提交
  4. 19 8月, 2014 1 次提交
  5. 22 7月, 2014 1 次提交
  6. 25 6月, 2014 1 次提交
  7. 26 5月, 2014 1 次提交
  8. 25 2月, 2014 3 次提交
    • T
      ALSA: hda - Enable sysfs attributes without CONFIG_SND_HDA_RECONFIG · b989d044
      Takashi Iwai 提交于
      Some sysfs attributes like init_pin_configs or vendor_name are really
      basic and should be available no matter whether the codec driver is
      re-configurable or not.  Put them out of #ifdef
      CONFIG_SND_HDA_RECONFIG and allow the read-only accesses.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      b989d044
    • T
      ALSA: hda - Add sysfs to codec object, too · 648a8d27
      Takashi Iwai 提交于
      We have currently sysfs attributes for each hwdep, but basically these
      should belong to the codec itself, per se.  Let's add them to the
      codec object while keeping them for hwdep as is for compatibility.
      
      While we are at it, split the sysfs-related stuff into a separate
      source file, hda_sysfs.c, and keep only the stuff necessary for hwdep
      in hda_hwdep.c.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      648a8d27
    • T
      ALSA: hda - Create own device struct for each codec · 13aeaf68
      Takashi Iwai 提交于
      As the HD-audio is treated individually in each codec driver, it's
      more convenient to assign an own struct device to each codec object.
      Then we'll be able to use dev_err() more easily for each codec, for
      example.
      
      For achieving it, this patch just creates an object "hdaudioCxDy".
      It belongs to sound class instead of creating a new bus, just for
      simplicity, at this stage.  No pm ops is implemented in the device
      struct level but currently it's merely a container.  The PCM and hwdep
      devices are now children of this codec device.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      13aeaf68
  9. 29 1月, 2014 1 次提交
  10. 19 12月, 2013 1 次提交
    • T
      ALSA: hda - Make CONFIG_SND_HDA_CODEC_* tristate · 595fe1b7
      Takashi Iwai 提交于
      So far, CONFIG_SND_HDA_CODEC_* kconfigs have been booleans due to
      historical reasons.  The major reason was that the automatic codec
      driver probing wouldn't work if user sets a codec driver as a module
      while the controller driver as a built-in.  And, another reason was to
      avoid exporting symbols of the helper codes when all drivers are built
      in.
      
      But, this sort of "kindness" rather confuses people in the end,
      especially makes the config refinement via localmodconfig unhappy.
      Also, a codec module would still work if you re-bind the controller
      driver via sysfs (although it's no automatic loading), so there might
      be a slight use case.
      
      That said, better to let people fallen into a pitfall than being too
      smart and restrict something.  Let's make things straightforward: now
      all CONFIG_SND_HDA_CODEC_* become tristate, and all symbols exported
      unconditionally.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      595fe1b7
  11. 10 12月, 2013 1 次提交
  12. 06 12月, 2013 1 次提交
  13. 29 11月, 2013 1 次提交
  14. 27 11月, 2013 2 次提交
    • M
      ALSA: hda - resume codecs in parallel · 12edb893
      Mengdong Lin 提交于
      To reduce driver resume time, this patch resumes the codecs in parallel
      if there are multiple codecs on the bus.
      
      - The PM workqueue of bus is also used to parallel resuming multiple codecs.
      - The work item 'pm_work' is renamed to 'suspend_work' to parallel suspending
        codecs.
      - Add a work item 'resume_work' to parallel resuming codecs.
      Signed-off-by: NMengdong Lin <mengdong.lin@intel.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      12edb893
    • M
      ALSA: hda - suspend codecs in parallel · 0e24dbb7
      Mengdong Lin 提交于
      The time to suspend a single codec may be several hundreds of ms. When runtime
      power saving is disabled, driver suspend time can be long especially when there
      are more than one codec on the bus.
      
      To reduce driver suspend time, this patch creates a work queue for the bus, and
      suspends the codecs in parallel if there are multiple codecs on the bus.
      
      [fixed cosmetic issues by tiwai]
      Signed-off-by: NMengdong Lin <mengdong.lin@intel.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      0e24dbb7
  15. 26 11月, 2013 3 次提交
  16. 24 10月, 2013 1 次提交
    • T
      ALSA: hda - Fix mute LED on HP laptops in runtime suspend · 95f74c41
      Takashi Iwai 提交于
      When HP laptops with mute and mic-record LEDs go to runtime suspend,
      these LEDs are turned on forcibly no matter whether GPIO pis are on or
      off.  This strange behavior seems triggered by resetting the HD-audio
      bus link at azx_rutime_suspend().  So, just add a new hda_bus flag to
      avoid the link reset at runtime suspend and set it for these HP
      machines.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      95f74c41
  17. 27 8月, 2013 2 次提交
  18. 06 6月, 2013 2 次提交
    • T
      ALSA: hda - Don't take unresponsive D3 transition too serious · 63e51fd7
      Takashi Iwai 提交于
      When a codec is powered off, some systems don't respond properly after
      D3 FG transition, while the driver still expects the response and
      tries to fall back to different modes (polling and single-cmd).  When
      the fallback happens, the driver stays in that mode, and falling back
      to the single-cmd mode means it'll loose the unsol event handling,
      too.
      
      The unresponsiveness at D3 isn't too serious, thus this fallback is
      mostly superfluous.  We can gracefully ignore the error there so that
      the driver keeps the normal operation mode.
      
      This patch adds a new bit flag for codec read/write, set in the power
      transition stage, which is notified to the controller driver via a new
      bus->no_response_fallback flag.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      63e51fd7
    • T
      ALSA: hda - Introduce bit flags to snd_hda_codec_read/write() · e7ecc27e
      Takashi Iwai 提交于
      snd_hda_codec_read(), snd_hda_codec_write() & co take the argument
      "direct" that indicates whether the given NID is a direct reference or
      an indirect reference.  However, the indirect reference is practically
      unimplemented and never exists.  And moreover, we don't need the
      indication of indirect reference at this high level, as NID can be
      represented in 16bit values at this point.
      
      Meanwhile, there are some cases where it'd be nice to give some
      operational options to these functions.  So, we can reuse this
      argument as a new bit flag!  Pretty frugal, eh?
      
      All callers so far pass zero to this argument, thus there is no
      behavior change by this replacement.
      
      The real usage of this new bit option will be added in the following
      patches.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      e7ecc27e
  19. 05 4月, 2013 1 次提交
  20. 13 2月, 2013 1 次提交
    • T
      ALSA: hda - Fix broken workaround for HDMI/SPDIF conflicts · ea9b43ad
      Takashi Iwai 提交于
      The commit [dcda5806: ALSA: hda - Add workaround for conflicting
      IEC958 controls] introduced a workaround for cards that have both
      SPDIF and HDMI devices for giving device=1 to SPDIF control elements.
      It turned out, however, that this workaround doesn't work well -
      
      - The workaround checks only conflicts in a single codec, but SPDIF
        and HDMI are provided by multiple codecs in many cases, and
      
      - ALSA mixer abstraction doesn't care about the device number in ctl
        elements, thus you'll get errors from amixer such as
        % amixer scontrols -c 0
        ALSA lib simple_none.c:1551:(simple_add1) helem (MIXER,'IEC958
        Playback Switch',0,1,0) appears twice or more
        amixer: Mixer hw:0 load error: Invalid argument
      
      This patch fixes the previous broken workaround.  Instead of changing
      the device number of SPDIF ctl elements, shift the element indices of
      such controls up to 16.  Also, the conflict check is performed over
      all codecs found on the bus.
      
      HDMI devices will be put to dev=0,index=0 as before.  Only the
      conflicting SPDIF device is moved to a different place.  The new place
      of SPDIF device is supposed by the updated alsa-lib HDA-Intel.conf,
      respectively.
      Reported-by: NStephan Raue <stephan@openelec.tv>
      Reported-by: NAnssi Hannula <anssi.hannula@iki.fi>
      Cc: <stable@vger.kernel.org> [v3.8]
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      ea9b43ad
  21. 08 2月, 2013 2 次提交
    • M
      ALSA: hda - Support rereading widgets under the function group · a15d05db
      Mengdong Lin 提交于
      A codec may allow software to hide some unused pin/cvt widgets.
      
      Sometimes BIOS does not enable the hidden widgets properly although they are
      needed for the board. Thus the driver need to enable them as a board-specific
      fixup and the whole tree will change.
      
      This patch implements a common code for rereading codec widgets. So the fixup
      code can call it after enabling the hidden widgets.
      Signed-off-by: NMengdong Lin <mengdong.lin@intel.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      a15d05db
    • T
      ALSA: hda - Remove limit of widget connections · 4eea3091
      Takashi Iwai 提交于
      Currently we set the max number of connections to be 32, but there
      seems codec that gives longer connection lists like AD1988, and we see
      errors in proc output and else.  (Though, in the case of AD1988, it's
      a list of all codecs connected to a single vendor widget, so this must
      be something fishy, but it's still valid from the h/w design POV.)
      
      This patch tries to remove this restriction.  For efficiency, we still
      use the fixed size array in the parser, but takes a dynamic array when
      the size is reported to be greater than that.
      
      Now the fixed array size is found only in patch_hdmi.c, but it should
      be fine, as the codec itself can't support so many pins.
      Reported-by: NRaymond Yau <superquad.vortex2@gmail.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      4eea3091
  22. 25 1月, 2013 1 次提交
    • T
      ALSA: hda - Add power state filtering · 9419ab6b
      Takashi Iwai 提交于
      Add a hook to struct hda_codec for filtering the target power state of
      each widget when powering up/down.  The current hackish EAPD check is
      implemented as the default hook pointer, too.
      
      This allows codec drivers to implement own power filter.  In the
      upcoming changes, the generic parser will have the better power filter
      based on the active paths.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      9419ab6b
  23. 22 1月, 2013 1 次提交
  24. 12 1月, 2013 6 次提交