1. Aug 08, 2023
    • Yang Yingliang's avatar
      ASoC: SOF: ipc3-dtrace: Switch to memdup_user_nul() helper · 93fd2be6
      Yang Yingliang authored
      
      
      Use memdup_user_nul() helper instead of open-coding to
      simplify the code.
      
      Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
      Link: https://lore.kernel.org/r/20230725120247.509422-1-yangyingliang@huawei.com
      
      
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      93fd2be6
    • Hans de Goede's avatar
      ASoC: lower "no backend DAIs enabled for ... Port" log severity · f957172b
      Hans de Goede authored
      If SNDRV_PCM_IOCTL_PREPARE is called when the mixer settings linking
      frontend and backend have not been setup yet this results in
      e.g. the following errors getting logged:
      
      [   43.244549]  Baytrail Audio Port: ASoC: no backend DAIs enabled for Baytrail Audio Port
      [   43.244744]  Baytrail Audio Port: ASoC: error at dpcm_fe_dai_prepare on Baytrail Audio Port: -22
      
      pipewire triggers this leading to 96 lines getting logged
      after the user has logged into a GNOME session.
      
      Change the actual "no backend DAIs enabled for ... Port" error to
      dev_err_once() to avoid it getting repeated 48 times. While at it
      also improve the error by hinting the user how to fix this.
      
      To not make developing new UCM profiles harder, also log the error
      at dev_dbg() level all the time (vs once). So that e.g. dyndbg can
      be used to (re)enable the messages.
      
      Also changes _soc_pcm_ret() to not log for -EINVAL errors, to fix
      the other error getting logged 48 times. Userspace passing wrong
      parameters should not lead to dmesg messages.
      
      Link: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/3407
      
      
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Link: https://lore.kernel.org/r/20230805171435.31696-1-hdegoede@redhat.com
      
      
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      f957172b
    • Mark Brown's avatar
      ASoC: Map missing jack kcontrols · a3440da4
      Mark Brown authored
      Merge series from Alper Nebi Yasak <alpernebiyasak@gmail.com>:
      
      This patchset adds missing jack kcontrols for each independently
      detectable audio peripheral and maps jack pins to those kcontrols
      accordingly, with the primary intent to enable/improve jack detection
      handling in PulseAudio and PipeWire through JackControl UCM values.
      
      Usually it's just splitting a joint anything-is-connected "Headset Jack"
      kcontrol (from [1]) into those like "Headphone Jack" and "Headset Mic"
      (similar to a previous series for Intel Chromebooks [2]). This split is
      important to avoid automatically switching to a nonexistent external
      microphone when a headphone-only device is connected.
      
      When the underlying hardware seems to support it, this also adds a "Line
      Out" kcontrol. This is important in case the hardware can actually
      support a line-level connection via a different configuration (bypassing
      output amplifiers?), or simply for userspace to display "Line Out"
      instead of "Headphones" to the user for connected line-out devices.
      
      Beyond the mappings, I had to add PIN_SWITCH card kcontrols and DAPM
      widgets to avoid "unknown pin" errors on my devices, so tried to do them
      for all. For Intel devices I saw a pattern of routing things to
      "Platform Clock" and added to that as well. Looking at patch 5/7 of a
      Mediatek-related series [3], I can only guess that routes could be
      further improved, but don't know exactly how for each device. And one
      more concern is I don't know if the names conflict with any controls
      from codecs, although I tried to keep to names of existing widgets.
      
      As far as I can tell, the root cause for most of why these are missing
      originates to things being developed for ChromeOS, whose userspace reads
      the jack input device and doesn't care for these kcontrols. There's
      non-ChromeOS cases as well, maybe things got copy-pasted around and
      people didn't need or couldn't figure out how to get more specific than
      a single jack kcontrol. The secondary intent in this patchset is to fix
      this *everywhere*, so future copy-pastes result in the right behaviour.
      
      For more context also see:
      
      [1] ASoC: soc-card: Create jack kcontrol without pins
      https://lore.kernel.org/alsa-devel/20220408041114.6024-1-akihiko.odaki@gmail.com/
      
      [2] ASoC: Intel: Chromebooks: remap jack pins
      https://lore.kernel.org/alsa-devel/20220616214055.134943-1-pierre-louis.bossart@linux.intel.com/
      
      [3] ASoC: mediatek: Allow separate handling of headphone and headset mic jack
      https://lore.kernel.org/alsa-devel/20220922235951.252532-1-nfraprado@collabora.com/
      
      [4] ASoC: rk3399_gru_sound: Add DAPM pins, kcontrols for jack detection
      https://lore.kernel.org/alsa-devel/20200721182709.6895-1-alpernebiyasak@gmail.com/
      
      This applies onto next-20230802. Unfortunately most of it is untested
      except for a few Chromebooks I have (Kevin, Lick, Hana, Cozmo), because
      I'm intentionally generalizing to everything.
      a3440da4
    • Mark Brown's avatar
      ASoC: codecs: Add awinic AW88261 audio amplifier · 495c9e5e
      Mark Brown authored
      Merge series from wangweidong.a@awinic.com:
      
      The awinic AW88261 is an I2S/TDM input, high efficiency digital Smart K
      audio amplifier.
      495c9e5e
    • Mark Brown's avatar
      ASoC: SoundWire codecs: improve pm_runtime handling · 5a119551
      Mark Brown authored
      Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
      
      This patchset improves the pm_runtime behavior in rare corner cases
      identified by the Intel CI in the last 6 months.
      
      a) in stress-tests, it's not uncommon to see the following type of
      warnings when the codec reports as ATTACHED
      
          "rt711 sdw:0:025d:0711:00: runtime PM trying to activate child device
          sdw:0:025d:0711:00 but parent (sdw-master-0) is not active"
      
      This warning was not correlated with any functional issue, but it
      exposed a design issue on when to enable pm_runtime. The recommended
      practice in the pm_runtime documentation is to keep the devices in
      'suspended' mode and mark them as 'active' when they are really
      functional.
      
      b) enabling pm_runtime when the codec reports as ATTACHED also creates
      a problematic case when the ASoC pm_runtime_get_sync() will silently
      fail due to the -EACCESS error handling. This can happen when playback
      starts before the codec is enumerated.
      
      This patchset modifies the initial stages so that codecs are
      pm_runtime enabled in the .probe() callback, but become pm_runtime
      'active' only when they report present. This is better aligned with
      the design of the pm_runtime helpers and improved CI results
      significantly.
      
      This patchset modifies all existing SoundWire codecs (except Qualcomm
      ones), but the pattern of changes is exactly the same in all patches.
      5a119551
  2. Aug 07, 2023