Linux 3.12.39
[linux/fpc-iii.git] / drivers / crypto / ux500 / cryp / cryp_irq.c
blob08d291cdbe6da309a66128bc8727e25f1579e39f
1 /**
2 * Copyright (C) ST-Ericsson SA 2010
3 * Author: Shujuan Chen <shujuan.chen@stericsson.com> for ST-Ericsson.
4 * Author: Jonas Linde <jonas.linde@stericsson.com> for ST-Ericsson.
5 * Author: Joakim Bech <joakim.xx.bech@stericsson.com> for ST-Ericsson.
6 * Author: Berne Hebark <berne.herbark@stericsson.com> for ST-Ericsson.
7 * Author: Niklas Hernaeus <niklas.hernaeus@stericsson.com> for ST-Ericsson.
8 * License terms: GNU General Public License (GPL) version 2.
9 */
11 #include <linux/kernel.h>
12 #include <linux/bitmap.h>
13 #include <linux/device.h>
15 #include "cryp.h"
16 #include "cryp_p.h"
17 #include "cryp_irq.h"
18 #include "cryp_irqp.h"
20 void cryp_enable_irq_src(struct cryp_device_data *device_data, u32 irq_src)
22 u32 i;
24 dev_dbg(device_data->dev, "[%s]", __func__);
26 i = readl_relaxed(&device_data->base->imsc);
27 i = i | irq_src;
28 writel_relaxed(i, &device_data->base->imsc);
31 void cryp_disable_irq_src(struct cryp_device_data *device_data, u32 irq_src)
33 u32 i;
35 dev_dbg(device_data->dev, "[%s]", __func__);
37 i = readl_relaxed(&device_data->base->imsc);
38 i = i & ~irq_src;
39 writel_relaxed(i, &device_data->base->imsc);
42 bool cryp_pending_irq_src(struct cryp_device_data *device_data, u32 irq_src)
44 return (readl_relaxed(&device_data->base->mis) & irq_src) > 0;