1. 03 3月, 2015 1 次提交
    • T
      ALSA: hda - Split snd_hda_build_pcms() · 1a4ba30c
      Takashi Iwai 提交于
      snd_hda_build_pcms() does actually three things: let the codec driver
      build up hda_pcm list, set the PCM default values, and call the
      attach_pcm bus ops for each hda_pcm instance.  The former two are
      basically independent from the bus implementation, so it'd make the
      code a bit more readable.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      1a4ba30c
  2. 26 2月, 2015 4 次提交
    • T
      ALSA: hda - Remove channel mode helper functions · 7e40b80d
      Takashi Iwai 提交于
      They are no longer used, let's kill them.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      7e40b80d
    • T
      ALSA: hda - Power down codec automatically at registration · 709949fb
      Takashi Iwai 提交于
      So far, we let the controller driver power down the all codecs at the
      end of probe.  But this can be done better in the codec's dev_register
      callback.  This results in the reduction of duplicated codes in each
      control driver.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      709949fb
    • T
      ALSA: hda - Replace bus pm_notify with the standard runtime PM framework · 55ed9cd1
      Takashi Iwai 提交于
      Now the final bit of runtime PM cleanup: instead of manual
      notification of the power up/down of the codec via hda_bus pm_notify
      ops, use the standard runtime PM feature.
      
      The child codec device will kick off the runtime PM of the parent
      (PCI) device upon suspend/resume automatically.  For managing whether
      the link can be really turned off, we use the bit flags
      bus->codec_powered instead of the earlier bus->power_keep_link_on.
      flag.  Each codec driver is responsible to set/clear the bit flag, and
      the controller device can be turned off only when all these bits are
      cleared.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      55ed9cd1
    • 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
  3. 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
  4. 20 2月, 2015 1 次提交
  5. 17 2月, 2015 2 次提交
  6. 27 11月, 2014 1 次提交
  7. 17 11月, 2014 1 次提交
  8. 29 10月, 2014 2 次提交
  9. 27 10月, 2014 1 次提交
  10. 21 10月, 2014 1 次提交
  11. 23 9月, 2014 1 次提交
  12. 19 8月, 2014 1 次提交
  13. 22 7月, 2014 1 次提交
  14. 30 6月, 2014 1 次提交
  15. 25 6月, 2014 1 次提交
  16. 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
  17. 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
  18. 19 2月, 2014 1 次提交
  19. 15 2月, 2014 1 次提交
  20. 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
  21. 07 2月, 2014 1 次提交
  22. 13 1月, 2014 1 次提交
  23. 19 12月, 2013 1 次提交
  24. 06 12月, 2013 1 次提交
  25. 29 11月, 2013 1 次提交
  26. 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
  27. 26 11月, 2013 2 次提交
    • T
      ALSA: hda - Disable runtime PM when EPSS is unavailable · 3e9bc58f
      Takashi Iwai 提交于
      According to Mengdong, we shouldn't enable runtime PM when a codec
      doesn't support EPSS, based on the experiences on Windows.
      We have already this check in HDMI codec drivers, but now apply it in
      general in hda_codec.c.
      
      Credit goes to Mengdong Lin <mengdong.lin@intel.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      3e9bc58f
    • T
      ALSA: hda - Refactor pm notification in hda_codec.c · a40e0a88
      Takashi Iwai 提交于
      No functional change.
      
      - codec->pm_down_notified flag is renamed to codec->pm_up_notified
        flag (and takes the reversed meaning), which is managed solely in
        hda_call_pm_notify() now.
      
      - The explicit call of hda_call_pm_notify() is moved into
        hda_keep_power_on().
      
      - Removed a redundant call of hda_call_pm_notify() in
        snd_hda_power_up(), as it's called in hda_call_codec_resume()
        anyway.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      a40e0a88