1. 03 3月, 2015 4 次提交
    • T
      ALSA: hda - Allocate hda_pcm objects dynamically · bbbc7e85
      Takashi Iwai 提交于
      So far, the hda_codec object kept the hda_pcm list in an array, and
      the codec driver was expected to assign the array.  However, this
      makes the object life cycle management harder, because the assigned
      array is freed at the codec driver detach while it might be still
      accessed by the opened streams.
      
      In this patch, we allocate each hda_pcm object dynamically and manage
      it as a linked list.  Each object has a kref refcount, and both the
      codec driver binder and the PCM open/close touches it, so that the
      object won't be freed while in use.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      bbbc7e85
    • T
      ALSA: hda - Remove superfluous memory allocation error messages · f4de8fe6
      Takashi Iwai 提交于
      The memory allocators should have already given the kernel warning
      messages, thus we don't have to annoy again.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      f4de8fe6
    • T
      ALSA: hda - Add card field to hda_codec struct · 6efdd851
      Takashi Iwai 提交于
      Allow the codec object to have an individual card pointer.  Not only
      this simplifies the redirections in many places, also this will allow
      us to make each codec assigned to a different card object.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      6efdd851
    • 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 6 次提交
    • T
      ALSA: hda - Clear pcm pointer assigned to hda_pcm at device removal · 820cc6cf
      Takashi Iwai 提交于
      We leave the pcm field of struct hda_pcm at removal of each device, so
      far.  This hasn't been a problem since unbinding the codec driver
      isn't supposed to happen and another route via snd_hda_codec_reset()
      clears all the once.  However, for a proper unbind implementation, we
      need to care about it.
      
      This patch does the thing above properly:
      
      - Include struct hda_pcm pointer instead of struct hda_pcm_stream
        pointers in struct azx_dev.  This allows us to point the hda_pcm
        object at dev_free callback.
      
      - Introduce to_hda_pcm_stream() macro for better readability.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      820cc6cf
    • 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 - Set parent of input beep devices · 777ae194
      Takashi Iwai 提交于
      Set the card device as the parent like other sound devices instead of
      leaving it empty.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      777ae194
    • 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 5 次提交
    • 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
    • T
      ALSA: hda - Decouple PCM and hwdep devices from codec object · 327ef4f0
      Takashi Iwai 提交于
      This is a preliminary patch for the hda_bus implementation, removing
      the parent device setup to codec device.  Since the bus and the class
      devices can't be crossed over, leave the sound devices to the default
      parent device as is.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      327ef4f0
    • T
      ALSA: hda - Add pin configs for ASUS mobo with IDT 92HD73XX codec · 6426460e
      Takashi Iwai 提交于
      BIOS doesn't seem to set up pins for 5.1 and the SPDIF out, so we need
      to give explicitly here.
      Reported-and-tested-by: NMisan Thropos <misanthropos@gmx.de>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      6426460e
  4. 21 2月, 2015 1 次提交
  5. 20 2月, 2015 5 次提交
  6. 17 2月, 2015 2 次提交
  7. 14 2月, 2015 1 次提交
  8. 13 2月, 2015 1 次提交
  9. 10 2月, 2015 1 次提交
  10. 09 2月, 2015 1 次提交
  11. 06 2月, 2015 1 次提交
  12. 02 2月, 2015 2 次提交
    • T
      ALSA: pcm: Embed struct device · ef46c7af
      Takashi Iwai 提交于
      Like previous patches, at this time we embed the struct device into
      PCM object.  However, this needs a bit more caution: struct snd_pcm
      doesn't own one device but two, for both playback and capture!  Thus
      not struct snd_pcm but struct snd_pcm_str object contains the device.
      
      Along with this change, pcm->dev field is dropped for avoiding
      confusion.  It was meant to point to a non-standard parent.  But,
      since now we can touch each struct device directly, we can manipulate
      the parent field easily there, too.
      Reviewed-by: NJaroslav Kysela <perex@perex.cz>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      ef46c7af
    • T
      ALSA: hwdep: Embed struct device · 7b461600
      Takashi Iwai 提交于
      Like the previous patch, this one embeds the device object into hwdep
      object.  For a proper object lifecycle, it's freed in the release
      callback.
      
      This also allows us to create sysfs entries via passing to the groups
      field of the device without explicit function calls.  Since each
      driver can see the device and touch its groups field directly, we
      don't need to delegate in hwdep core any longer.  So, remove the
      groups field from snd_hwdep, and let the user (in this case only
      hda_hwdep.c) modify the device groups.
      Reviewed-by: NJaroslav Kysela <perex@perex.cz>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      7b461600
  13. 20 1月, 2015 1 次提交
  14. 15 1月, 2015 2 次提交
  15. 12 1月, 2015 3 次提交
    • I
      ALSA: hda: add component support · d7055bd6
      Imre Deak 提交于
      Register a component master to be used to interface with the i915
      driver. This is meant to replace the current interface which is based on
      module symbol lookups.
      
      Note that currently we keep the existing behavior and pin the i915
      module while the hda driver is loaded. Using the component interface
      allows us to remove this dependency once support for dynamically
      enabling / disabling the HDMI functionality is added to the driver.
      
      v2:
      - change roles between the hda and i915 components (Daniel)
      v3:
      - rename display_component to audio_component (Daniel)
      v4:
      - move removal of i915_powerwell.h from this patch to the next (Takashi)
      - request_module fails if module support isn't enabled, so ignore
        any error it returns and depend on the following NULL check of the
        component ops (Takashi)
      - change over to using dev_* instead of pr_* (Takashi)
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NTakashi Iwai <tiwai@suse.de>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      d7055bd6
    • I
      ALSA: hda: pass intel_hda to all i915 interface functions · 926981ae
      Imre Deak 提交于
      chip is already passed to most of the i915 interface functions. Unify
      the interface by passing intel_hda instead of chip and passing it to all
      functions. Passing intel_hda instead of chip makes more sense since this
      is an intel specific interface. Also in an upcoming patch we will use
      intel_hda in all of these functions so by passing intel_hda we can save
      on some pointer casts from chip to intel_hda.
      
      This will be needed by an upcoming patch adding component support.
      
      No functional change.
      
      v2-3: unchanged
      v4:
      - pass intel_hda instead of chip
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NTakashi Iwai <tiwai@suse.de>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      926981ae
    • I
      ALSA: hda: export struct hda_intel · 347de1f8
      Imre Deak 提交于
      This struct will be needed by the component code added in an upcoming
      patch, so export it into a new hda_intel.h file. At the same time also
      merge hda_i915.h into this new header, there is no reason to keep two
      separate intel specific header file.
      Suggested-by: NTakashi Iwai <tiwai@suse.de>
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NTakashi Iwai <tiwai@suse.de>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      347de1f8
  16. 11 1月, 2015 1 次提交
  17. 09 1月, 2015 1 次提交
    • T
      ALSA: hda: Simplify PM callbacks · e2a711f1
      Takashi Iwai 提交于
      This is a similar cleanup like the commit [3db084fd: ALSA: fm801:
      PCI core handles power state for us].
      
      Since pci_set_power_state(), pci_save_state() and pci_restore_state()
      are already done in the PCI core side, so we don't need to it doubly.
      
      Also, pci_enable_device(), pci_disable_device() and pci_set_master()
      calls in PM callbacks are superfluous nowadays, too, so get rid of
      them as well.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      e2a711f1
  18. 07 1月, 2015 2 次提交