1. 08 8月, 2019 1 次提交
    • T
      ALSA: hda: Direct MMIO accesses · 19abfefd
      Takashi Iwai 提交于
      HD-audio drivers access to the mmio registers indirectly via the
      corresponding bus->io_ops callbacks.  This is because some platform
      (notably Tegra SoC) requires the word-aligned access.  But it's rather
      a rare case, and other platforms suffer from the penalties by indirect
      calls unnecessarily.
      
      This patch is an attempt to optimize and cleanup for this situation.
      Now the special aligned access is used only when a new kconfig
      CONFIG_SND_HDA_ALIGNED_MMIO is set.  And the HD-audio core itself
      provides the aligned MMIO access helpers instead of the driver side.
      If Kconfig isn't set (as default), the standard helpers like readl()
      or writel() are used directly.
      
      A couple of places in ASoC Intel drivers have the access via io_ops
      reg_writel(), and they are replaced with the direct writel() calls.
      
      And now with this patch, the whole bus->io_ops becomes empty, so it's
      dropped completely.  The bus initialization functions are changed
      accordingly as well to drop the whole bus->io_ops.
      Reviewed-by: NPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      19abfefd
  2. 07 8月, 2019 1 次提交
    • T
      ALSA: hda - Workaround for crackled sound on AMD controller (1022:1457) · c02f77d3
      Takashi Iwai 提交于
      A long-time problem on the recent AMD chip (X370, X470, B450, etc with
      PCI ID 1022:1457) with Realtek codecs is the crackled or distorted
      sound for capture streams, as well as occasional playback hiccups.
      After lengthy debugging sessions, the workarounds we've found are like
      the following:
      
      - Set up the proper driver caps for this controller, similar as the
        other AMD controller.
      
      - Correct the DMA position reporting with the fixed FIFO size, which
        is similar like as workaround used for VIA chip set.
      
      - Even after the position correction, PulseAudio still shows
        mysterious stalls of playback streams when a capture is triggered in
        timer-scheduled mode.  Since we have no clear way to eliminate the
        stall, pass the BATCH PCM flag for PA to suppress the tsched mode as
        a temporary workaround.
      
      This patch implements the workarounds.  For the driver caps, it
      defines a new preset, AXZ_DCAPS_PRESET_AMD_SB.  It enables the FIFO-
      corrected position reporting (corresponding to the new position_fix=6)
      and enforces the SNDRV_PCM_INFO_BATCH flag.
      
      Note that the current implementation is merely a workaround.
      Hopefully we'll find a better alternative in future, especially about
      removing the BATCH flag hack again.
      
      BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=195303
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      c02f77d3
  3. 31 5月, 2019 1 次提交
    • T
      treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 · c942fddf
      Thomas Gleixner 提交于
      Based on 3 normalized pattern(s):
      
        this program is free software you can redistribute it and or modify
        it under the terms of the gnu general public license as published by
        the free software foundation either version 2 of the license or at
        your option any later version this program is distributed in the
        hope that it will be useful but without any warranty without even
        the implied warranty of merchantability or fitness for a particular
        purpose see the gnu general public license for more details
      
        this program is free software you can redistribute it and or modify
        it under the terms of the gnu general public license as published by
        the free software foundation either version 2 of the license or at
        your option any later version [author] [kishon] [vijay] [abraham]
        [i] [kishon]@[ti] [com] this program is distributed in the hope that
        it will be useful but without any warranty without even the implied
        warranty of merchantability or fitness for a particular purpose see
        the gnu general public license for more details
      
        this program is free software you can redistribute it and or modify
        it under the terms of the gnu general public license as published by
        the free software foundation either version 2 of the license or at
        your option any later version [author] [graeme] [gregory]
        [gg]@[slimlogic] [co] [uk] [author] [kishon] [vijay] [abraham] [i]
        [kishon]@[ti] [com] [based] [on] [twl6030]_[usb] [c] [author] [hema]
        [hk] [hemahk]@[ti] [com] this program is distributed in the hope
        that it will be useful but without any warranty without even the
        implied warranty of merchantability or fitness for a particular
        purpose see the gnu general public license for more details
      
      extracted by the scancode license scanner the SPDX license identifier
      
        GPL-2.0-or-later
      
      has been chosen to replace the boilerplate/reference in 1105 file(s).
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: NAllison Randal <allison@lohutok.net>
      Reviewed-by: NRichard Fontana <rfontana@redhat.com>
      Reviewed-by: NKate Stewart <kstewart@linuxfoundation.org>
      Cc: linux-spdx@vger.kernel.org
      Link: https://lkml.kernel.org/r/20190527070033.202006027@linutronix.deSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c942fddf
  4. 28 5月, 2019 1 次提交
  5. 02 1月, 2019 1 次提交
    • T
      ALSA: hda - Revert DSP detection on legacy HD-audio driver · 3e9ad24b
      Takashi Iwai 提交于
      This essentially reverts the commits
        c337104b ("ALSA: HD-Audio: SKL+: abort probe if DSP is present
        and Skylake driver selected")
      and
        d82b51c8 ("ALSA: HD-Audio: SKL+: force HDaudio legacy or SKL+
        driver selection")
      for the path of legacy HD-audio controller (snd-hda-intel).
      
      The automatic DSP detection and skip of binding with the legacy driver
      caused regressions on several machines like Dell XPS13.  They give the
      PCI class 0x40380 indicating the availability of DSP while they don't
      work with ASoC SKL driver (yet).
      
      As the support of ASoC driver for such devices isn't available, it's
      better to revert the whole DSP-detection-and-skip behavior of the
      legacy driver, so that we can get the old good driver working on such
      devices.
      
      The pci_binding option for ASoC SKL driver is still kept so that it
      can work without blacklisting.
      
      Fixes: c337104b ("ALSA: HD-Audio: SKL+: abort probe if DSP is present and Skylake driver selected")
      Reported-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Reported-by: NHans de Goede <hdegoede@redhat.com>
      Reported-by: NAzat Khuzhin <dohardgopro@gmail.com>
      Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      3e9ad24b
  6. 20 12月, 2018 1 次提交
    • P
      ALSA: HD-Audio: SKL+: abort probe if DSP is present and Skylake driver selected · c337104b
      Pierre-Louis Bossart 提交于
      Now that the SST/Skylake driver supports per platform selectors, we
      can add logic to automatically select the right driver.
      
      If the Skylake driver is selected for a specific platform, and the DSP
      is detected at run-time based on the PCI class/subclass/prog-if
      information, the legacy HDaudio driver aborts the probe. This will
      result in a single driver probing and remove the need for modprobe
      blacklists.
      
      Follow-up patches will add a module parameter to bypass the logic if
      this automatic detection fails, or if the Skylake driver is unable to
      actually support the platform (firmware authentication, missing
      topology file, hardware issue, etc).
      
      The same mechanism will be used to conflicts generated by the same PCI
      ID being registered by both legacy HDAuudio and SOF drivers for Intel
      platforms. In other words SOF will not require changes to the HDaudio
      legacy.
      Signed-off-by: NPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      c337104b
  7. 11 12月, 2018 1 次提交
    • T
      ALSA: hda/intel: Drop superfluous AZX_DCAPS_I915_POWERWELL checks · e454ff8e
      Takashi Iwai 提交于
      snd_hdac_display_power() can be called even for a HDA controller
      without DRM binding.  The same is true for other helpers,
      snd_hdac_i915_set_bclk() and snd_hdac_set_codec_wakeup().
      So all superfluous AZX_DCAPS_I915_POWERWELL  checks in hda_intel.c can
      be dropped, and the definition of AZX_DCAPS_I915_POWERWELL itself can
      be removed as well.  This simplifies the code a lot.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      e454ff8e
  8. 11 9月, 2018 1 次提交
  9. 30 8月, 2018 2 次提交
  10. 29 8月, 2018 1 次提交
  11. 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
  12. 30 6月, 2017 1 次提交
    • T
      ALSA: hda - Fix doubly initialization of i915 component · dba9b7b6
      Takashi Iwai 提交于
      In the commit fcc88d91 ("ALSA: hda - Bind with i915 component
      before codec binding"), the binding with i915 audio component is moved
      to be performed always at probing the controller.  This fixed the
      potential problems on IVB, but now it brought another issue on HSW and
      BDW.  These two platforms give two individual HD-audio controllers,
      one for the analog codec on PCH and another for HDMI over gfx.  Since
      I decided to take a lazy path to check only AZX_DRIVER_PCH type in the
      commit above, now both controllers try to bind with i915, and you see
      a kernel WARNING.
      
      This patch tries to address it again properly.  Now a new DCAPS bit,
      AZX_DCAPS_I915_COMPONENT, is introduced for indicating the binding
      with i915 component in addition to the existing I915_POWERWELL bit
      flag.  Each PCI entry has to give this new flag if it requires the
      binding with i915 component.  For HSW/BDW PCH (i.e. the ones defined
      by AZX_DCAPS_INTEL_PCH) doesn't contain AZX_DCAPS_I915_COMPONENT bit
      while others have it.
      
      While we're at it, add parentheses around the bit flag check for
      avoiding possible compiler warnings, too.
      
      The bug was spotted by Intel CI tests.
      
      Fixes: fcc88d91 ("ALSA: hda - Bind with i915 component before codec binding")
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=196219Reported-by: NMartin Peres <martin.peres@free.fr>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      dba9b7b6
  13. 15 1月, 2017 1 次提交
    • T
      ALSA: hda - Make single_cmd option to stop the fallback mechanism · 41438f13
      Takashi Iwai 提交于
      HD-audio driver has a mechanism to fall back to the single cmd mode as
      a last resort if the CORB/RIRB communication goes wrong even after
      switching to the polling mode.  The switching has worked in the past
      well, but Enrico Mioso reported that his system crashes when this
      happens.
      
      Although the actual cause of the crash isn't still fully analyzed yet,
      it'd be in anyway good to provide an option to turn off the fallback
      mode.  Now this patch extends the behavior of the existing single_cmd
      option for that.  Namely,
      
      - The option is changed from bool to bint.
      - As default, it is the mode allowing the fallback to single cmd.
      - Once when either true/false value is given to the option, the driver
        explicitly turns on/off the single cmd mode, but without the
        fallback.
      
      That is, if you want to disable the fallback, just pass single_cmd=0
      option.  Passing single_cmd=1 will keep working like before.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      41438f13
  14. 09 8月, 2016 1 次提交
  15. 17 12月, 2015 4 次提交
  16. 15 12月, 2015 1 次提交
  17. 09 12月, 2015 1 次提交
    • T
      ALSA: hda - Don't try to bind i915 unless CONFIG_SND_HDA_I915 is set · fbaf9f9f
      Takashi Iwai 提交于
      snd-hda-intel driver tries to bind with i915 audio component always
      when AZX_DCAPS_I915_POWERWELL is set in the driver caps.  This was
      mostly OK in the past, as the flag was applied only to a limited set
      of devices, namely, Haswell and Broadwell.  On these machines, i915
      graphics is almost mandatory as long as HDMI/DP is concerned.
      
      Recently the application of i915 binding was widened to more Intel
      chips.  On these chips, the chance of a kernel without i915 graphics
      is much higher, and such user would hit an error like:
      
       snd_hda_intel 0000:00:1b.0: failed to add i915 component master (-19)
      
      Although the error itself is harmless, it's certainly superfluous even
      to try binding with i915, if we already know that there isn't any.
      
      This patch fixes it by simply defining AZX_DCAPS_I915_POWERWELL as 0
      in the case without i915.  Then all codes referring to this flag will
      be optimized out by the compiler.
      
      Fixes: 6603249d ('ALSA: hda - Enable audio component for old Intel PCH devices')
      Reported-by: Nkernel test robot <ying.huang@linux.intel.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      fbaf9f9f
  18. 19 10月, 2015 1 次提交
  19. 29 4月, 2015 1 次提交
  20. 17 4月, 2015 1 次提交
  21. 16 4月, 2015 6 次提交
  22. 13 3月, 2015 1 次提交
  23. 26 2月, 2015 2 次提交
    • 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 - 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
  24. 20 2月, 2015 3 次提交
  25. 27 6月, 2014 2 次提交