bcm53xx: backport Broadcom's iProc QSPI driver
[openwrt/staging/lynxis/omap.git] / target / linux / bcm53xx / patches-4.4 / 083-0002-spi-brcmstb-qspi-Broadcom-settop-platform-driver.patch
1 From 44f95d87a6187f5027568bbcdce491713d7de5e5 Mon Sep 17 00:00:00 2001
2 From: Kamal Dasu <kdasu.kdev@gmail.com>
3 Date: Wed, 24 Aug 2016 18:04:24 -0400
4 Subject: [PATCH] spi: brcmstb-qspi: Broadcom settop platform driver
5
6 Adding the settop SoC platfrom driver, this driver is compatible
7 with the settop MSPI+BSPI and MSPI only blocks implemented on the
8 SoCs. Driver calls the spi-bcm-qspi probe(), remove() and pm_ops.
9
10 Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com>
11 Signed-off-by: Mark Brown <broonie@kernel.org>
12 ---
13 drivers/spi/Makefile | 2 +-
14 drivers/spi/spi-brcmstb-qspi.c | 53 ++++++++++++++++++++++++++++++++++++++++++
15 2 files changed, 54 insertions(+), 1 deletion(-)
16 create mode 100644 drivers/spi/spi-brcmstb-qspi.c
17
18 --- a/drivers/spi/Makefile
19 +++ b/drivers/spi/Makefile
20 @@ -19,7 +19,7 @@ obj-$(CONFIG_SPI_BCM2835AUX) += spi-bcm
21 obj-$(CONFIG_SPI_BCM53XX) += spi-bcm53xx.o
22 obj-$(CONFIG_SPI_BCM63XX) += spi-bcm63xx.o
23 obj-$(CONFIG_SPI_BCM63XX_HSSPI) += spi-bcm63xx-hsspi.o
24 -obj-$(CONFIG_SPI_BCM_QSPI) += spi-bcm-qspi.o
25 +obj-$(CONFIG_SPI_BCM_QSPI) += spi-brcmstb-qspi.o spi-bcm-qspi.o
26 obj-$(CONFIG_SPI_BFIN5XX) += spi-bfin5xx.o
27 obj-$(CONFIG_SPI_ADI_V3) += spi-adi-v3.o
28 obj-$(CONFIG_SPI_BFIN_SPORT) += spi-bfin-sport.o
29 --- /dev/null
30 +++ b/drivers/spi/spi-brcmstb-qspi.c
31 @@ -0,0 +1,53 @@
32 +/*
33 + * Copyright 2016 Broadcom
34 + *
35 + * This program is free software; you can redistribute it and/or modify
36 + * it under the terms of the GNU General Public License, version 2, as
37 + * published by the Free Software Foundation (the "GPL").
38 + *
39 + * This program is distributed in the hope that it will be useful, but
40 + * WITHOUT ANY WARRANTY; without even the implied warranty of
41 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
42 + * General Public License version 2 (GPLv2) for more details.
43 + *
44 + * You should have received a copy of the GNU General Public License
45 + * version 2 (GPLv2) along with this source code.
46 + */
47 +
48 +#include <linux/device.h>
49 +#include <linux/module.h>
50 +#include <linux/platform_device.h>
51 +#include <linux/of.h>
52 +#include "spi-bcm-qspi.h"
53 +
54 +static const struct of_device_id brcmstb_qspi_of_match[] = {
55 + { .compatible = "brcm,spi-brcmstb-qspi" },
56 + { .compatible = "brcm,spi-brcmstb-mspi" },
57 + {},
58 +};
59 +MODULE_DEVICE_TABLE(of, brcmstb_qspi_of_match);
60 +
61 +static int brcmstb_qspi_probe(struct platform_device *pdev)
62 +{
63 + return bcm_qspi_probe(pdev, NULL);
64 +}
65 +
66 +static int brcmstb_qspi_remove(struct platform_device *pdev)
67 +{
68 + return bcm_qspi_remove(pdev);
69 +}
70 +
71 +static struct platform_driver brcmstb_qspi_driver = {
72 + .probe = brcmstb_qspi_probe,
73 + .remove = brcmstb_qspi_remove,
74 + .driver = {
75 + .name = "brcmstb_qspi",
76 + .pm = &bcm_qspi_pm_ops,
77 + .of_match_table = brcmstb_qspi_of_match,
78 + }
79 +};
80 +module_platform_driver(brcmstb_qspi_driver);
81 +
82 +MODULE_LICENSE("GPL v2");
83 +MODULE_AUTHOR("Kamal Dasu");
84 +MODULE_DESCRIPTION("Broadcom SPI driver for settop SoC");