]> Git Repo - linux.git/commitdiff
Merge tag 'soundwire-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul...
authorLinus Torvalds <[email protected]>
Wed, 5 Jul 2023 17:54:43 +0000 (10:54 -0700)
committerLinus Torvalds <[email protected]>
Wed, 5 Jul 2023 17:54:43 +0000 (10:54 -0700)
Pull soundwire updates from Vinod Koul:

 - Stream handling and slave alert handling

 - Qualcomm Soundwire v2.0.0 controller support

 - Intel ACE2.x initial support and code reorganization

* tag 'soundwire-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire: (55 commits)
  soundwire: stream: Make master_list ordered to prevent deadlocks
  soundwire: bus: Prevent lockdep asserts when stream has multiple buses
  soundwire: qcom: fix storing port config out-of-bounds
  soundwire: intel_ace2x: fix SND_SOC_SOF_HDA_MLINK dependency
  soundwire: debugfs: Add missing SCP registers
  soundwire: stream: Remove unnecessary gotos
  soundwire: stream: Invert logic on runtime alloc flags
  soundwire: stream: Remove unneeded checks for NULL bus
  soundwire: bandwidth allocation: Remove pointless variable
  soundwire: cadence: revisit parity injection
  soundwire: intel/cadence: update hardware reset sequence
  soundwire: intel_bus_common: enable interrupts last
  soundwire: intel_bus_common: update error log
  soundwire: amd: Improve error message in remove callback
  soundwire: debugfs: fix unbalanced pm_runtime_put()
  soundwire: qcom: fix unbalanced pm_runtime_put()
  soundwire: qcom: set clk stop need reset flag at runtime
  soundwire: qcom: add software workaround for bus clash interrupt assertion
  soundwire: qcom: wait for fifo to be empty before suspend
  soundwire: qcom: drop unused struct qcom_swrm_ctrl members
  ...

1  2 
sound/soc/sof/intel/hda.c

