summaryrefslogtreecommitdiff
path: root/core/pld/src/pld_snoc.c
diff options
context:
space:
mode:
authorPrashanth Bhatta <bhattap@codeaurora.org>2017-02-08 10:04:56 -0800
committerqcabuildsw <qcabuildsw@localhost>2017-02-12 18:31:37 -0800
commit447bcb6523c92bc51f811952e0467685f60718f2 (patch)
tree69faaacab7d30268bafb0c0e704330ffd23744e4 /core/pld/src/pld_snoc.c
parent68acf73b5f005002a538a0af669b87b3d009165a (diff)
downloadqcacld-447bcb6523c92bc51f811952e0467685f60718f2.tar.gz
qcacld-3.0: Implement uevent call back for snoc
Platform driver icnss can provide uevent notification like FW ready & FW crashed. Register the call back for notification and update driver state for FW crashed indication so that driver doesn't have to wait for shutdown call back to know FW crashed. CRs-fixed: 2004309 Change-Id: I48afe8e023107aba8362324e3adabf6d50996b67
Diffstat (limited to 'core/pld/src/pld_snoc.c')
-rw-r--r--core/pld/src/pld_snoc.c37
1 files changed, 32 insertions, 5 deletions
diff --git a/core/pld/src/pld_snoc.c b/core/pld/src/pld_snoc.c
index 03aa4ec619..2056556f68 100644
--- a/core/pld/src/pld_snoc.c
+++ b/core/pld/src/pld_snoc.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -205,8 +205,7 @@ static int pld_snoc_suspend_noirq(struct device *dev)
return -EINVAL;
if (pld_context->ops->suspend_noirq)
- return pld_context->ops->
- suspend_noirq(dev, PLD_BUS_TYPE_SNOC);
+ return pld_context->ops->suspend_noirq(dev, PLD_BUS_TYPE_SNOC);
return 0;
}
@@ -231,8 +230,35 @@ static int pld_snoc_resume_noirq(struct device *dev)
return -EINVAL;
if (pld_context->ops->resume_noirq)
- return pld_context->ops->
- resume_noirq(dev, PLD_BUS_TYPE_SNOC);
+ return pld_context->ops->resume_noirq(dev, PLD_BUS_TYPE_SNOC);
+
+ return 0;
+}
+
+static int pld_snoc_uevent(struct device *dev,
+ struct icnss_uevent_data *uevent)
+{
+ struct pld_context *pld_context;
+ uint32_t status;
+
+ pld_context = pld_get_global_context();
+ if (!pld_context)
+ return -EINVAL;
+
+ if (!pld_context->ops->update_status)
+ goto out;
+
+ switch (uevent->uevent) {
+ case ICNSS_UEVENT_FW_CRASHED:
+ status = PLD_RECOVERY;
+ break;
+ default:
+ goto out;
+ }
+
+ pld_context->ops->update_status(dev, status);
+
+out:
return 0;
}
@@ -247,6 +273,7 @@ struct icnss_driver_ops pld_snoc_ops = {
.pm_resume = pld_snoc_pm_resume,
.suspend_noirq = pld_snoc_suspend_noirq,
.resume_noirq = pld_snoc_resume_noirq,
+ .uevent = pld_snoc_uevent,
};
/**