Skip to content

Commit

Permalink
ASoC: wm8958: Load firmwares simultaneously
Browse files Browse the repository at this point in the history
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: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Mark Brown committed Oct 15, 2012
1 parent f95be9d commit 0ffecd7
Showing 1 changed file with 11 additions and 20 deletions.
31 changes: 11 additions & 20 deletions sound/soc/codecs/wm8958-dsp2.c
Original file line number Diff line number Diff line change
Expand Up @@ -883,33 +883,18 @@ static void wm8958_mbc_vss_loaded(const struct firmware *fw, void *context)
wm8994->mbc_vss = fw;
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)
{
struct snd_soc_codec *codec = context;
struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);

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

mutex_lock(&codec->mutex);
wm8994->mbc = fw;
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);
if (fw && (wm8958_dsp2_fw(codec, "MBC", fw, true) == 0)) {
mutex_lock(&codec->mutex);
wm8994->mbc = fw;
mutex_unlock(&codec->mutex);
}
}

void wm8958_dsp2_init(struct snd_soc_codec *codec)
Expand All @@ -932,6 +917,12 @@ void wm8958_dsp2_init(struct snd_soc_codec *codec)
request_firmware_nowait(THIS_MODULE, FW_ACTION_HOTPLUG,
"wm8958_mbc.wfw", codec->dev, GFP_KERNEL,
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)
return;
Expand Down

0 comments on commit 0ffecd7

Please sign in to comment.