index ec31a5762ddf54a44a5eb9c012f5bab234330e3c,511c927b6696355d7c5238fb28f47068f3ddfdd7..64bebe1a72bbcb868ec913cd667ae2b2447e8240
@@@ -94,7 -94,7 +94,7 @@@ static int sdw_params_stream(struct dev
                             struct sdw_intel_stream_params_data *params_data)
  {
        struct snd_soc_dai *d = params_data->dai;
-       struct snd_soc_dapm_widget *w = snd_soc_dai_get_widget(d, params_data->stream);
+       struct snd_soc_dapm_widget *w = snd_soc_dai_get_widget(d, params_data->substream->stream);
        struct snd_sof_dai_config_data data = { 0 };
  
        data.dai_index = (params_data->link_id << 8) | d->id;
@@@ -158,6 -158,7 +158,7 @@@ static int hda_sdw_acpi_scan(struct snd
  
  static int hda_sdw_probe(struct snd_sof_dev *sdev)
  {
+       const struct sof_intel_dsp_desc *chip;
        struct sof_intel_hda_dev *hdev;
        struct sdw_intel_res res;
        void *sdw;
  
        memset(&res, 0, sizeof(res));
  
-       res.hw_ops = &sdw_intel_cnl_hw_ops;
-       res.mmio_base = sdev->bar[HDA_DSP_BAR];
-       res.shim_base = hdev->desc->sdw_shim_base;
-       res.alh_base = hdev->desc->sdw_alh_base;
+       chip = get_chip_info(sdev->pdata);
+       if (chip->hw_ip_version < SOF_INTEL_ACE_2_0) {
+               res.mmio_base = sdev->bar[HDA_DSP_BAR];
+               res.hw_ops = &sdw_intel_cnl_hw_ops;
+               res.shim_base = hdev->desc->sdw_shim_base;
+               res.alh_base = hdev->desc->sdw_alh_base;
+               res.ext = false;
+       } else {
+               /*
+                * retrieve eml_lock needed to protect shared registers
+                * in the HDaudio multi-link areas
+                */
+               res.eml_lock = hdac_bus_eml_get_mutex(sof_to_bus(sdev), true,
+                                                     AZX_REG_ML_LEPTR_ID_SDW);
+               if (!res.eml_lock)
+                       return -ENODEV;
+               res.mmio_base = sdev->bar[HDA_DSP_HDA_BAR];
+               /*
+                * the SHIM and SoundWire register offsets are link-specific
+                * and will be determined when adding auxiliary devices
+                */
+               res.hw_ops = &sdw_intel_lnl_hw_ops;
+               res.ext = true;
+       }
        res.irq = sdev->ipc_irq;
        res.handle = hdev->info.handle;
        res.parent = sdev->dev;
        res.ops = &sdw_callback;
        res.dev = sdev->dev;
        res.clock_stop_quirks = sdw_clock_stop_quirks;
+       res.hbus = sof_to_bus(sdev);
  
        /*
         * ops and arg fields are not populated for now,
@@@ -222,31 -245,6 +245,31 @@@ int hda_sdw_check_lcount_common(struct 
        return 0;
  }
  
 +int hda_sdw_check_lcount_ext(struct snd_sof_dev *sdev)
 +{
 +      struct sof_intel_hda_dev *hdev;
 +      struct sdw_intel_ctx *ctx;
 +      struct hdac_bus *bus;
 +      u32 slcount;
 +
 +      bus = sof_to_bus(sdev);
 +
 +      hdev = sdev->pdata->hw_pdata;
 +      ctx = hdev->sdw;
 +
 +      slcount = hdac_bus_eml_get_count(bus, true, AZX_REG_ML_LEPTR_ID_SDW);
 +
 +      /* Check HW supported vs property value */
 +      if (slcount < ctx->count) {
 +              dev_err(sdev->dev,
 +                      "%s: BIOS master count %d is larger than hardware capabilities %d\n",
 +                      __func__, ctx->count, slcount);
 +              return -EINVAL;
 +      }
 +
 +      return 0;
 +}
 +
  static int hda_sdw_check_lcount(struct snd_sof_dev *sdev)
  {
        const struct sof_intel_dsp_desc *chip;
@@@ -1368,22 -1366,12 +1391,22 @@@ static void hda_generic_machine_select(
                        hda_mach->mach_params.dmic_num = dmic_num;
                        pdata->tplg_filename = tplg_filename;
  
 -                      if (codec_num == 2) {
 +                      if (codec_num == 2 ||
 +                          (codec_num == 1 && !HDA_IDISP_CODEC(bus->codec_mask))) {
                                /*
                                 * Prevent SoundWire links from starting when an external
                                 * HDaudio codec is used
                                 */
                                hda_mach->mach_params.link_mask = 0;
 +                      } else {
 +                              /*
 +                               * Allow SoundWire links to start when no external HDaudio codec
 +                               * was detected. This will not create a SoundWire card but
 +                               * will help detect if any SoundWire codec reports as ATTACHED.
 +                               */
 +                              struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata;
 +
 +                              hda_mach->mach_params.link_mask = hdev->info.link_mask;
                        }
  
                        *mach = hda_mach;
@@@ -1597,11 -1585,7 +1620,11 @@@ void hda_set_mach_params(struct snd_soc
  
        mach_params = &mach->mach_params;
        mach_params->platform = dev_name(sdev->dev);
 -      mach_params->num_dai_drivers = desc->ops->num_drv;
 +      if (IS_ENABLED(CONFIG_SND_SOC_SOF_NOCODEC_DEBUG_SUPPORT) &&
 +          sof_debug_check_flag(SOF_DBG_FORCE_NOCODEC))
 +              mach_params->num_dai_drivers = SOF_SKL_NUM_DAIS_NOCODEC;
 +      else
 +              mach_params->num_dai_drivers = desc->ops->num_drv;
        mach_params->dai_drivers = desc->ops->drv;
  }
  
This page took 0.080266 seconds and 4 git commands to generate.