blob: 18772c0c92206651343e6e8c4b92873b530690d1 [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
Wan Ahmad Zainief4237792020-05-05 21:06:16 +080051/*
52 * For Keem Bay, CTRLR0[31] is used to select controller mode.
53 * 0: SSI is slave
54 * 1: SSI is master
55 */
56#define KEEMBAY_CTRLR0_SSIC_IS_MST BIT(31)
57
Alexandre Bellonic2c25cc2018-07-27 21:53:56 +020058struct dw_spi_mscc {
59 struct regmap *syscon;
Lars Povlsen53a09632020-08-24 22:30:06 +020060 void __iomem *spi_mst; /* Not sparx5 */
Alexandre Bellonic2c25cc2018-07-27 21:53:56 +020061};
62
63/*
64 * The Designware SPI controller (referred to as master in the documentation)
65 * automatically deasserts chip select when the tx fifo is empty. The chip
66 * selects then needs to be either driven as GPIOs or, for the first 4 using the
67 * the SPI boot controller registers. the final chip select is an OR gate
68 * between the Designware SPI controller and the SPI boot controller.
69 */
70static void dw_spi_mscc_set_cs(struct spi_device *spi, bool enable)
71{
72 struct dw_spi *dws = spi_master_get_devdata(spi->master);
73 struct dw_spi_mmio *dwsmmio = container_of(dws, struct dw_spi_mmio, dws);
74 struct dw_spi_mscc *dwsmscc = dwsmmio->priv;
75 u32 cs = spi->chip_select;
76
77 if (cs < 4) {
78 u32 sw_mode = MSCC_SPI_MST_SW_MODE_SW_PIN_CTRL_MODE;
79
80 if (!enable)
81 sw_mode |= MSCC_SPI_MST_SW_MODE_SW_SPI_CS(BIT(cs));
82
83 writel(sw_mode, dwsmscc->spi_mst + MSCC_SPI_MST_SW_MODE);
84 }
85
86 dw_spi_set_cs(spi, enable);
87}
88
89static int dw_spi_mscc_init(struct platform_device *pdev,
Alexandre Bellonibe17ee02018-08-29 14:45:48 +020090 struct dw_spi_mmio *dwsmmio,
91 const char *cpu_syscon, u32 if_si_owner_offset)
Alexandre Bellonic2c25cc2018-07-27 21:53:56 +020092{
93 struct dw_spi_mscc *dwsmscc;
Alexandre Bellonic2c25cc2018-07-27 21:53:56 +020094
95 dwsmscc = devm_kzalloc(&pdev->dev, sizeof(*dwsmscc), GFP_KERNEL);
96 if (!dwsmscc)
97 return -ENOMEM;
98
YueHaibing5cc6fdc2019-09-04 21:58:54 +080099 dwsmscc->spi_mst = devm_platform_ioremap_resource(pdev, 1);
Alexandre Bellonic2c25cc2018-07-27 21:53:56 +0200100 if (IS_ERR(dwsmscc->spi_mst)) {
101 dev_err(&pdev->dev, "SPI_MST region map failed\n");
102 return PTR_ERR(dwsmscc->spi_mst);
103 }
104
Alexandre Bellonibe17ee02018-08-29 14:45:48 +0200105 dwsmscc->syscon = syscon_regmap_lookup_by_compatible(cpu_syscon);
Alexandre Bellonic2c25cc2018-07-27 21:53:56 +0200106 if (IS_ERR(dwsmscc->syscon))
107 return PTR_ERR(dwsmscc->syscon);
108
109 /* Deassert all CS */
110 writel(0, dwsmscc->spi_mst + MSCC_SPI_MST_SW_MODE);
111
112 /* Select the owner of the SI interface */
113 regmap_update_bits(dwsmscc->syscon, MSCC_CPU_SYSTEM_CTRL_GENERAL_CTRL,
Alexandre Bellonic1d8b082018-08-31 13:40:46 +0200114 MSCC_IF_SI_OWNER_MASK << if_si_owner_offset,
Alexandre Bellonibe17ee02018-08-29 14:45:48 +0200115 MSCC_IF_SI_OWNER_SIMC << if_si_owner_offset);
Alexandre Bellonic2c25cc2018-07-27 21:53:56 +0200116
117 dwsmmio->dws.set_cs = dw_spi_mscc_set_cs;
118 dwsmmio->priv = dwsmscc;
119
Wan Ahmad Zainiec4eadee2020-05-05 21:06:13 +0800120 /* Register hook to configure CTRLR0 */
121 dwsmmio->dws.update_cr0 = dw_spi_update_cr0;
122
Alexandre Bellonic2c25cc2018-07-27 21:53:56 +0200123 return 0;
124}
125
Alexandre Bellonibe17ee02018-08-29 14:45:48 +0200126static int dw_spi_mscc_ocelot_init(struct platform_device *pdev,
127 struct dw_spi_mmio *dwsmmio)
128{
129 return dw_spi_mscc_init(pdev, dwsmmio, "mscc,ocelot-cpu-syscon",
130 OCELOT_IF_SI_OWNER_OFFSET);
131}
132
133static int dw_spi_mscc_jaguar2_init(struct platform_device *pdev,
134 struct dw_spi_mmio *dwsmmio)
135{
136 return dw_spi_mscc_init(pdev, dwsmmio, "mscc,jaguar2-cpu-syscon",
137 JAGUAR2_IF_SI_OWNER_OFFSET);
138}
139
Lars Povlsen53a09632020-08-24 22:30:06 +0200140/*
141 * The Designware SPI controller (referred to as master in the
142 * documentation) automatically deasserts chip select when the tx fifo
143 * is empty. The chip selects then needs to be driven by a CS override
144 * register. enable is an active low signal.
145 */
146static void dw_spi_sparx5_set_cs(struct spi_device *spi, bool enable)
147{
148 struct dw_spi *dws = spi_master_get_devdata(spi->master);
149 struct dw_spi_mmio *dwsmmio = container_of(dws, struct dw_spi_mmio, dws);
150 struct dw_spi_mscc *dwsmscc = dwsmmio->priv;
151 u8 cs = spi->chip_select;
152
153 if (!enable) {
154 /* CS override drive enable */
155 regmap_write(dwsmscc->syscon, SPARX5_FORCE_ENA, 1);
156 /* Now set CSx enabled */
157 regmap_write(dwsmscc->syscon, SPARX5_FORCE_VAL, ~BIT(cs));
158 /* Allow settle */
159 usleep_range(1, 5);
160 } else {
161 /* CS value */
162 regmap_write(dwsmscc->syscon, SPARX5_FORCE_VAL, ~0);
163 /* Allow settle */
164 usleep_range(1, 5);
165 /* CS override drive disable */
166 regmap_write(dwsmscc->syscon, SPARX5_FORCE_ENA, 0);
167 }
168
169 dw_spi_set_cs(spi, enable);
170}
171
172static int dw_spi_mscc_sparx5_init(struct platform_device *pdev,
173 struct dw_spi_mmio *dwsmmio)
174{
175 const char *syscon_name = "microchip,sparx5-cpu-syscon";
176 struct device *dev = &pdev->dev;
177 struct dw_spi_mscc *dwsmscc;
178
179 if (!IS_ENABLED(CONFIG_SPI_MUX)) {
180 dev_err(dev, "This driver needs CONFIG_SPI_MUX\n");
181 return -EOPNOTSUPP;
182 }
183
184 dwsmscc = devm_kzalloc(dev, sizeof(*dwsmscc), GFP_KERNEL);
185 if (!dwsmscc)
186 return -ENOMEM;
187
188 dwsmscc->syscon =
189 syscon_regmap_lookup_by_compatible(syscon_name);
190 if (IS_ERR(dwsmscc->syscon)) {
191 dev_err(dev, "No syscon map %s\n", syscon_name);
192 return PTR_ERR(dwsmscc->syscon);
193 }
194
195 dwsmmio->dws.set_cs = dw_spi_sparx5_set_cs;
196 dwsmmio->priv = dwsmscc;
197
198 /* Register hook to configure CTRLR0 */
199 dwsmmio->dws.update_cr0 = dw_spi_update_cr0;
200
201 return 0;
202}
203
Talel Shenharf2d70472018-10-11 14:20:07 +0300204static int dw_spi_alpine_init(struct platform_device *pdev,
205 struct dw_spi_mmio *dwsmmio)
206{
207 dwsmmio->dws.cs_override = 1;
208
Wan Ahmad Zainiec4eadee2020-05-05 21:06:13 +0800209 /* Register hook to configure CTRLR0 */
210 dwsmmio->dws.update_cr0 = dw_spi_update_cr0;
211
212 return 0;
213}
214
215static int dw_spi_dw_apb_init(struct platform_device *pdev,
216 struct dw_spi_mmio *dwsmmio)
217{
218 /* Register hook to configure CTRLR0 */
219 dwsmmio->dws.update_cr0 = dw_spi_update_cr0;
220
Serge Semin0fdad592020-05-29 16:12:03 +0300221 dw_spi_dma_setup_generic(&dwsmmio->dws);
222
Talel Shenharf2d70472018-10-11 14:20:07 +0300223 return 0;
224}
225
Wan Ahmad Zainiee539f432020-05-05 21:06:14 +0800226static int dw_spi_dwc_ssi_init(struct platform_device *pdev,
227 struct dw_spi_mmio *dwsmmio)
228{
229 /* Register hook to configure CTRLR0 */
230 dwsmmio->dws.update_cr0 = dw_spi_update_cr0_v1_01a;
231
Serge Semin0fdad592020-05-29 16:12:03 +0300232 dw_spi_dma_setup_generic(&dwsmmio->dws);
233
Wan Ahmad Zainiee539f432020-05-05 21:06:14 +0800234 return 0;
235}
236
Wan Ahmad Zainief4237792020-05-05 21:06:16 +0800237static u32 dw_spi_update_cr0_keembay(struct spi_controller *master,
238 struct spi_device *spi,
239 struct spi_transfer *transfer)
240{
241 u32 cr0 = dw_spi_update_cr0_v1_01a(master, spi, transfer);
242
243 return cr0 | KEEMBAY_CTRLR0_SSIC_IS_MST;
244}
245
246static int dw_spi_keembay_init(struct platform_device *pdev,
247 struct dw_spi_mmio *dwsmmio)
248{
249 /* Register hook to configure CTRLR0 */
250 dwsmmio->dws.update_cr0 = dw_spi_update_cr0_keembay;
251
252 return 0;
253}
254
Grant Likelyfd4a3192012-12-07 16:57:14 +0000255static int dw_spi_mmio_probe(struct platform_device *pdev)
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700256{
Alexandre Bellonic2c25cc2018-07-27 21:53:56 +0200257 int (*init_func)(struct platform_device *pdev,
258 struct dw_spi_mmio *dwsmmio);
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700259 struct dw_spi_mmio *dwsmmio;
Serge Semin77810d42020-05-15 13:47:50 +0300260 struct resource *mem;
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700261 struct dw_spi *dws;
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700262 int ret;
Steffen Trumtrar22dae172014-06-13 15:36:18 +0200263 int num_cs;
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700264
Baruch Siach04f421e2013-12-30 20:30:44 +0200265 dwsmmio = devm_kzalloc(&pdev->dev, sizeof(struct dw_spi_mmio),
266 GFP_KERNEL);
267 if (!dwsmmio)
268 return -ENOMEM;
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700269
270 dws = &dwsmmio->dws;
271
272 /* Get basic io resource and map it */
Serge Semin77810d42020-05-15 13:47:50 +0300273 dws->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &mem);
Andy Shevchenkoafb7f5652020-05-12 14:03:15 +0300274 if (IS_ERR(dws->regs))
Baruch Siach04f421e2013-12-30 20:30:44 +0200275 return PTR_ERR(dws->regs);
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700276
Serge Semin77810d42020-05-15 13:47:50 +0300277 dws->paddr = mem->start;
278
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700279 dws->irq = platform_get_irq(pdev, 0);
Stephen Boyd6b8ac102019-07-30 11:15:41 -0700280 if (dws->irq < 0)
Baruch Siach04f421e2013-12-30 20:30:44 +0200281 return dws->irq; /* -ENXIO */
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700282
Baruch Siach04f421e2013-12-30 20:30:44 +0200283 dwsmmio->clk = devm_clk_get(&pdev->dev, NULL);
284 if (IS_ERR(dwsmmio->clk))
285 return PTR_ERR(dwsmmio->clk);
Baruch Siach020fe3f2013-12-30 20:30:45 +0200286 ret = clk_prepare_enable(dwsmmio->clk);
Baruch Siach04f421e2013-12-30 20:30:44 +0200287 if (ret)
288 return ret;
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700289
Phil Edworthy560ee7e2019-03-19 15:52:07 +0000290 /* Optional clock needed to access the registers */
291 dwsmmio->pclk = devm_clk_get_optional(&pdev->dev, "pclk");
Andy Shevchenko3da98342019-07-10 14:42:43 +0300292 if (IS_ERR(dwsmmio->pclk)) {
293 ret = PTR_ERR(dwsmmio->pclk);
294 goto out_clk;
295 }
Phil Edworthy560ee7e2019-03-19 15:52:07 +0000296 ret = clk_prepare_enable(dwsmmio->pclk);
297 if (ret)
298 goto out_clk;
299
Dinh Nguyen7830c0e2020-05-29 10:58:05 -0500300 /* find an optional reset controller */
301 dwsmmio->rstc = devm_reset_control_get_optional_exclusive(&pdev->dev, "spi");
302 if (IS_ERR(dwsmmio->rstc)) {
303 ret = PTR_ERR(dwsmmio->rstc);
304 goto out_clk;
305 }
306 reset_control_deassert(dwsmmio->rstc);
307
Baruch Siach2418991e2014-01-26 10:14:32 +0200308 dws->bus_num = pdev->id;
Steffen Trumtrar22dae172014-06-13 15:36:18 +0200309
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700310 dws->max_freq = clk_get_rate(dwsmmio->clk);
311
Andy Shevchenko98999952015-10-14 23:12:25 +0300312 device_property_read_u32(&pdev->dev, "reg-io-width", &dws->reg_io_width);
Michael van der Westhuizenc4fe57f2015-08-18 22:21:53 +0200313
Steffen Trumtrar22dae172014-06-13 15:36:18 +0200314 num_cs = 4;
315
Andy Shevchenko98999952015-10-14 23:12:25 +0300316 device_property_read_u32(&pdev->dev, "num-cs", &num_cs);
Steffen Trumtrar22dae172014-06-13 15:36:18 +0200317
318 dws->num_cs = num_cs;
319
Alexandre Bellonic2c25cc2018-07-27 21:53:56 +0200320 init_func = device_get_match_data(&pdev->dev);
321 if (init_func) {
322 ret = init_func(pdev, dwsmmio);
323 if (ret)
324 goto out;
325 }
326
Jarkko Nikulab9fc2d22019-10-18 16:21:29 +0300327 pm_runtime_enable(&pdev->dev);
328
Baruch Siach04f421e2013-12-30 20:30:44 +0200329 ret = dw_spi_add_host(&pdev->dev, dws);
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700330 if (ret)
Baruch Siach04f421e2013-12-30 20:30:44 +0200331 goto out;
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700332
333 platform_set_drvdata(pdev, dwsmmio);
334 return 0;
335
Baruch Siach04f421e2013-12-30 20:30:44 +0200336out:
Jarkko Nikulab9fc2d22019-10-18 16:21:29 +0300337 pm_runtime_disable(&pdev->dev);
Phil Edworthy560ee7e2019-03-19 15:52:07 +0000338 clk_disable_unprepare(dwsmmio->pclk);
339out_clk:
Baruch Siach020fe3f2013-12-30 20:30:45 +0200340 clk_disable_unprepare(dwsmmio->clk);
Dinh Nguyen7830c0e2020-05-29 10:58:05 -0500341 reset_control_assert(dwsmmio->rstc);
342
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700343 return ret;
344}
345
Grant Likelyfd4a3192012-12-07 16:57:14 +0000346static int dw_spi_mmio_remove(struct platform_device *pdev)
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700347{
348 struct dw_spi_mmio *dwsmmio = platform_get_drvdata(pdev);
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700349
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700350 dw_spi_remove_host(&dwsmmio->dws);
Jarkko Nikulab9fc2d22019-10-18 16:21:29 +0300351 pm_runtime_disable(&pdev->dev);
Phil Edworthy560ee7e2019-03-19 15:52:07 +0000352 clk_disable_unprepare(dwsmmio->pclk);
Marek Vasut400c18e2017-04-18 20:09:06 +0200353 clk_disable_unprepare(dwsmmio->clk);
Dinh Nguyen7830c0e2020-05-29 10:58:05 -0500354 reset_control_assert(dwsmmio->rstc);
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700355
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700356 return 0;
357}
358
Steffen Trumtrar22dae172014-06-13 15:36:18 +0200359static const struct of_device_id dw_spi_mmio_of_match[] = {
Wan Ahmad Zainiec4eadee2020-05-05 21:06:13 +0800360 { .compatible = "snps,dw-apb-ssi", .data = dw_spi_dw_apb_init},
Alexandre Bellonibe17ee02018-08-29 14:45:48 +0200361 { .compatible = "mscc,ocelot-spi", .data = dw_spi_mscc_ocelot_init},
362 { .compatible = "mscc,jaguar2-spi", .data = dw_spi_mscc_jaguar2_init},
Talel Shenharf2d70472018-10-11 14:20:07 +0300363 { .compatible = "amazon,alpine-dw-apb-ssi", .data = dw_spi_alpine_init},
Wan Ahmad Zainiec4eadee2020-05-05 21:06:13 +0800364 { .compatible = "renesas,rzn1-spi", .data = dw_spi_dw_apb_init},
Wan Ahmad Zainiee539f432020-05-05 21:06:14 +0800365 { .compatible = "snps,dwc-ssi-1.01a", .data = dw_spi_dwc_ssi_init},
Wan Ahmad Zainief4237792020-05-05 21:06:16 +0800366 { .compatible = "intel,keembay-ssi", .data = dw_spi_keembay_init},
Lars Povlsen53a09632020-08-24 22:30:06 +0200367 { .compatible = "microchip,sparx5-spi", dw_spi_mscc_sparx5_init},
Steffen Trumtrar22dae172014-06-13 15:36:18 +0200368 { /* end of table */}
369};
370MODULE_DEVICE_TABLE(of, dw_spi_mmio_of_match);
371
Jay Fang4dd227a2020-05-09 10:29:51 +0800372#ifdef CONFIG_ACPI
Jay Fang32215a62018-12-03 11:15:50 +0800373static const struct acpi_device_id dw_spi_mmio_acpi_match[] = {
Wan Ahmad Zainiec4eadee2020-05-05 21:06:13 +0800374 {"HISI0173", (kernel_ulong_t)dw_spi_dw_apb_init},
Jay Fang32215a62018-12-03 11:15:50 +0800375 {},
376};
377MODULE_DEVICE_TABLE(acpi, dw_spi_mmio_acpi_match);
Jay Fang4dd227a2020-05-09 10:29:51 +0800378#endif
Jay Fang32215a62018-12-03 11:15:50 +0800379
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700380static struct platform_driver dw_spi_mmio_driver = {
Grant Likely940ab882011-10-05 11:29:49 -0600381 .probe = dw_spi_mmio_probe,
Grant Likelyfd4a3192012-12-07 16:57:14 +0000382 .remove = dw_spi_mmio_remove,
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700383 .driver = {
384 .name = DRIVER_NAME,
Steffen Trumtrar22dae172014-06-13 15:36:18 +0200385 .of_match_table = dw_spi_mmio_of_match,
Jay Fang32215a62018-12-03 11:15:50 +0800386 .acpi_match_table = ACPI_PTR(dw_spi_mmio_acpi_match),
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700387 },
388};
Grant Likely940ab882011-10-05 11:29:49 -0600389module_platform_driver(dw_spi_mmio_driver);
Jean-Hugues Deschenesf7b6fd62010-01-21 07:46:42 -0700390
391MODULE_AUTHOR("Jean-Hugues Deschenes <jean-hugues.deschenes@octasic.com>");
392MODULE_DESCRIPTION("Memory-mapped I/O interface driver for DW SPI Core");
393MODULE_LICENSE("GPL v2");