greybus: audio: Changes in response to ASoC cleanup
authorVaibhav Agarwal <vaibhav.agarwal@linaro.org>
Thu, 21 Apr 2016 16:44:02 +0000 (22:14 +0530)
committerGreg Kroah-Hartman <gregkh@google.com>
Tue, 26 Apr 2016 00:37:10 +0000 (17:37 -0700)
Update Makefile in response to SND_SOC_DYNAMIC_DAILINK cflag
removal.

Update files for msm-dynamic-dailink.h header file removal.

Update in response to API name changes. Also, acquire sound card
controls_rwsem before adding kcontrols to avoid deadlock.

Signed-off-by: Vaibhav Agarwal <vaibhav.agarwal@linaro.org>
Reviewed-by: Mark Greer <mgreer@animalcreek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/Makefile
drivers/staging/greybus/audio_codec.c
drivers/staging/greybus/audio_module.c

index 8ec607460ec0e1d2fb55479b7d6cdb73fac0581e..5bdccccbe17132577dcfbd5d6dab3e747f7a0b23 100644 (file)
@@ -52,11 +52,9 @@ obj-m += gb-es2.o
 ifeq ($(CONFIG_USB_HSIC_USB3613),y)
  obj-m += gb-arche.o
 endif
-ifeq ($(CONFIG_SND_SOC_DYNAMIC_DAILINK),y)
- obj-m += gb-audio-codec.o
-obj-m += gb-audio-module.o
-endif
 ifeq ($(CONFIG_ARCH_MSM8994),y)
+ obj-m += gb-audio-codec.o
+ obj-m += gb-audio-module.o
  obj-m += gb-camera.o
 endif
 obj-m += gb-audio-gb.o
index 20feea1c64d3376876d513470764243d80ebea8c..a2b81ba78196f7b21855130831f97771f1c7ff84 100644 (file)
@@ -898,6 +898,7 @@ int gbaudio_register_module(struct gbaudio_module_info *module)
 {
        int ret;
        struct snd_soc_codec *codec;
+       struct snd_card *card;
        struct snd_soc_jack *jack = NULL;
 
        if (!gbcodec) {
@@ -906,6 +907,9 @@ int gbaudio_register_module(struct gbaudio_module_info *module)
        }
 
        codec = gbcodec->codec;
+       card = codec->card->snd_card;
+
+       down_write(&card->controls_rwsem);
        mutex_lock(&gbcodec->lock);
 
        if (module->num_dais) {
@@ -913,12 +917,14 @@ int gbaudio_register_module(struct gbaudio_module_info *module)
                        "%d:DAIs not supported via gbcodec driver\n",
                        module->num_dais);
                mutex_unlock(&gbcodec->lock);
+               up_write(&card->controls_rwsem);
                return -EINVAL;
        }
 
        ret = gbaudio_init_jack(module, codec);
        if (ret) {
                mutex_unlock(&gbcodec->lock);
+               up_write(&card->controls_rwsem);
                return ret;
        }
 
@@ -936,7 +942,7 @@ int gbaudio_register_module(struct gbaudio_module_info *module)
        if (codec->card->instantiated) {
                ret = snd_soc_dapm_new_widgets(&codec->dapm);
                if (!ret)
-                       snd_soc_dapm_link_dai_widgets_component(codec->card,
+                       snd_soc_dapm_link_component_dai_widgets(codec->card,
                                                                &codec->dapm);
        }
 
@@ -953,6 +959,7 @@ int gbaudio_register_module(struct gbaudio_module_info *module)
        dev_dbg(codec->dev, "Registered %s module\n", module->name);
 
        mutex_unlock(&gbcodec->lock);
+       up_write(&card->controls_rwsem);
        return 0;
 }
 EXPORT_SYMBOL(gbaudio_register_module);
@@ -1061,7 +1068,7 @@ void gbaudio_unregister_module(struct gbaudio_module_info *module)
        if (module->controls) {
                dev_dbg(codec->dev, "Removing %d controls\n",
                        module->num_controls);
-               soc_remove_codec_controls(codec, module->controls,
+               snd_soc_remove_codec_controls(codec, module->controls,
                                          module->num_controls);
        }
        if (module->dapm_widgets) {
index dd43b6d5ae077bd8fe252ebcf774d389103c05a8..bdc5ec50b30b9eafc772774bd162b886578679b5 100644 (file)
@@ -9,7 +9,6 @@
 #include <linux/module.h>
 #include <sound/soc.h>
 #include <sound/pcm_params.h>
-#include <sound/msm-dynamic-dailink.h>
 
 #include "audio_codec.h"
 #include "audio_apbridgea.h"