blob: 3379720cfcb8d9b7f203aea95cf68c714e28a353 [file] [log] [blame]
Thomas Gleixner75a6faf2019-06-01 10:08:37 +02001// SPDX-License-Identifier: GPL-2.0-only
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -07002/*
Grant Likelyca632f52011-06-06 01:16:30 -06003 * Memory-mapped interface driver for DW SPI Core
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -07004 *
5 * Copyright (c) 2010, Octasic semiconductor.
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -07006 */
7
8#include <linux/clk.h>
Jamie Iles50c01fc2011-01-11 12:43:52 +00009#include <linux/err.h>
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -070010#include <linux/platform_device.h>
Jarkko Nikulab9fc2d22019-10-18 16:21:29 +030011#include <linux/pm_runtime.h>
Tejun Heo5a0e3ad2010-03-24 17:04:11 +090012#include <linux/slab.h>
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -070013#include <linux/spi/spi.h>
Grant Likely568a60e2011-02-28 12:47:12 -070014#include <linux/scatterlist.h>
Alexandre Bellonic2c25cc2018-07-27 21:53:56 +020015#include <linux/mfd/syscon.h>
Paul Gortmakerd7614de2011-07-03 15:44:29 -040016#include <linux/module.h>
Steffen Trumtrar22dae172014-06-13 15:36:18 +020017#include <linux/of.h>
Steffen Trumtrar22dae172014-06-13 15:36:18 +020018#include <linux/of_platform.h>
Jay Fang32215a62018-12-03 11:15:50 +080019#include <linux/acpi.h>
Andy Shevchenko98999952015-10-14 23:12:25 +030020#include <linux/property.h>
Alexandre Bellonic2c25cc2018-07-27 21:53:56 +020021#include <linux/regmap.h>
Dinh Nguyen7830c0e2020-05-29 10:58:05 -050022#include <linux/reset.h>
Grant Likely568a60e2011-02-28 12:47:12 -070023
Grant Likelyca632f52011-06-06 01:16:30 -060024#include "spi-dw.h"
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -070025
26#define DRIVER_NAME "dw_spi_mmio"
27
28struct dw_spi_mmio {
Jean-Hugues Deschenes0a4c1d72010-01-21 09:55:42 -070029 struct dw_spi dws;
30 struct clk *clk;
Phil Edworthy560ee7e2019-03-19 15:52:07 +000031 struct clk *pclk;
Alexandre Bellonic2c25cc2018-07-27 21:53:56 +020032 void *priv;
Dinh Nguyen7830c0e2020-05-29 10:58:05 -050033 struct reset_control *rstc;
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -070034};
35
Alexandre Bellonic2c25cc2018-07-27 21:53:56 +020036#define MSCC_CPU_SYSTEM_CTRL_GENERAL_CTRL 0x24
Alexandre Bellonic2c25cc2018-07-27 21:53:56 +020037#define OCELOT_IF_SI_OWNER_OFFSET 4
Alexandre Bellonibe17ee02018-08-29 14:45:48 +020038#define JAGUAR2_IF_SI_OWNER_OFFSET 6
Alexandre Bellonic1d8b082018-08-31 13:40:46 +020039#define MSCC_IF_SI_OWNER_MASK GENMASK(1, 0)
Alexandre Bellonic2c25cc2018-07-27 21:53:56 +020040#define MSCC_IF_SI_OWNER_SISL 0
41#define MSCC_IF_SI_OWNER_SIBM 1
42#define MSCC_IF_SI_OWNER_SIMC 2
43
44#define MSCC_SPI_MST_SW_MODE 0x14
45#define MSCC_SPI_MST_SW_MODE_SW_PIN_CTRL_MODE BIT(13)
46#define MSCC_SPI_MST_SW_MODE_SW_SPI_CS(x) (x << 5)
47
Lars Povlsen53a09632020-08-24 22:30:06 +020048#define SPARX5_FORCE_ENA 0xa4
49#define SPARX5_FORCE_VAL 0xa8
50
Alexandre Bellonic2c25cc2018-07-27 21:53:56 +020051struct dw_spi_mscc {
52 struct regmap *syscon;
Lars Povlsen53a09632020-08-24 22:30:06 +020053 void __iomem *spi_mst; /* Not sparx5 */
Alexandre Bellonic2c25cc2018-07-27 21:53:56 +020054};
55
56/*
57 * The Designware SPI controller (referred to as master in the documentation)
58 * automatically deasserts chip select when the tx fifo is empty. The chip
Jay Fangdb56d032021-05-10 14:58:22 +080059 * selects then needs to be either driven as GPIOs or, for the first 4 using
Alexandre Bellonic2c25cc2018-07-27 21:53:56 +020060 * the SPI boot controller registers. the final chip select is an OR gate
61 * between the Designware SPI controller and the SPI boot controller.
62 */
63static void dw_spi_mscc_set_cs(struct spi_device *spi, bool enable)
64{
65 struct dw_spi *dws = spi_master_get_devdata(spi->master);
66 struct dw_spi_mmio *dwsmmio = container_of(dws, struct dw_spi_mmio, dws);
67 struct dw_spi_mscc *dwsmscc = dwsmmio->priv;
68 u32 cs = spi->chip_select;
69
70 if (cs < 4) {
71 u32 sw_mode = MSCC_SPI_MST_SW_MODE_SW_PIN_CTRL_MODE;
72
73 if (!enable)
74 sw_mode |= MSCC_SPI_MST_SW_MODE_SW_SPI_CS(BIT(cs));
75
76 writel(sw_mode, dwsmscc->spi_mst + MSCC_SPI_MST_SW_MODE);
77 }
78
79 dw_spi_set_cs(spi, enable);
80}
81
82static int dw_spi_mscc_init(struct platform_device *pdev,
Alexandre Bellonibe17ee02018-08-29 14:45:48 +020083 struct dw_spi_mmio *dwsmmio,
84 const char *cpu_syscon, u32 if_si_owner_offset)
Alexandre Bellonic2c25cc2018-07-27 21:53:56 +020085{
86 struct dw_spi_mscc *dwsmscc;
Alexandre Bellonic2c25cc2018-07-27 21:53:56 +020087
88 dwsmscc = devm_kzalloc(&pdev->dev, sizeof(*dwsmscc), GFP_KERNEL);
89 if (!dwsmscc)
90 return -ENOMEM;
91
YueHaibing5cc6fdc2019-09-04 21:58:54 +080092 dwsmscc->spi_mst = devm_platform_ioremap_resource(pdev, 1);
Alexandre Bellonic2c25cc2018-07-27 21:53:56 +020093 if (IS_ERR(dwsmscc->spi_mst)) {
94 dev_err(&pdev->dev, "SPI_MST region map failed\n");
95 return PTR_ERR(dwsmscc->spi_mst);
96 }
97
Alexandre Bellonibe17ee02018-08-29 14:45:48 +020098 dwsmscc->syscon = syscon_regmap_lookup_by_compatible(cpu_syscon);
Alexandre Bellonic2c25cc2018-07-27 21:53:56 +020099 if (IS_ERR(dwsmscc->syscon))
100 return PTR_ERR(dwsmscc->syscon);
101
102 /* Deassert all CS */
103 writel(0, dwsmscc->spi_mst + MSCC_SPI_MST_SW_MODE);
104
105 /* Select the owner of the SI interface */
106 regmap_update_bits(dwsmscc->syscon, MSCC_CPU_SYSTEM_CTRL_GENERAL_CTRL,
Alexandre Bellonic1d8b082018-08-31 13:40:46 +0200107 MSCC_IF_SI_OWNER_MASK << if_si_owner_offset,
Alexandre Bellonibe17ee02018-08-29 14:45:48 +0200108 MSCC_IF_SI_OWNER_SIMC << if_si_owner_offset);
Alexandre Bellonic2c25cc2018-07-27 21:53:56 +0200109
110 dwsmmio->dws.set_cs = dw_spi_mscc_set_cs;
111 dwsmmio->priv = dwsmscc;
112
113 return 0;
114}
115
Alexandre Bellonibe17ee02018-08-29 14:45:48 +0200116static int dw_spi_mscc_ocelot_init(struct platform_device *pdev,
117 struct dw_spi_mmio *dwsmmio)
118{
119 return dw_spi_mscc_init(pdev, dwsmmio, "mscc,ocelot-cpu-syscon",
120 OCELOT_IF_SI_OWNER_OFFSET);
121}
122
123static int dw_spi_mscc_jaguar2_init(struct platform_device *pdev,
124 struct dw_spi_mmio *dwsmmio)
125{
126 return dw_spi_mscc_init(pdev, dwsmmio, "mscc,jaguar2-cpu-syscon",
127 JAGUAR2_IF_SI_OWNER_OFFSET);
128}
129
Lars Povlsen53a09632020-08-24 22:30:06 +0200130/*
131 * The Designware SPI controller (referred to as master in the
132 * documentation) automatically deasserts chip select when the tx fifo
133 * is empty. The chip selects then needs to be driven by a CS override
134 * register. enable is an active low signal.
135 */
136static void dw_spi_sparx5_set_cs(struct spi_device *spi, bool enable)
137{
138 struct dw_spi *dws = spi_master_get_devdata(spi->master);
139 struct dw_spi_mmio *dwsmmio = container_of(dws, struct dw_spi_mmio, dws);
140 struct dw_spi_mscc *dwsmscc = dwsmmio->priv;
141 u8 cs = spi->chip_select;
142
143 if (!enable) {
144 /* CS override drive enable */
145 regmap_write(dwsmscc->syscon, SPARX5_FORCE_ENA, 1);
146 /* Now set CSx enabled */
147 regmap_write(dwsmscc->syscon, SPARX5_FORCE_VAL, ~BIT(cs));
148 /* Allow settle */
149 usleep_range(1, 5);
150 } else {
151 /* CS value */
152 regmap_write(dwsmscc->syscon, SPARX5_FORCE_VAL, ~0);
153 /* Allow settle */
154 usleep_range(1, 5);
155 /* CS override drive disable */
156 regmap_write(dwsmscc->syscon, SPARX5_FORCE_ENA, 0);
157 }
158
159 dw_spi_set_cs(spi, enable);
160}
161
162static int dw_spi_mscc_sparx5_init(struct platform_device *pdev,
163 struct dw_spi_mmio *dwsmmio)
164{
165 const char *syscon_name = "microchip,sparx5-cpu-syscon";
166 struct device *dev = &pdev->dev;
167 struct dw_spi_mscc *dwsmscc;
168
169 if (!IS_ENABLED(CONFIG_SPI_MUX)) {
170 dev_err(dev, "This driver needs CONFIG_SPI_MUX\n");
171 return -EOPNOTSUPP;
172 }
173
174 dwsmscc = devm_kzalloc(dev, sizeof(*dwsmscc), GFP_KERNEL);
175 if (!dwsmscc)
176 return -ENOMEM;
177
178 dwsmscc->syscon =
179 syscon_regmap_lookup_by_compatible(syscon_name);
180 if (IS_ERR(dwsmscc->syscon)) {
181 dev_err(dev, "No syscon map %s\n", syscon_name);
182 return PTR_ERR(dwsmscc->syscon);
183 }
184
185 dwsmmio->dws.set_cs = dw_spi_sparx5_set_cs;
186 dwsmmio->priv = dwsmscc;
187
Lars Povlsen53a09632020-08-24 22:30:06 +0200188 return 0;
189}
190
Talel Shenharf2d70472018-10-11 14:20:07 +0300191static int dw_spi_alpine_init(struct platform_device *pdev,
192 struct dw_spi_mmio *dwsmmio)
193{
Serge Semincc760f32020-09-20 14:28:53 +0300194 dwsmmio->dws.caps = DW_SPI_CAP_CS_OVERRIDE;
Talel Shenharf2d70472018-10-11 14:20:07 +0300195
Wan Ahmad Zainiec4eadee2020-05-05 21:06:13 +0800196 return 0;
197}
198
199static int dw_spi_dw_apb_init(struct platform_device *pdev,
200 struct dw_spi_mmio *dwsmmio)
201{
Serge Semin0fdad592020-05-29 16:12:03 +0300202 dw_spi_dma_setup_generic(&dwsmmio->dws);
203
Talel Shenharf2d70472018-10-11 14:20:07 +0300204 return 0;
205}
206
Wan Ahmad Zainiee539f432020-05-05 21:06:14 +0800207static int dw_spi_dwc_ssi_init(struct platform_device *pdev,
208 struct dw_spi_mmio *dwsmmio)
209{
Serge Semind6bbd112020-10-08 02:54:51 +0300210 dwsmmio->dws.caps = DW_SPI_CAP_DWC_SSI;
Wan Ahmad Zainiee539f432020-05-05 21:06:14 +0800211
Serge Semin0fdad592020-05-29 16:12:03 +0300212 dw_spi_dma_setup_generic(&dwsmmio->dws);
213
Wan Ahmad Zainiee539f432020-05-05 21:06:14 +0800214 return 0;
215}
216
Wan Ahmad Zainief4237792020-05-05 21:06:16 +0800217static int dw_spi_keembay_init(struct platform_device *pdev,
218 struct dw_spi_mmio *dwsmmio)
219{
Serge Semind6bbd112020-10-08 02:54:51 +0300220 dwsmmio->dws.caps = DW_SPI_CAP_KEEMBAY_MST | DW_SPI_CAP_DWC_SSI;
Wan Ahmad Zainief4237792020-05-05 21:06:16 +0800221
222 return 0;
223}
224
Damien Le Moalb0dfd942020-12-06 10:18:17 +0900225static int dw_spi_canaan_k210_init(struct platform_device *pdev,
226 struct dw_spi_mmio *dwsmmio)
227{
228 /*
229 * The Canaan Kendryte K210 SoC DW apb_ssi v4 spi controller is
230 * documented to have a 32 word deep TX and RX FIFO, which
231 * spi_hw_init() detects. However, when the RX FIFO is filled up to
232 * 32 entries (RXFLR = 32), an RX FIFO overrun error occurs. Avoid this
233 * problem by force setting fifo_len to 31.
234 */
235 dwsmmio->dws.fifo_len = 31;
236
237 return 0;
238}
239
Grant Likelyfd4a3192012-12-07 16:57:14 +0000240static int dw_spi_mmio_probe(struct platform_device *pdev)
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700241{
Alexandre Bellonic2c25cc2018-07-27 21:53:56 +0200242 int (*init_func)(struct platform_device *pdev,
243 struct dw_spi_mmio *dwsmmio);
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700244 struct dw_spi_mmio *dwsmmio;
Serge Semin77810d42020-05-15 13:47:50 +0300245 struct resource *mem;
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700246 struct dw_spi *dws;
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700247 int ret;
Steffen Trumtrar22dae172014-06-13 15:36:18 +0200248 int num_cs;
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700249
Baruch Siach04f421e2013-12-30 20:30:44 +0200250 dwsmmio = devm_kzalloc(&pdev->dev, sizeof(struct dw_spi_mmio),
251 GFP_KERNEL);
252 if (!dwsmmio)
253 return -ENOMEM;
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700254
255 dws = &dwsmmio->dws;
256
257 /* Get basic io resource and map it */
Serge Semin77810d42020-05-15 13:47:50 +0300258 dws->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &mem);
Andy Shevchenkoafb7f5652020-05-12 14:03:15 +0300259 if (IS_ERR(dws->regs))
Baruch Siach04f421e2013-12-30 20:30:44 +0200260 return PTR_ERR(dws->regs);
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700261
Serge Semin77810d42020-05-15 13:47:50 +0300262 dws->paddr = mem->start;
263
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700264 dws->irq = platform_get_irq(pdev, 0);
Stephen Boyd6b8ac102019-07-30 11:15:41 -0700265 if (dws->irq < 0)
Baruch Siach04f421e2013-12-30 20:30:44 +0200266 return dws->irq; /* -ENXIO */
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700267
Baruch Siach04f421e2013-12-30 20:30:44 +0200268 dwsmmio->clk = devm_clk_get(&pdev->dev, NULL);
269 if (IS_ERR(dwsmmio->clk))
270 return PTR_ERR(dwsmmio->clk);
Baruch Siach020fe3f2013-12-30 20:30:45 +0200271 ret = clk_prepare_enable(dwsmmio->clk);
Baruch Siach04f421e2013-12-30 20:30:44 +0200272 if (ret)
273 return ret;
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700274
Phil Edworthy560ee7e2019-03-19 15:52:07 +0000275 /* Optional clock needed to access the registers */
276 dwsmmio->pclk = devm_clk_get_optional(&pdev->dev, "pclk");
Andy Shevchenko3da98342019-07-10 14:42:43 +0300277 if (IS_ERR(dwsmmio->pclk)) {
278 ret = PTR_ERR(dwsmmio->pclk);
279 goto out_clk;
280 }
Phil Edworthy560ee7e2019-03-19 15:52:07 +0000281 ret = clk_prepare_enable(dwsmmio->pclk);
282 if (ret)
283 goto out_clk;
284
Dinh Nguyen7830c0e2020-05-29 10:58:05 -0500285 /* find an optional reset controller */
286 dwsmmio->rstc = devm_reset_control_get_optional_exclusive(&pdev->dev, "spi");
287 if (IS_ERR(dwsmmio->rstc)) {
288 ret = PTR_ERR(dwsmmio->rstc);
289 goto out_clk;
290 }
291 reset_control_deassert(dwsmmio->rstc);
292
Baruch Siach2418991e2014-01-26 10:14:32 +0200293 dws->bus_num = pdev->id;
Steffen Trumtrar22dae172014-06-13 15:36:18 +0200294
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700295 dws->max_freq = clk_get_rate(dwsmmio->clk);
296
Andy Shevchenko98999952015-10-14 23:12:25 +0300297 device_property_read_u32(&pdev->dev, "reg-io-width", &dws->reg_io_width);
Michael van der Westhuizenc4fe57f2015-08-18 22:21:53 +0200298
Steffen Trumtrar22dae172014-06-13 15:36:18 +0200299 num_cs = 4;
300
Andy Shevchenko98999952015-10-14 23:12:25 +0300301 device_property_read_u32(&pdev->dev, "num-cs", &num_cs);
Steffen Trumtrar22dae172014-06-13 15:36:18 +0200302
303 dws->num_cs = num_cs;
304
Alexandre Bellonic2c25cc2018-07-27 21:53:56 +0200305 init_func = device_get_match_data(&pdev->dev);
306 if (init_func) {
307 ret = init_func(pdev, dwsmmio);
308 if (ret)
309 goto out;
310 }
311
Jarkko Nikulab9fc2d22019-10-18 16:21:29 +0300312 pm_runtime_enable(&pdev->dev);
313
Baruch Siach04f421e2013-12-30 20:30:44 +0200314 ret = dw_spi_add_host(&pdev->dev, dws);
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700315 if (ret)
Baruch Siach04f421e2013-12-30 20:30:44 +0200316 goto out;
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700317
318 platform_set_drvdata(pdev, dwsmmio);
319 return 0;
320
Baruch Siach04f421e2013-12-30 20:30:44 +0200321out:
Jarkko Nikulab9fc2d22019-10-18 16:21:29 +0300322 pm_runtime_disable(&pdev->dev);
Phil Edworthy560ee7e2019-03-19 15:52:07 +0000323 clk_disable_unprepare(dwsmmio->pclk);
324out_clk:
Baruch Siach020fe3f2013-12-30 20:30:45 +0200325 clk_disable_unprepare(dwsmmio->clk);
Dinh Nguyen7830c0e2020-05-29 10:58:05 -0500326 reset_control_assert(dwsmmio->rstc);
327
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700328 return ret;
329}
330
Grant Likelyfd4a3192012-12-07 16:57:14 +0000331static int dw_spi_mmio_remove(struct platform_device *pdev)
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700332{
333 struct dw_spi_mmio *dwsmmio = platform_get_drvdata(pdev);
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700334
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700335 dw_spi_remove_host(&dwsmmio->dws);
Jarkko Nikulab9fc2d22019-10-18 16:21:29 +0300336 pm_runtime_disable(&pdev->dev);
Phil Edworthy560ee7e2019-03-19 15:52:07 +0000337 clk_disable_unprepare(dwsmmio->pclk);
Marek Vasut400c18e2017-04-18 20:09:06 +0200338 clk_disable_unprepare(dwsmmio->clk);
Dinh Nguyen7830c0e2020-05-29 10:58:05 -0500339 reset_control_assert(dwsmmio->rstc);
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700340
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700341 return 0;
342}
343
Steffen Trumtrar22dae172014-06-13 15:36:18 +0200344static const struct of_device_id dw_spi_mmio_of_match[] = {
Wan Ahmad Zainiec4eadee2020-05-05 21:06:13 +0800345 { .compatible = "snps,dw-apb-ssi", .data = dw_spi_dw_apb_init},
Alexandre Bellonibe17ee02018-08-29 14:45:48 +0200346 { .compatible = "mscc,ocelot-spi", .data = dw_spi_mscc_ocelot_init},
347 { .compatible = "mscc,jaguar2-spi", .data = dw_spi_mscc_jaguar2_init},
Talel Shenharf2d70472018-10-11 14:20:07 +0300348 { .compatible = "amazon,alpine-dw-apb-ssi", .data = dw_spi_alpine_init},
Wan Ahmad Zainiec4eadee2020-05-05 21:06:13 +0800349 { .compatible = "renesas,rzn1-spi", .data = dw_spi_dw_apb_init},
Wan Ahmad Zainiee539f432020-05-05 21:06:14 +0800350 { .compatible = "snps,dwc-ssi-1.01a", .data = dw_spi_dwc_ssi_init},
Wan Ahmad Zainief4237792020-05-05 21:06:16 +0800351 { .compatible = "intel,keembay-ssi", .data = dw_spi_keembay_init},
Lars Povlsen53a09632020-08-24 22:30:06 +0200352 { .compatible = "microchip,sparx5-spi", dw_spi_mscc_sparx5_init},
Damien Le Moalb0dfd942020-12-06 10:18:17 +0900353 { .compatible = "canaan,k210-spi", dw_spi_canaan_k210_init},
Steffen Trumtrar22dae172014-06-13 15:36:18 +0200354 { /* end of table */}
355};
356MODULE_DEVICE_TABLE(of, dw_spi_mmio_of_match);
357
Jay Fang4dd227a2020-05-09 10:29:51 +0800358#ifdef CONFIG_ACPI
Jay Fang32215a62018-12-03 11:15:50 +0800359static const struct acpi_device_id dw_spi_mmio_acpi_match[] = {
Wan Ahmad Zainiec4eadee2020-05-05 21:06:13 +0800360 {"HISI0173", (kernel_ulong_t)dw_spi_dw_apb_init},
Jay Fang32215a62018-12-03 11:15:50 +0800361 {},
362};
363MODULE_DEVICE_TABLE(acpi, dw_spi_mmio_acpi_match);
Jay Fang4dd227a2020-05-09 10:29:51 +0800364#endif
Jay Fang32215a62018-12-03 11:15:50 +0800365
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700366static struct platform_driver dw_spi_mmio_driver = {
Grant Likely940ab882011-10-05 11:29:49 -0600367 .probe = dw_spi_mmio_probe,
Grant Likelyfd4a3192012-12-07 16:57:14 +0000368 .remove = dw_spi_mmio_remove,
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700369 .driver = {
370 .name = DRIVER_NAME,
Steffen Trumtrar22dae172014-06-13 15:36:18 +0200371 .of_match_table = dw_spi_mmio_of_match,
Jay Fang32215a62018-12-03 11:15:50 +0800372 .acpi_match_table = ACPI_PTR(dw_spi_mmio_acpi_match),
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700373 },
374};
Grant Likely940ab882011-10-05 11:29:49 -0600375module_platform_driver(dw_spi_mmio_driver);
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700376
377MODULE_AUTHOR("Jean-Hugues Deschenes <jean-hugues.deschenes@octasic.com>");
378MODULE_DESCRIPTION("Memory-mapped I/O interface driver for DW SPI Core");
379MODULE_LICENSE("GPL v2");