An error occurred fetching the project authors.
  1. 25 Mar, 2015 1 commit
  2. 23 Mar, 2015 4 commits
    • Takashi Iwai's avatar
      ALSA: hda - Fix possible runtime PM refcount unbalance · c4c2533f
      Takashi Iwai authored
      When the driver is unloaded before the codec is bound, it still keeps
      the runtime PM refcount up, and results in the unbalance.  This patch
      covers these cases by introducing a flag indicating the runtime PM
      initialization and handling the codec registration procedure more
      properly.  It also fixes the missing input beep device as a gratis,
      too.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      c4c2533f
    • Takashi Iwai's avatar
      ALSA: hda - Move a part of hda_codec stuff into hdac_device · 7639a06c
      Takashi Iwai authored
      Now some codes and functionalities of hda_codec struct are moved to
      hdac_device struct.  A few basic attributes like the codec address,
      vendor ID number, FG numbers, etc are moved to hdac_device, and they
      are accessed like codec->core.addr.  The basic verb exec functions are
      moved, too.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      7639a06c
    • Takashi Iwai's avatar
      ALSA: hda - Move some codes up to hdac_bus struct · d068ebc2
      Takashi Iwai authored
      A few basic codes for communicating over HD-audio bus are moved to
      struct hdac_bus now.  It has only command and get_response ops in
      addition to the unsolicited event handling.
      
      Note that the codec-side tracing support is disabled temporarily
      during this transition due to the code shuffling.  It will be
      re-enabled later once when all pieces are settled down.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      d068ebc2
    • Takashi Iwai's avatar
      ALSA: hda - Make snd_hda_bus_type public · e3d280fc
      Takashi Iwai authored
      Define the common hd-audio driver and device types to bind over
      snd_hda_bus_type publicly.  This allows to implement other type of
      device and driver code over hd-audio bus.
      
      Now both struct hda_codec and struct hda_codec_driver inherit these
      new struct hdac_device and struct hdac_driver, respectively.
      
      The bus registration is done in subsys_initcall() to assure it
      before any other driver registrations.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      e3d280fc
  3. 20 Mar, 2015 1 commit
  4. 18 Mar, 2015 1 commit
    • Takashi Iwai's avatar
      ALSA: hda - Support advanced power state controls · e6feb5d0
      Takashi Iwai authored
      This patch enables the finer power state control of each widget
      depending on the jack plug state and streaming state in addition to
      the existing power_down_unused power optimization.  The new feature is
      enabled only when codec->power_mgmt flag is set.
      
      Two new flags, pin_enabled and stream_enabled, are introduced in
      nid_path struct for marking the two individual power states: the pin
      plug/unplug and DAC/ADC stream, respectively.  They can be set
      statically in case they are static routes (e.g. some mixer paths),
      too.
      
      The power up and down events for each pin are triggered via the
      standard hda_jack table.  The call order is hard-coded, relying on the
      current implementation of jack event chain (a la FILO/stack order).
      
      One point to be dealt carefully is that DAC/ADC cannot be powered
      on/off while streaming.  They are pinned as long as the stream is
      running.  For controlling the power of DAC/ADC, a new patch_ops is
      added.  The generic parser provides the default callback for that.
      
      As of this patch, only IDT/Sigmatel codec driver enables the flag.
      The support on other codecs will follow.
      
      An assumption we made in this code is that the widget state (e.g. amp,
      pinctl, connections) remains after the widget power transition (not
      about FG power transition).  This is true for IDT codecs, at least.
      But if the widget state is lost at widget power transition, we'd need
      to implement additional code to sync the cached amp/verbs for the
      specific NID.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      e6feb5d0
  5. 13 Mar, 2015 1 commit
  6. 03 Mar, 2015 6 commits
    • Takashi Iwai's avatar
      ALSA: hda - Use standard workqueue for unsol and jack events · 2f35c630
      Takashi Iwai authored
      The events that are handled by HD-audio drivers are no frequent and
      urgent ones, so we can use the standard workqueue without any problem
      nowadays.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      2f35c630
    • Takashi Iwai's avatar
      ALSA: hda - Build PCMs and controls at codec driver probe · bcd96557
      Takashi Iwai authored
      This makes the code flow easier -- instead of the controller driver
      calling snd_hda_build_pcms() and snd_hda_build_controls() explicitly,
      the codec driver itself builds PCMs and controls at probe time.  Then
      the controller driver only needs to call snd_card_register().
      
      Also, this allows us the full bind/unbind control, too.  Even when a
      codec driver is bound later, it automatically registers the new PCM
      and controls by itself.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      bcd96557
    • Takashi Iwai's avatar
      ALSA: hda - Implement unbind more safely · 9a6246ff
      Takashi Iwai authored
      Now we have all pieces ready, and put them into places:
      - add the hda_pcm refcount to azx_pcm_open() and azx_pcm_close(),
      - call the most of cleanup code in hda_codec_reset() from the codec
        driver remove,
      - call the same code also from the hda_codec object free.
      
      Then the codec driver can be unbound more safely now.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      9a6246ff
    • Takashi Iwai's avatar
      ALSA: hda - Allocate hda_pcm objects dynamically · bbbc7e85
      Takashi Iwai authored
      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: default avatarTakashi Iwai <tiwai@suse.de>
      bbbc7e85
    • Takashi Iwai's avatar
      ALSA: hda - Add card field to hda_codec struct · 6efdd851
      Takashi Iwai authored
      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: default avatarTakashi Iwai <tiwai@suse.de>
      6efdd851
    • Takashi Iwai's avatar
      ALSA: hda - Split snd_hda_build_pcms() · 1a4ba30c
      Takashi Iwai authored
      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: default avatarTakashi Iwai <tiwai@suse.de>
      1a4ba30c
  7. 26 Feb, 2015 2 commits
    • Takashi Iwai's avatar
      ALSA: hda - Replace bus pm_notify with the standard runtime PM framework · 55ed9cd1
      Takashi Iwai authored
      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: default avatarTakashi Iwai <tiwai@suse.de>
      55ed9cd1
    • Takashi Iwai's avatar
      ALSA: hda - Drop power_save value indirection in hda_bus · bb573928
      Takashi Iwai authored
      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: default avatarTakashi Iwai <tiwai@suse.de>
      bb573928
  8. 23 Feb, 2015 3 commits
    • Takashi Iwai's avatar
      ALSA: hda - Use standard runtime PM for codec power-save control · cc72da7d
      Takashi Iwai authored
      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: default avatarTakashi Iwai <tiwai@suse.de>
      cc72da7d
    • Takashi Iwai's avatar
      ALSA: hda - Move codec suspend/resume to codec driver · 59ed1ead
      Takashi Iwai authored
      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: default avatarTakashi Iwai <tiwai@suse.de>
      59ed1ead
    • Takashi Iwai's avatar
      ALSA: hda - Bind codecs via standard bus · d8a766a1
      Takashi Iwai authored
      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: default avatarTakashi Iwai <tiwai@suse.de>
      d8a766a1
  9. 17 Feb, 2015 2 commits
  10. 19 Aug, 2014 1 commit
  11. 22 Jul, 2014 1 commit
  12. 25 Jun, 2014 1 commit
  13. 26 May, 2014 1 commit
  14. 25 Feb, 2014 3 commits
    • Takashi Iwai's avatar
      ALSA: hda - Enable sysfs attributes without CONFIG_SND_HDA_RECONFIG · b989d044
      Takashi Iwai authored
      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: default avatarTakashi Iwai <tiwai@suse.de>
      b989d044
    • Takashi Iwai's avatar
      ALSA: hda - Add sysfs to codec object, too · 648a8d27
      Takashi Iwai authored
      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: default avatarTakashi Iwai <tiwai@suse.de>
      648a8d27
    • Takashi Iwai's avatar
      ALSA: hda - Create own device struct for each codec · 13aeaf68
      Takashi Iwai authored
      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: default avatarTakashi Iwai <tiwai@suse.de>
      13aeaf68
  15. 29 Jan, 2014 1 commit
  16. 19 Dec, 2013 1 commit
    • Takashi Iwai's avatar
      ALSA: hda - Make CONFIG_SND_HDA_CODEC_* tristate · 595fe1b7
      Takashi Iwai authored
      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: default avatarTakashi Iwai <tiwai@suse.de>
      595fe1b7
  17. 09 Dec, 2013 1 commit
  18. 06 Dec, 2013 1 commit
  19. 29 Nov, 2013 1 commit
  20. 27 Nov, 2013 2 commits
    • Mengdong Lin's avatar
      ALSA: hda - resume codecs in parallel · 12edb893
      Mengdong Lin authored
      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: default avatarMengdong Lin <mengdong.lin@intel.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      12edb893
    • Mengdong Lin's avatar
      ALSA: hda - suspend codecs in parallel · 0e24dbb7
      Mengdong Lin authored
      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: default avatarMengdong Lin <mengdong.lin@intel.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      0e24dbb7
  21. 26 Nov, 2013 3 commits
  22. 24 Oct, 2013 1 commit
    • Takashi Iwai's avatar
      ALSA: hda - Fix mute LED on HP laptops in runtime suspend · 95f74c41
      Takashi Iwai authored
      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: default avatarTakashi Iwai <tiwai@suse.de>
      95f74c41
  23. 27 Aug, 2013 1 commit