1. 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
  2. 20 2月, 2015 1 次提交
  3. 17 2月, 2015 2 次提交
  4. 27 11月, 2014 1 次提交
  5. 17 11月, 2014 1 次提交
  6. 29 10月, 2014 2 次提交
  7. 27 10月, 2014 1 次提交
  8. 21 10月, 2014 1 次提交
  9. 23 9月, 2014 1 次提交
  10. 19 8月, 2014 1 次提交
  11. 22 7月, 2014 1 次提交
  12. 30 6月, 2014 1 次提交
  13. 25 6月, 2014 1 次提交
  14. 28 2月, 2014 1 次提交
    • T
      ALSA: hda - Fix registration of beep input device · d604b399
      Takashi Iwai 提交于
      The beep input device is registered via input_register_device(), but
      this is called in snd_hda_attach_beep_device() where the sound devices
      aren't registered yet.  This leads to the binding to non-existing
      object, thus results in failure.  And, even if the binding worked
      (against the PCI object), it's still racy; the input device appears
      before the sound objects.
      
      For fixing this, register the input device properly at dev_register
      ops of the codec object it's bound with.  Also, call
      snd_hda_detach_beep_device() at dev_disconnection so that it's
      detached at the right timing.  As a bonus, since it's called in the
      codec's ops, we can get rid of the further call from the other codec
      drivers.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      d604b399
  15. 25 2月, 2014 5 次提交
    • T
      ALSA: hda - Replace with standard printk · 4e76a883
      Takashi Iwai 提交于
      Use dev_err() and co for messages from HD-audio controller and codec
      drivers.  The codec drivers are mostly bound with codec objects, so
      some helper macros, codec_err(), codec_info(), etc, are provided.
      They merely wrap the corresponding dev_xxx().
      
      There are a few places still calling snd_printk() and its variants
      as they are called without the codec or device context.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      4e76a883
    • 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
    • T
      ALSA: hda - Manage each codec instance individually · 2565c899
      Takashi Iwai 提交于
      Now each snd_hda_codec instance is managed via the device chain, the
      registration and release are done by its callback instead of calling
      from bus.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      2565c899
    • T
      ALSA: Create sysfs attribute files via groups · caa751ba
      Takashi Iwai 提交于
      Instead of calling each time device_create_file(), create the groups
      of sysfs attribute files at once in a normal way.  Add a new helper
      function, snd_get_device(), to return the associated device object,
      so that we can handle the sysfs addition locally.
      
      Since the sysfs file addition is done differently now,
      snd_add_device_sysfs_file() helper function is removed.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      caa751ba
  16. 19 2月, 2014 1 次提交
  17. 15 2月, 2014 1 次提交
  18. 10 2月, 2014 1 次提交
    • T
      ALSA: hda - Fix undefined symbol due to builtin/module mixup · ef8e39b5
      Takashi Iwai 提交于
      Even after the fix for leftover kconfig handling (commit f8f1becf),
      the current code still doesn't handle properly the builtin/module
      mixup case between the core snd-hda-codec and other codec drivers.
      For example, when CONFIG_SND_HDA_INTEL=y and
      CONFIG_SND_HDA_CODEC_HDMI=m, it'll end up with an unresolved symbol
      snd_hda_parse_hdmi_codec.  This patch fixes the issue.
      
      Now codec->parser points to the parser object *only* when a module
      (either generic or HDMI parser) is loaded and bound.  When a builtin
      symbol is used, codec->parser still points to NULL.  This is the
      difference from the previous versions.
      
      Fixes: f8f1becf ('ALSA: hda - Fix leftover ifdef checks after modularization')
      Reported-by: NFengguang Wu <fengguang.wu@intel.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      ef8e39b5
  19. 07 2月, 2014 1 次提交
  20. 13 1月, 2014 1 次提交
  21. 19 12月, 2013 1 次提交
  22. 06 12月, 2013 1 次提交
  23. 29 11月, 2013 1 次提交
  24. 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
  25. 26 11月, 2013 4 次提交
  26. 20 11月, 2013 1 次提交
    • T
      ALSA: hda - Fix unbalanced runtime PM notification at resume · 0fc28fc0
      Takashi Iwai 提交于
      When a codec is resumed, it keeps the power on while the resuming
      phase via hda_keep_power_on(), then turns down via
      snd_hda_power_down().  At that point, snd_hda_power_down() notifies
      the power down to the controller, and this may confuse the refcount if
      the codec was already powered up before the resume.
      
      In the end result, the controller goes to runtime suspend even before
      the codec is kicked off to the power save, and the communication
      stalls happens.
      
      The fix is to add the power-up notification together with
      hda_keep_power_on(), and clears the flag appropriately.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      0fc28fc0
  27. 14 11月, 2013 1 次提交
    • T
      ALSA: hda - Don't clear the power state at snd_hda_codec_reset() · d183b4fc
      Takashi Iwai 提交于
      snd_hda_codec_reset() is called either in resetting the whole setup at
      error paths or hwdep clear/reconfig sysfs triggers.  But all of these
      don't assume that the power has to be off, rather they want to keep
      the power state unchanged (e.g. reconfig_codec() calls the power
      up/down by itself).  Thus, unconditionally clearing the power state in
      snd_hda_codec_reset() leads to the inconsistency, confuses the further
      operation.   This patch gets rid of the lines doing that bad thing.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      d183b4fc
  28. 05 11月, 2013 1 次提交