Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2b8c2b51 authored by Vaibhav Agarwal's avatar Vaibhav Agarwal Committed by Greg Kroah-Hartman
Browse files

greybus: audio: Changes in response to ASoC cleanup



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: default avatarVaibhav Agarwal <vaibhav.agarwal@linaro.org>
Reviewed-by: default avatarMark Greer <mgreer@animalcreek.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent dc0f0285
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -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)
ifeq ($(CONFIG_ARCH_MSM8994),y)
 obj-m += gb-audio-codec.o
 obj-m += gb-audio-module.o
endif
ifeq ($(CONFIG_ARCH_MSM8994),y)
 obj-m += gb-camera.o
endif
obj-m += gb-audio-gb.o
+9 −2
Original line number Diff line number Diff line
@@ -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) {
+0 −1
Original line number Diff line number Diff line
@@ -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"