1. 11 9月, 2018 1 次提交
  2. 30 8月, 2018 3 次提交
    • P
      ALSA: hda: move hda_codec.h to include/sound · be57bfff
      Pierre-Louis Bossart 提交于
      As suggested by Takashi, move this header file to make it easier
      to include from e.g. the Intel Skylake driver in follow-up patches
      Signed-off-by: NPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      be57bfff
    • T
      ALSA: hda - Fix cancel_work_sync() stall from jackpoll work · 16037643
      Takashi Iwai 提交于
      On AMD/ATI controllers, the HD-audio controller driver allows a bus
      reset upon the error recovery, and its procedure includes the
      cancellation of pending jack polling work as found in
      snd_hda_bus_codec_reset().  This works usually fine, but it becomes a
      problem when the reset happens from the jack poll work itself; then
      calling cancel_work_sync() from the work being processed tries to wait
      the finish endlessly.
      
      As a workaround, this patch adds the check of current_work() and
      applies the cancel_work_sync() only when it's not from the
      jackpoll_work.
      
      This doesn't fix the root cause of the reported error below, but at
      least, it eases the unexpected stall of the whole system.
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=200937
      Cc: <stable@vger.kernel.org>
      Cc: Lukas Wunner <lukas@wunner.de>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      16037643
    • T
      ALSA: hda - Clean up jackpoll_ms option handling · 3a182c84
      Takashi Iwai 提交于
      Currently the jackpoll_ms option value is passed indirectly by
      referring to an array in chip->jackpoll_ms although each card needs to
      see only the assigned value.  Also, the sanity check is done at each
      time in get_jackpoll_interval() although basically jackpoll_ms option
      is a read-only, hence we need to evaluate only once at probe time.
      
      This patch is the code simplification about the above points: the jack
      polling interval is directly set to chip->jackpoll_interval so that it
      can be simply copied to each codec.
      
      No functional change but only code reduction.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      3a182c84
  3. 28 8月, 2018 3 次提交
    • T
      ALSA: hda: Remove substream allocation/free ops · 193c7e14
      Takashi Iwai 提交于
      Since we dropped the memory page fiddling in the own allocators in
      hda_intel.c, the substream allocation and free ops in both hda_intel.c
      and hda_tegra.c became nothing but the simple calls of the standard
      snd_pcm_lib helpers.  As both are identical, there is no longer need
      for indirect calls via ops; it's a good opportunity for removing ops
      and simplifying the codes.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      193c7e14
    • T
      ALSA: hda: Use new non-cached allocation for non-snoop mode · fc478143
      Takashi Iwai 提交于
      Now the ALSA memory allocator helper supports the new non-cached
      pages, let's use the new type, SNDRV_DMA_TYPE_DEV_UC_SG, for HD-audio
      driver.  This allows us to reduce lots of codes.
      
      As another positive side-effect by this patch, the long-standing issue
      with non-snoop mode playing in the non-mmap mode is fixed.  The core
      memalloc helper does the proper pgprot setup for non-cached pages for
      vmap(), which was missing in the past.
      Reported-and-tested-by: NHans Hu <HansHu@zhaoxin.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      fc478143
    • T
      ALSA: hda: Check the non-cached stream buffers more explicitly · 78c9be61
      Takashi Iwai 提交于
      Introduce a new flag, uc_buffer, to indicate that the controller
      requires the non-cached pages for stream buffers, either as a
      chip-specific requirement or specified via snoop=0 option.
      This improves the code-readability.
      
      Also, this patch fixes the incorrect behavior for C-Media chip where
      the stream buffers were never handled as non-cached due to the check
      of driver_type even if you pass snoop=0 option.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      78c9be61
  4. 21 8月, 2018 1 次提交
  5. 16 8月, 2018 1 次提交
    • L
      ALSA: update dell-wmi mic-mute registration to new world order · 70b20dd7
      Linus Torvalds 提交于
      Commit c647f806 ("ALSA: hda - Allow multiple ADCs for mic mute LED
      controls") changed the return value of the snd_hda_gen_add_micmute_led()
      without actually updating the callers.
      
      Admittedly, almost no callers actually cared about the return value.
      But one call site very much did: the Dell wmi code.  It would see the
      registration return zero, which _used_ to mean "failed" but now means
      "success", and clear the dell_micmute_led_set_func pointer.
      
      End result: the successful registration would end up calling the Dell
      code that thought it had all failed, and call through a NULL pointer.
      
      To make matters worse, it ends up being a tail-call, and with the
      retpoline sequence you don't even see the caller (dell_micmute_update())
      in the stack trace, so the error ended up way less obvious than it
      should have been.
      
      Fixes: c647f806 "ALSA: hda - Allow multiple ADCs for mic mute LED controls"
      Cc: Takashi Iwai <tiwai@suse.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      70b20dd7
  6. 09 8月, 2018 11 次提交
  7. 06 8月, 2018 1 次提交
  8. 02 8月, 2018 1 次提交
  9. 29 7月, 2018 3 次提交
  10. 26 7月, 2018 2 次提交
    • T
      ALSA: hda - Fix a sparse warning about snd_ctl_elem_iface_t · ebd836ed
      Takashi Iwai 提交于
      The knew->iface field is in snd_ctl_elem_iface_t, which is with
      __bitwise, hence it can't be converted implicitly from integer.
      Give an explicit cast for the invalid type.
      
      Spotted by sparse:
        sound/pci/hda/hda_codec.c:3280:25: warning: restricted snd_ctl_elem_iface_t degrades to integer
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      ebd836ed
    • T
      ALSA: hda/ca0132 - Use NULL instead of 0 · bb86124c
      Takashi Iwai 提交于
      Use NULL for initializing the snd_kcontrol_new.tlv field, instead of
      0, as warned by sparse:
        sound/pci/hda/patch_ca0132.c:5519:22: warning: Using plain integer as NULL pointer
      
      Also, the driver does the same initialization twice, once for
      knew.tlv.c and another for knew.tlv.p while both point to the same
      address (these are union).  Drop the latter superfluous one.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      bb86124c
  11. 18 7月, 2018 4 次提交
    • T
      ALSA: hda/realtek - Yet another Clevo P950 quirk entry · f3d737b6
      Takashi Iwai 提交于
      The PCI SSID 1558:95e1 needs the same quirk for other Clevo P950
      models, too.  Otherwise no sound comes out of speakers.
      
      Bugzilla: https://bugzilla.opensuse.org/show_bug.cgi?id=1101143
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      f3d737b6
    • T
      ALSA: hda: Make audio component support more generic · a57942bf
      Takashi Iwai 提交于
      This is the final step for more generic support of DRM audio
      component.  The generic audio component code is now moved to its own
      file, and the symbols are renamed from snd_hac_i915_* to
      snd_hdac_acomp_*, respectively.  The generic code is enabled via the
      new kconfig, CONFIG_SND_HDA_COMPONENT, while CONFIG_SND_HDA_I915 is
      kept as the super-class.
      
      Along with the split, three new callbacks are added to audio_ops:
      pin2port is for providing the conversion between the pin number and
      the widget id, and master_bind/master_unbin are called at binding /
      unbinding the master component, respectively.  All these are optional,
      but used in i915 implementation and also other later implementations.
      
      A note about the new snd_hdac_acomp_init() function: there is a slight
      difference between this and the old snd_hdac_i915_init().  The latter
      (still) synchronizes with the master component binding, i.e. it
      assures that the relevant DRM component gets bound when it returns, or
      gives a negative error.  Meanwhile the new function doesn't
      synchronize but just leaves as is.  It's the responsibility by the
      caller's side to synchronize, or the caller may accept the
      asynchronous binding on the fly.
      
      v1->v2: Fix missing NULL check in master_bind/unbind
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      a57942bf
    • T
      ALSA: hda/i915: Associate audio component with devres · 82887c0b
      Takashi Iwai 提交于
      The HD-audio i915 binding code contains a single pointer, hdac_acomp,
      for allowing the access to audio component from the master bind/unbind
      callbacks.  This was needed because the callbacks pass only the device
      pointer and we can't guarantee the object type assigned to the drvdata
      (which is free for each controller driver implementation).
      And this implementation will be a problem if we support multiple
      components for different DRM drivers, not only i915.
      
      As a solution, allocate the audio component object via devres and
      associate it with the given device, so that the component callbacks
      can refer to it via devres_find().
      
      The removal of the object is still done half-manually via
      devres_destroy() to make the code consistent (although it may work
      without the explicit call).
      
      Also, the snd_hda_i915_register_notifier() had the reference to
      hdac_acomp as well.  In this patch, the corresponding code is removed
      by passing hdac_bus object to the function, too.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      82887c0b
    • T
      drm/i915: Split audio component to a generic type · ae891abe
      Takashi Iwai 提交于
      For allowing other drivers to use the DRM audio component, rename the
      i915_audio_component_* with drm_audio_component_*, and split the
      generic part into drm_audio_component.h.  The i915 specific stuff
      remains in struct i915_audio_component, which contains
      drm_audio_component as the base.
      
      The license of drm_audio_component.h is kept to MIT as same as the the
      original i915_component.h.
      
      This is a preliminary change for further development, and no
      functional changes by this patch itself, merely code-split and
      renames.
      
      v1->v2: Use SPDX for drm_audio_component.h, fix remaining i915
              argument in drm_audio_component.h
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      ae891abe
  12. 17 7月, 2018 1 次提交
    • J
      vga_switcheroo: set audio client id according to bound GPU id · 4aaf448f
      Jim Qu 提交于
      On modern laptop, there are more and more platforms
      have two GPUs, and each of them maybe have audio codec
      for HDMP/DP output. For some dGPU which is no output,
      audio codec usually is disabled.
      
      In currect HDA audio driver, it will set all codec as
      VGA_SWITCHEROO_DIS, the audio which is binded to UMA
      will be suspended if user use debugfs to contorl power
      
      In HDA driver side, it is difficult to know which GPU
      the audio has binded to. So set the bound gpu pci dev
      to vga_switcheroo.
      
      if the audio client is not the third registration, audio
      id will set in vga_switcheroo enable function. if the
      audio client is the last registration when vga_switcheroo
      _ready() get true, we should get audio client id from bound
      GPU directly.
      Signed-off-by: NJim Qu <Jim.Qu@amd.com>
      Reviewed-by: NLukas Wunner <lukas@wunner.de>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      4aaf448f
  13. 16 7月, 2018 3 次提交
  14. 12 7月, 2018 2 次提交
  15. 06 7月, 2018 1 次提交
  16. 02 7月, 2018 1 次提交
    • C
      ALSA: hda - Handle pm failure during hotplug · aaa23f86
      Chris Wilson 提交于
      Obtaining the runtime pm wakeref can fail, especially in a hotplug
      scenario where i915.ko has been unloaded. If we do not catch the
      failure, we end up with an unbalanced pm.
      
      v2 additions by tiwai:
      hdmi_present_sense() checks the return value and handle only a
      negative error case and bails out only if it's really still suspended.
      Also, snd_hda_power_down() is called at the error path so that the
      refcount is balanced.
      
      Along with it, the spec->pcm_lock is taken outside
      hdmi_present_sense() in the caller side, so that it won't cause
      deadlock at reentrace via runtime resume.
      
      v3 fix by tiwai:
      Missing linux/pm_runtime.h is included.
      
      References: 222bde03 ("ALSA: hda - Fix mutex deadlock at HDMI/DP hotplug")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      aaa23f86
  17. 28 6月, 2018 1 次提交