]> Git Repo - linux.git/commitdiff
Merge tag 'asoc-fix-v5.2-rc4' of https://git.kernel.org/pub/scm/linux/kernel/git...
authorTakashi Iwai <[email protected]>
Thu, 13 Jun 2019 15:33:34 +0000 (17:33 +0200)
committerTakashi Iwai <[email protected]>
Thu, 13 Jun 2019 15:33:34 +0000 (17:33 +0200)
ASoC: Fixes for v5.2

There's an awful lot of fixes here, almost all for the newly introduced
SoF DSP drivers (including a few things it turned up in shared code).
This is a large and complex piece of code so it's not surprising that
there have been quite a few issues here, fortunately things seem to have
mostly calmed down now.  Otherwise there's just a smattering of small fixes.

1  2 
sound/hda/ext/hdac_ext_bus.c
sound/pci/hda/hda_codec.c
sound/soc/soc-dapm.c
sound/soc/soc-pcm.c

index c203af71a0995f76842367d25b299bc6eecef279,08cc0ce3b9244ed16ccc4c30b7935c9bfd048064..f33ba58b753c30283230f65e443da5293ac394c1
@@@ -104,7 -104,10 +104,7 @@@ int snd_hdac_ext_bus_init(struct hdac_b
                return ret;
  
        bus->ext_ops = ext_ops;
 -      INIT_LIST_HEAD(&bus->hlink_list);
        bus->idx = idx++;
 -
 -      mutex_init(&bus->lock);
        bus->cmd_dma_state = true;
  
        return 0;
@@@ -170,7 -173,6 +170,6 @@@ EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_devi
  void snd_hdac_ext_bus_device_exit(struct hdac_device *hdev)
  {
        snd_hdac_device_exit(hdev);
-       kfree(hdev);
  }
  EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_device_exit);
  
index b20eb7fc83eb277d9e0ebbe1353682aae3e59d82,6cdec64dc68ad0da42ddc6fa94cc2ad2029e38d2..fcdf2cd3783b5c19d1c4ce6c426bc794c6bc0b28
@@@ -832,15 -832,16 +832,22 @@@ static int snd_hda_codec_dev_free(struc
        struct hda_codec *codec = device->device_data;
  
        codec->in_freeing = 1;
 -      snd_hdac_device_unregister(&codec->core);
 +      /*
 +       * snd_hda_codec_device_new() is used by legacy HDA and ASoC driver.
 +       * We can't unregister ASoC device since it will be unregistered in
 +       * snd_hdac_ext_bus_device_remove().
 +       */
 +      if (codec->core.type == HDA_DEV_LEGACY)
 +              snd_hdac_device_unregister(&codec->core);
        codec_display_power(codec, false);
-       put_device(hda_codec_dev(codec));
+       /*
+        * In the case of ASoC HD-audio bus, the device refcount is released in
+        * snd_hdac_ext_bus_device_remove() explicitly.
+        */
+       if (codec->core.type == HDA_DEV_LEGACY)
+               put_device(hda_codec_dev(codec));
        return 0;
  }
  
@@@ -975,7 -976,6 +982,7 @@@ int snd_hda_codec_device_new(struct hda
  
        /* power-up all before initialization */
        hda_set_power_state(codec, AC_PWRST_D0);
 +      codec->core.dev.power.power_state = PMSG_ON;
  
        snd_hda_codec_proc_new(codec);
  
diff --combined sound/soc/soc-dapm.c
index 81a7a12196ffed084305126b14b31deca9f4be8e,5fc57af9cb6f26f51b389074737cce1cc4912159..55f8278077f493d7df6694429dc0201ff1c15838
@@@ -883,7 -883,6 +883,7 @@@ static int dapm_create_or_share_kcontro
                        case snd_soc_dapm_switch:
                        case snd_soc_dapm_mixer:
                        case snd_soc_dapm_pga:
 +                      case snd_soc_dapm_effect:
                        case snd_soc_dapm_out_drv:
                                wname_in_long_name = true;
                                kcname_in_long_name = true;
@@@ -2193,7 -2192,10 +2193,10 @@@ static void dapm_debugfs_add_widget(str
  
  static void dapm_debugfs_cleanup(struct snd_soc_dapm_context *dapm)
  {
+       if (!dapm->debugfs_dapm)
+               return;
        debugfs_remove_recursive(dapm->debugfs_dapm);
+       dapm->debugfs_dapm = NULL;
  }
  
  #else
@@@ -2371,7 -2373,6 +2374,7 @@@ static ssize_t dapm_widget_show_compone
                case snd_soc_dapm_dac:
                case snd_soc_dapm_adc:
                case snd_soc_dapm_pga:
 +              case snd_soc_dapm_effect:
                case snd_soc_dapm_out_drv:
                case snd_soc_dapm_mixer:
                case snd_soc_dapm_mixer_named_ctl:
@@@ -3199,7 -3200,6 +3202,7 @@@ int snd_soc_dapm_new_widgets(struct snd
                        dapm_new_mux(w);
                        break;
                case snd_soc_dapm_pga:
 +              case snd_soc_dapm_effect:
                case snd_soc_dapm_out_drv:
                        dapm_new_pga(w);
                        break;
@@@ -3831,8 -3831,8 +3834,8 @@@ static int snd_soc_dai_link_event(struc
                                                ret);
                                        goto out;
                                }
-                               source->active++;
                        }
+                       source->active++;
                        ret = soc_dai_hw_params(&substream, params, source);
                        if (ret < 0)
                                goto out;
                                                ret);
                                        goto out;
                                }
