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

Commit 0ffecd7d authored by Mark Brown's avatar Mark Brown
Browse files

ASoC: wm8958: Load firmwares simultaneously



As of commit 99c2aa (firmware loader: fix creation failure of fw loader
device) we can have more than one firmware request outstanding at once so
there is no need to daisychain our requests any more.

Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent f95be9d6
Loading
Loading
Loading
Loading
+11 −20
Original line number Original line Diff line number Diff line
@@ -883,13 +883,6 @@ static void wm8958_mbc_vss_loaded(const struct firmware *fw, void *context)
		wm8994->mbc_vss = fw;
		wm8994->mbc_vss = fw;
		mutex_unlock(&codec->mutex);
		mutex_unlock(&codec->mutex);
	}
	}

	/* We can't have more than one request outstanding at once so
	 * we daisy chain.
	 */
	request_firmware_nowait(THIS_MODULE, FW_ACTION_HOTPLUG,
				"wm8958_enh_eq.wfw", codec->dev, GFP_KERNEL,
				codec, wm8958_enh_eq_loaded);
}
}


static void wm8958_mbc_loaded(const struct firmware *fw, void *context)
static void wm8958_mbc_loaded(const struct firmware *fw, void *context)
@@ -897,19 +890,11 @@ static void wm8958_mbc_loaded(const struct firmware *fw, void *context)
	struct snd_soc_codec *codec = context;
	struct snd_soc_codec *codec = context;
	struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
	struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);


	if (wm8958_dsp2_fw(codec, "MBC", fw, true) != 0)
	if (fw && (wm8958_dsp2_fw(codec, "MBC", fw, true) == 0)) {
		return;

		mutex_lock(&codec->mutex);
		mutex_lock(&codec->mutex);
		wm8994->mbc = fw;
		wm8994->mbc = fw;
		mutex_unlock(&codec->mutex);
		mutex_unlock(&codec->mutex);

	}
	/* We can't have more than one request outstanding at once so
	 * we daisy chain.
	 */
	request_firmware_nowait(THIS_MODULE, FW_ACTION_HOTPLUG,
				"wm8958_mbc_vss.wfw", codec->dev, GFP_KERNEL,
				codec, wm8958_mbc_vss_loaded);
}
}


void wm8958_dsp2_init(struct snd_soc_codec *codec)
void wm8958_dsp2_init(struct snd_soc_codec *codec)
@@ -932,6 +917,12 @@ void wm8958_dsp2_init(struct snd_soc_codec *codec)
	request_firmware_nowait(THIS_MODULE, FW_ACTION_HOTPLUG,
	request_firmware_nowait(THIS_MODULE, FW_ACTION_HOTPLUG,
				"wm8958_mbc.wfw", codec->dev, GFP_KERNEL,
				"wm8958_mbc.wfw", codec->dev, GFP_KERNEL,
				codec, wm8958_mbc_loaded);
				codec, wm8958_mbc_loaded);
	request_firmware_nowait(THIS_MODULE, FW_ACTION_HOTPLUG,
				"wm8958_mbc_vss.wfw", codec->dev, GFP_KERNEL,
				codec, wm8958_mbc_vss_loaded);
	request_firmware_nowait(THIS_MODULE, FW_ACTION_HOTPLUG,
				"wm8958_enh_eq.wfw", codec->dev, GFP_KERNEL,
				codec, wm8958_enh_eq_loaded);


	if (!pdata)
	if (!pdata)
		return;
		return;