summaryrefslogtreecommitdiff
path: root/drivers/spi/spi-bcm-qspi.h
diff options
context:
space:
mode:
authorKamal Dasu <kdasu.kdev@gmail.com>2016-08-25 01:04:29 +0300
committerMark Brown <broonie@kernel.org>2016-09-24 22:03:25 +0300
commitcc20a38612dbc87dc7396affc9758e3bfbe92340 (patch)
tree3c8764494d7345d8ba1ef847a42000392727e135 /drivers/spi/spi-bcm-qspi.h
parent71b8f350a4f03730f3024bfa7dc2414904a21bcb (diff)
downloadlinux-cc20a38612dbc87dc7396affc9758e3bfbe92340.tar.xz
spi: iproc-qspi: Add Broadcom iProc SoCs support
This spi driver uses the common spi-bcm-qspi driver and implements iProc SoCs specific interrupt controller. The common driver now calls the SoC handlers when present. Adding support for both muxed l1 and unmuxed interrupt sources. Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com> Signed-off-by: Yendapally Reddy Dhananjaya Reddy <yendapally.reddy@broadcom.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-bcm-qspi.h')
-rw-r--r--drivers/spi/spi-bcm-qspi.h34
1 files changed, 33 insertions, 1 deletions
diff --git a/drivers/spi/spi-bcm-qspi.h b/drivers/spi/spi-bcm-qspi.h
index 65c363b6b7b7..7abfc75a3860 100644
--- a/drivers/spi/spi-bcm-qspi.h
+++ b/drivers/spi/spi-bcm-qspi.h
@@ -48,10 +48,26 @@
(INTR_MSPI_DONE_MASK | \
INTR_MSPI_HALTED_MASK)
+#define QSPI_INTERRUPTS_ALL \
+ (MSPI_INTERRUPTS_ALL | \
+ BSPI_LR_INTERRUPTS_ALL)
+
struct platform_device;
struct dev_pm_ops;
-struct bcm_qspi_soc_intc;
+enum {
+ MSPI_DONE = 0x1,
+ BSPI_DONE = 0x2,
+ BSPI_ERR = 0x4,
+ MSPI_BSPI_DONE = 0x7
+};
+
+struct bcm_qspi_soc_intc {
+ void (*bcm_qspi_int_ack)(struct bcm_qspi_soc_intc *soc_intc, int type);
+ void (*bcm_qspi_int_set)(struct bcm_qspi_soc_intc *soc_intc, int type,
+ bool en);
+ u32 (*bcm_qspi_get_int_status)(struct bcm_qspi_soc_intc *soc_intc);
+};
/* Read controller register*/
static inline u32 bcm_qspi_readl(bool be, void __iomem *addr)
@@ -72,6 +88,22 @@ static inline void bcm_qspi_writel(bool be,
writel_relaxed(data, addr);
}
+static inline u32 get_qspi_mask(int type)
+{
+ switch (type) {
+ case MSPI_DONE:
+ return INTR_MSPI_DONE_MASK;
+ case BSPI_DONE:
+ return BSPI_LR_INTERRUPTS_ALL;
+ case MSPI_BSPI_DONE:
+ return QSPI_INTERRUPTS_ALL;
+ case BSPI_ERR:
+ return BSPI_LR_INTERRUPTS_ERROR;
+ }
+
+ return 0;
+}
+
/* The common driver functions to be called by the SoC platform driver */
int bcm_qspi_probe(struct platform_device *pdev,
struct bcm_qspi_soc_intc *soc_intc);