-                               sink->active++;
                        }
+                       sink->active++;
                        ret = soc_dai_hw_params(&substream, params, sink);
                        if (ret < 0)
                                goto out;
diff --combined sound/soc/soc-pcm.c
index 0a4f60c7a188cd6c81122f5dbe5d413921df897e,7347e6f9924810a9837032f8b07b49908d2c5ab2..c46ad0f662921210425ec78295a166301efb769b
@@@ -43,8 -43,8 +43,8 @@@ static bool snd_soc_dai_stream_valid(st
        else
                codec_stream = &dai->driver->capture;
  
 -      /* If the codec specifies any rate at all, it supports the stream. */
 -      return codec_stream->rates;
 +      /* If the codec specifies any channels at all, it supports the stream */
 +      return codec_stream->channels_min;
  }
  
  /**
@@@ -518,10 -518,8 +518,10 @@@ static int soc_pcm_open(struct snd_pcm_
                        continue;
  
                if (component->driver->module_get_upon_open &&
 -                  !try_module_get(component->dev->driver->owner))
 -                      return -ENODEV;
 +                  !try_module_get(component->dev->driver->owner)) {
 +                      ret = -ENODEV;
 +                      goto module_err;
 +              }
  
                ret = component->driver->ops->open(substream);
                if (ret < 0) {
@@@ -638,7 -636,7 +638,7 @@@ codec_dai_err
  
  component_err:
        soc_pcm_components_close(substream, component);
 -
 +module_err:
        if (cpu_dai->driver->ops->shutdown)
                cpu_dai->driver->ops->shutdown(substream, cpu_dai);
  out:
@@@ -1033,9 -1031,6 +1033,9 @@@ interface_err
  
  codec_err:
        for_each_rtd_codec_dai_rollback(rtd, i, codec_dai) {
 +              if (!snd_soc_dai_stream_valid(codec_dai, substream->stream))
 +                      continue;
 +
                if (codec_dai->driver->ops->hw_free)
                        codec_dai->driver->ops->hw_free(substream, codec_dai);
                codec_dai->rate = 0;
@@@ -1093,9 -1088,6 +1093,9 @@@ static int soc_pcm_hw_free(struct snd_p
  
        /* now free hw params for the DAIs  */
        for_each_rtd_codec_dai(rtd, i, codec_dai) {
 +              if (!snd_soc_dai_stream_valid(codec_dai, substream->stream))
 +                      continue;
 +
                if (codec_dai->driver->ops->hw_free)
                        codec_dai->driver->ops->hw_free(substream, codec_dai);
        }
@@@ -2479,7 -2471,8 +2479,8 @@@ int dpcm_be_dai_prepare(struct snd_soc_
  
                if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) &&
                    (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP) &&
-                   (be->dpcm[stream].state != SND_SOC_DPCM_STATE_SUSPEND))
+                   (be->dpcm[stream].state != SND_SOC_DPCM_STATE_SUSPEND) &&
+                   (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED))
                        continue;
  
                dev_dbg(be->dev, "ASoC: prepare BE %s\n",
This page took 0.147844 seconds and 4 git commands to generate.