1. 05 5月, 2015 1 次提交
    • L
      ALSA: hda - reset display codec when power on · 0a673521
      Lu, Han 提交于
      In SKL, HDMI/DP codec and PCH HD Audio Controller are in different power wells,
      so it's necessary to reset display audio codecs when power well on, otherwise
      display audio codecs will disappear when resume from low power state.
      Reset steps when power on:
          enable codec wakeup -> azx_init_chip() -> disable codec wakeup
      
      The callback for codec wakeup enable/disable is in drivers/gpu/drm/i915/.
      Signed-off-by: NLu, Han <han.lu@intel.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      0a673521
  2. 30 4月, 2015 1 次提交
  3. 29 4月, 2015 3 次提交
    • M
      ALSA: hda - remove controller dependency on i915 power well for Baytrail/Braswell · 2bd1f73f
      Mengdong Lin 提交于
      For Baytrail (Valleyview) and Braswell (Cherryview), only the HDMI codec is
      in the display power well while the HD-A controller isn't. So the controller
      flag 'need_i915_power' is not set to release the display power after probe,
      and the codec flag 'link_power_control" is set to request/release the display
      power via bus link_power ops.
      Signed-off-by: NMengdong Lin <mengdong.lin@intel.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      2bd1f73f
    • M
      ALSA: hda - divide controller and codec dependency on i915 gfx power well · 795614dd
      Mengdong Lin 提交于
      This patch can improve power saving for Intel platforms on which only the
      display audio codec is in the shared i915 power well:
      
      - Add a flag "need_i915_power" to indicate whether the controller needs the
        i915 power well.
      
      - The driver will always request the i915 power when probing the controller
        and codecs if AZX_DCAPS_I915_POWERWELL is set (either the controller or a
        codec needs this power).
      
      - If the controller needs the i915 power, the power will be held after probe
        until the controller is runtime suspended or S3. If the controller doesn't
        need the power, the power will be released the after probe, and a codec
        that needs the power can request/release the power via bus link_power ops.
      
      Background:
      - For Haswell/Broadwell, which has a separate HD-A controller for display audio,
        both the controller and the display codec are in the i915 power well.
      
      - For Baytrail/Braswell, the display and analog audio share the same HDA
        controller and link, and only the display codec is in the i915 power well.
      
      - For Skylake, the display and analog audio share the same HDA controller but
        use separate links. Only the display codec is in the i915 power well. And in
        legacy mode we take the two links as one. So it can follow Baytrail/Braswell.
      Signed-off-by: NMengdong Lin <mengdong.lin@intel.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      795614dd
    • M
      ALSA: hda - implement link_power ops for i915 display power control · 17eccb27
      Mengdong Lin 提交于
      This patch implements the bus link_power ops to request/release i915 display
      power well. It can be used by the display codec which shares this power well
      with GPU on Intel platforms.
      Signed-off-by: NMengdong Lin <mengdong.lin@intel.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      17eccb27
  4. 21 4月, 2015 1 次提交
    • M
      ALSA: hda - add AZX_DCAPS_I915_POWERWELL to Baytrail · 40cc2392
      Mengdong Lin 提交于
      This patch addes AZX_DCAPS_I915_POWERWELL to BYT (Baytrail).
      
      Like Braswell and Skylake, the HDMI codec on Bytrail is also in the shared
      power well with GPU. This power well must be turned on before we reset link
      to probe the codec, to avoid communication failure with the codec.
      
      The side effect is that this power is always ON in S0 because the BYT HDMI
      codec does not support EPSS or D3ClkStop and so the controller doesn't enter
      D3 at runtime, and the HDMI codec and analog codec share a single physical
      HD-A link and so we cannot reset the HD-A link freely when we re-enable the
      power to use the HDMI codec.
      
      Next step is to test if an AGP reset or double AGP reset on BYT HDMI codec is
      okay to bring the HDMI codec back to a functional state after restoring the
      power. If okay, we can bind the power on/off with the HDMI codec PM without
      interrupting the analog audio.
      Signed-off-by: NMengdong Lin <mengdong.lin@intel.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      40cc2392
  5. 16 4月, 2015 7 次提交
  6. 07 4月, 2015 1 次提交
  7. 26 3月, 2015 1 次提交
  8. 23 3月, 2015 1 次提交
    • T
      ALSA: hda - Move some codes up to hdac_bus struct · d068ebc2
      Takashi Iwai 提交于
      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: NTakashi Iwai <tiwai@suse.de>
      d068ebc2
  9. 13 3月, 2015 1 次提交
  10. 03 3月, 2015 3 次提交
  11. 26 2月, 2015 3 次提交
    • 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
  12. 25 2月, 2015 1 次提交
  13. 23 2月, 2015 2 次提交
    • 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
  14. 20 2月, 2015 4 次提交
  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. 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
  17. 04 1月, 2015 1 次提交
  18. 26 12月, 2014 1 次提交
  19. 13 12月, 2014 1 次提交
  20. 03 12月, 2014 2 次提交
    • T
      ALSA: hda - Drop AZX_DCAPS_ALIGN_BUFSIZE · 103884a3
      Takashi Iwai 提交于
      We introduced AZX_DCAPS_ALIGN_BUFSIZE to explicity show that the
      controller needs the alignment, with a slight hope that the buffer
      size alignment will be disabled as default in future.  But the reality
      tells that most chips need the buffer size alignment, and it'll be
      likely enabled in future, too.
      
      This patch drops AZX_DCAPS_ALIGN_BUFSIZE to give back one more
      precious DCAPS bit for future use.  At the same time, rename
      AZX_DCAPS_BUFSIZE with AZX_DCAPS_NO_ALIGN_BUFSIZE for avoiding
      confusion.
      
      AZX_DCAPS_ALIGN_BUFSIZE are still kept (but commented out) in each
      DCAPS presets for a purpose as markers.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      103884a3
    • T
      ALSA: hda - Define the DCAPS preset for the old Intel chipsets · b42b4afb
      Takashi Iwai 提交于
      Just for improving readability.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      b42b4afb
  21. 28 11月, 2014 1 次提交
    • T
      ALSA: hda - Allow forcibly enabling/disabling snoop · 7c732015
      Takashi Iwai 提交于
      User can pass snoop option to enable/disable the snoop behavior, but
      currently azx_check_snoop_available() always turns it off for some
      devices.  For better debuggability, change the parameter as bint, and
      allow user to enable/disable forcibly the snoop when specified via the
      module option.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      7c732015