summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/platform/msm/ipa/ipa_v3/ipa.c46
1 files changed, 24 insertions, 22 deletions
diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa.c b/drivers/platform/msm/ipa/ipa_v3/ipa.c
index 52f99c830b47..3a54c97f5320 100644
--- a/drivers/platform/msm/ipa/ipa_v3/ipa.c
+++ b/drivers/platform/msm/ipa/ipa_v3/ipa.c
@@ -4075,12 +4075,12 @@ static void ipa3_post_init_wq(struct work_struct *work)
ipa3_post_init(&ipa3_res, ipa3_ctx->dev);
}
-static int ipa3_trigger_fw_loading_mdms(void)
+static int ipa3_manual_load_ipa_fws(void)
{
int result;
const struct firmware *fw;
- IPADBG("FW loading process initiated\n");
+ IPADBG("Manual FW loading process initiated\n");
result = request_firmware(&fw, IPA_FWS_PATH, ipa3_ctx->dev);
if (result < 0) {
@@ -4096,7 +4096,7 @@ static int ipa3_trigger_fw_loading_mdms(void)
result = ipa3_load_fws(fw, ipa3_res.transport_mem_base);
if (result) {
- IPAERR("IPA FWs loading has failed\n");
+ IPAERR("Manual IPA FWs loading has failed\n");
release_firmware(fw);
return result;
}
@@ -4111,15 +4111,15 @@ static int ipa3_trigger_fw_loading_mdms(void)
release_firmware(fw);
- IPADBG("FW loading process is complete\n");
+ IPADBG("Manual FW loading process is complete\n");
return 0;
}
-static int ipa3_trigger_fw_loading_msms(void)
+static int ipa3_pil_load_ipa_fws(void)
{
void *subsystem_get_retval = NULL;
- IPADBG("FW loading process initiated\n");
+ IPADBG("PIL FW loading process initiated\n");
subsystem_get_retval = subsystem_get(IPA_SUBSYSTEM_NAME);
if (IS_ERR_OR_NULL(subsystem_get_retval)) {
@@ -4127,7 +4127,7 @@ static int ipa3_trigger_fw_loading_msms(void)
return -EINVAL;
}
- IPADBG("FW loading process is complete\n");
+ IPADBG("PIL FW loading process is complete\n");
return 0;
}
@@ -4157,25 +4157,27 @@ static ssize_t ipa3_write(struct file *file, const char __user *buf,
* We will trigger the process only if we're in GSI mode, otherwise,
* we just ignore the write.
*/
- if (ipa3_ctx->transport_prototype == IPA_TRANSPORT_TYPE_GSI) {
- IPA_ACTIVE_CLIENTS_INC_SIMPLE();
+ if (ipa3_ctx->transport_prototype != IPA_TRANSPORT_TYPE_GSI)
+ return count;
- if (ipa3_is_msm_device())
- result = ipa3_trigger_fw_loading_msms();
- else
- result = ipa3_trigger_fw_loading_mdms();
- /* No IPAv3.x chipsets that don't support FW loading */
+ IPA_ACTIVE_CLIENTS_INC_SIMPLE();
- IPA_ACTIVE_CLIENTS_DEC_SIMPLE();
+ if (ipa3_is_msm_device() || (ipa3_ctx->ipa_hw_type >= IPA_HW_v3_5))
+ result = ipa3_pil_load_ipa_fws();
+ else
+ result = ipa3_manual_load_ipa_fws();
- if (result) {
- IPAERR("FW loading process has failed\n");
- return result;
- } else {
- queue_work(ipa3_ctx->transport_power_mgmt_wq,
- &ipa3_post_init_work);
- }
+ IPA_ACTIVE_CLIENTS_DEC_SIMPLE();
+
+ if (result) {
+ IPAERR("IPA FW loading process has failed\n");
+ return result;
}
+
+ queue_work(ipa3_ctx->transport_power_mgmt_wq,
+ &ipa3_post_init_work);
+ IPADBG("IPA FW loaded successfully\n");
+
return count;
}