summaryrefslogtreecommitdiff
path: root/drivers/rtc
diff options
context:
space:
mode:
authorRobin Gong <yibin.gong@nxp.com>2017-11-07 17:18:44 +0800
committerLeonard Crestez <leonard.crestez@nxp.com>2018-08-24 12:41:33 +0300
commit40d7a29b68b9a274c12c8d10e224ec227113f63f (patch)
tree3996eb1d471a5b929fb54b5f4733b3962532a90a /drivers/rtc
parent01f5eb7d667d82e896633786bd20fb64b80bb111 (diff)
MLK-16765-3 rtc: rtc-imx-sc: check group interrupt type
Check group interrupt type and irq status type supported, return directlly if it's not the right group and interrupt status. Signed-off-by: Robin Gong <yibin.gong@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-imx-sc.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-imx-sc.c b/drivers/rtc/rtc-imx-sc.c
index 4fd2619db92c..9f094094d256 100644
--- a/drivers/rtc/rtc-imx-sc.c
+++ b/drivers/rtc/rtc-imx-sc.c
@@ -21,6 +21,7 @@
#include <linux/rtc.h>
#include <soc/imx/fsl_sip.h>
#include <soc/imx8/sc/sci.h>
+#include <soc/imx8/sc/svc/irq/api.h>
sc_ipc_t timer_ipcHandle;
@@ -31,10 +32,16 @@ struct imx_sc_rtc_data {
struct imx_sc_rtc_data *data;
-static int imx_sc_rtc_alarm_sc_notify(struct notifier_block *nb, unsigned long event, void *dummy)
+static int imx_sc_rtc_alarm_sc_notify(struct notifier_block *nb,
+ unsigned long event, void *group)
{
u32 events = 0;
+ /* ignore non-rtc irq */
+ if (!((event & SC_IRQ_RTC) &&
+ (*(sc_irq_group_t *)group == SC_IRQ_GROUP_RTC)))
+ return 0;
+
rtc_update_irq(data->rtc, 1, events);
return 0;