1. Feb 28, 2024
  2. Feb 26, 2024
  3. Feb 23, 2024
    • Richard Fitzgerald's avatar
      ASoC: soc-card: Fix missing locking in snd_soc_card_get_kcontrol() · eba2eb24
      Richard Fitzgerald authored
      
      
      snd_soc_card_get_kcontrol() must be holding a read lock on
      card->controls_rwsem while walking the controls list.
      
      Compare with snd_ctl_find_numid().
      
      The existing function is renamed snd_soc_card_get_kcontrol_locked()
      so that it can be called from contexts that are already holding
      card->controls_rwsem (for example, control get/put functions).
      
      There are few direct or indirect callers of
      snd_soc_card_get_kcontrol(), and most are safe. Three require
      changes, which have been included in this patch:
      
      codecs/cs35l45.c:
        cs35l45_activate_ctl() is called from a control put() function so
        is changed to call snd_soc_card_get_kcontrol_locked().
      
      codecs/cs35l56.c:
        cs35l56_sync_asp1_mixer_widgets_with_firmware() is called from
        control get()/put() functions so is changed to call
        snd_soc_card_get_kcontrol_locked().
      
      fsl/fsl_xcvr.c:
        fsl_xcvr_activate_ctl() is called from three places, one of which
        already holds card->controls_rwsem:
        1. fsl_xcvr_mode_put(), a control put function, which will
           already be holding card->controls_rwsem.
        2. fsl_xcvr_startup(), a DAI startup function.
        3. fsl_xcvr_shutdown(), a DAI shutdown function.
      
        To fix this, fsl_xcvr_activate_ctl() has been changed to call
        snd_soc_card_get_kcontrol_locked() so that it is safe to call
        directly from fsl_xcvr_mode_put().
        The fsl_xcvr_startup() and fsl_xcvr_shutdown() functions have been
        changed to take a read lock on card->controls_rsem() around calls
        to fsl_xcvr_activate_ctl(). While this is not very elegant, it
        keeps the change small, to avoid this patch creating a large
        collateral churn in fsl/fsl_xcvr.c.
      
      Analysis of other callers of snd_soc_card_get_kcontrol() is that
      they do not need any changes, they are not holding card->controls_rwsem
      when they call snd_soc_card_get_kcontrol().
      
      Direct callers of snd_soc_card_get_kcontrol():
        fsl/fsl_spdif.c: fsl_spdif_dai_probe() - DAI probe function
        fsl/fsl_micfil.c: voice_detected_fn() - IRQ handler
      
      Indirect callers via soc_component_notify_control():
        codecs/cs42l43: cs42l43_mic_shutter() - IRQ handler
        codecs/cs42l43: cs42l43_spk_shutter() - IRQ handler
        codecs/ak4118.c: ak4118_irq_handler() - IRQ handler
        codecs/wm_adsp.c: wm_adsp_write_ctl() - not currently used
      
      Indirect callers via snd_soc_limit_volume():
        qcom/sc8280xp.c: sc8280xp_snd_init() - DAIlink init function
        ti/rx51.c: rx51_aic34_init() - DAI init function
      
      I don't have hardware to test the fsl/*, qcom/sc828xp.c, ti/rx51.c
      and ak4118.c changes.
      
      Backport note:
      The fsl/, qcom/, cs35l45, cs35l56 and cs42l43 callers were added
      since the Fixes commit so won't all be present on older kernels.
      
      Signed-off-by: default avatarRichard Fitzgerald <rf@opensource.cirrus.com>
      Fixes: 209c6cdf ("ASoC: soc-card: move snd_soc_card_get_kcontrol() to soc-card")
      Link: https://lore.kernel.org/r/20240221123710.690224-1-rf@opensource.cirrus.com
      
      
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      eba2eb24
  4. Feb 21, 2024
    • Colin Ian King's avatar
      ASoC: qcom: Fix uninitialized pointer dmactl · 1382d8b5
      Colin Ian King authored
      In the case where __lpass_get_dmactl_handle is called and the driver
      id dai_id is invalid the pointer dmactl is not being assigned a value,
      and dmactl contains a garbage value since it has not been initialized
      and so the null check may not work. Fix this to initialize dmactl to
      NULL. One could argue that modern compilers will set this to zero, but
      it is useful to keep this initialized as per the same way in functions
      __lpass_platform_codec_intf_init and lpass_cdc_dma_daiops_hw_params.
      
      Cleans up clang scan build warning:
      sound/soc/qcom/lpass-cdc-dma.c:275:7: warning: Branch condition
      evaluates to a garbage value [core.uninitialized.Branch]
      
      Fixes: b81af585
      
       ("ASoC: qcom: Add lpass CPU driver for codec dma control")
      Signed-off-by: default avatarColin Ian King <colin.i.king@gmail.com>
      Link: https://msgid.link/r/20240221134804.3475989-1-colin.i.king@gmail.com
      
      
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      1382d8b5
  5. Feb 20, 2024
  6. Feb 14, 2024
    • Richard Fitzgerald's avatar
      ASoC: cs35l56: Workaround for ACPI with broken spk-id-gpios property · 0db0c177
      Richard Fitzgerald authored
      
      
      The ACPI in some SoundWire laptops has a spk-id-gpios property but
      it points to the wrong Device node. This patch adds a workaround to
      try to get the GPIO directly from the correct Device node.
      
      If the attempt to get the GPIOs from the property fails, the workaround
      looks for the SDCA node "AF01", which is where the GpioIo resource is
      defined. If this exists, a spk-id-gpios mapping is added to that node
      and then the GPIO is got from that node using the property.
      
      Signed-off-by: default avatarRichard Fitzgerald <rf@opensource.cirrus.com>
      Link: https://msgid.link/r/20240209111840.1543630-1-rf@opensource.cirrus.com
      
      
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      0db0c177
    • Mark Brown's avatar
      ASoC: SOF: Intel: pci-tgl/lnl: Change default paths · 9dbe95e2
      Mark Brown authored
      Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>:
      
      Hi,
      
      Align the IPC4 firmware path/name and the topology path to the documentation:
      default_fw_path:     intel/sof-ipc4/{platform_name}
      default_lib_path:    intel/sof-ipc4-lib/{platform_name}
      default_tplg_path:   intel/sof-ipc4-tplg
      default_fw_filename: sof-{platform_name}.ri
      
      Tiger Lake and Lunar Lake support is not yet available via the official
      firmware release, the paths can be changed now to avoid misalignment in the
      future.
      
      Regards,
      Peter
      ---
      Peter Ujfalusi (2):
        ASoC: SOF: Intel: pci-tgl: Change the default paths and firmware names
        ASoC: SOF: Intel: pci-lnl: Change the topology path to
          intel/sof-ipc4-tplg
      
       sound/soc/sof/intel/pci-lnl.c |  2 +-
       sound/soc/sof/intel/pci-tgl.c | 64 +++++++++++++++++------------------
       2 files changed, 33 insertions(+), 33 deletions(-)
      
      --
      2.43.0
      9dbe95e2
  7. Feb 13, 2024
  8. Feb 12, 2024
  9. Feb 09, 2024
  10. Feb 08, 2024
  11. Feb 07, 2024
  12. Feb 06, 2024
  13. Feb 05, 2024
  14. Feb 02, 2024
    • Mark Brown's avatar
      ALSA: Various fixes for Cirrus Logic CS35L56 support · e81fdba0
      Mark Brown authored
      Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>:
      
      These patches fixe various things that were undocumented, unknown or
      uncertain when the original driver code was written. And also a few
      things that were just bugs.
      e81fdba0
  15. Feb 01, 2024