From: Vinod Koul <vinod.koul@intel.com>
To: alsa-devel@alsa-project.org
Cc: Vinod Koul <vinod.koul@intel.com>,
broonie@kernel.org, subhransu.s.prusty@intel.com,
lgirdwood@gmail.com, Lars-Peter Clausen <lars@metafoo.de>
Subject: [PATCH 6/7] ASoC: Intel: sst: load firmware using async callback
Date: Wed, 9 Jul 2014 14:57:54 +0530 [thread overview]
Message-ID: <1404898076-1882-7-git-send-email-vinod.koul@intel.com> (raw)
In-Reply-To: <1404898076-1882-1-git-send-email-vinod.koul@intel.com>
We would like the DSP firmware to be availble in driver as soon as possible. So
use the async callback in driver to probe to load the firmware as soon as
usermode is up
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
sound/soc/intel/sst/sst.c | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/sound/soc/intel/sst/sst.c b/sound/soc/intel/sst/sst.c
index cb9863c..ae1f0eb 100644
--- a/sound/soc/intel/sst/sst.c
+++ b/sound/soc/intel/sst/sst.c
@@ -224,6 +224,22 @@ int sst_alloc_drv_context(struct device *dev)
return 0;
}
+int sst_request_firmware_async(struct intel_sst_drv *ctx)
+{
+ int ret = 0;
+
+ snprintf(ctx->firmware_name, sizeof(ctx->firmware_name),
+ "%s%04x%s", "fw_sst_",
+ ctx->pci_id, ".bin");
+ pr_debug("Requesting FW %s now...\n", ctx->firmware_name);
+
+ ret = request_firmware_nowait(THIS_MODULE, 1, ctx->firmware_name,
+ ctx->dev, GFP_KERNEL, ctx, sst_firmware_load_cb);
+ if (ret)
+ pr_err("could not load firmware %s error %d\n", ctx->firmware_name, ret);
+
+ return ret;
+}
/*
* intel_sst_probe - PCI probe function
*
@@ -293,6 +309,11 @@ static int intel_sst_probe(struct pci_dev *pci,
mutex_init(&stream->lock);
}
+ ret = sst_request_firmware_async(sst_drv_ctx);
+ if (ret) {
+ pr_err("Firmware download failed:%d\n", ret);
+ goto do_free_mem;
+ }
/* Init the device */
ret = pci_enable_device(pci);
if (ret) {
--
1.7.0.4
next prev parent reply other threads:[~2014-07-09 9:30 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-09 9:27 [PATCH 0/8] ASoC: Intel: sst - add the merrifield DSP driver Vinod Koul
2014-07-09 9:27 ` [PATCH 1/7] ASoC: Intel: add sst shim register start-end variables Vinod Koul
2014-07-14 18:45 ` Mark Brown
2014-07-09 9:27 ` [PATCH 2/7] ASoC: Intel: mfld: add dsp error codes Vinod Koul
2014-07-14 18:45 ` Mark Brown
2014-07-09 9:27 ` [PATCH 3/7] ASoC: Intel: mrlfd - add generic parameter interface Vinod Koul
2014-07-14 18:46 ` Mark Brown
2014-07-15 5:25 ` Vinod Koul
2014-07-15 12:38 ` Mark Brown
2014-07-09 9:27 ` [PATCH 4/7] ASoC: Intel: mrfld - add the dsp sst driver Vinod Koul
2014-07-18 11:35 ` Mark Brown
2014-07-18 14:13 ` Vinod Koul
2014-07-18 16:59 ` Mark Brown
2014-07-19 6:31 ` Vinod Koul
2014-07-09 9:27 ` [PATCH 5/7] ASoC: Intel: sst: add power management handling Vinod Koul
2014-07-18 11:46 ` Mark Brown
2014-07-18 14:23 ` Vinod Koul
2014-07-18 17:14 ` Mark Brown
2014-07-19 6:37 ` Vinod Koul
2014-07-09 9:27 ` Vinod Koul [this message]
2014-07-09 9:27 ` [PATCH 7/7] ASoC: Intel: sst - add compressed ops handling Vinod Koul
2014-07-18 11:48 ` Mark Brown
2014-07-18 14:23 ` Vinod Koul
2014-07-09 9:27 ` [PATCH 0/8] ASoC: Intel: sst - add the merrifield DSP driver Vinod Koul
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1404898076-1882-7-git-send-email-vinod.koul@intel.com \
--to=vinod.koul@intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=lars@metafoo.de \
--cc=lgirdwood@gmail.com \
--cc=subhransu.s.prusty@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).