1 // SPDX-License-Identifier: GPL-2.0-only
3 * IMG SPFI controller driver
5 * Copyright (C) 2007,2008,2013 Imagination Technologies Ltd.
6 * Copyright (C) 2014 Google, Inc.
10 #include <linux/delay.h>
11 #include <linux/dmaengine.h>
12 #include <linux/interrupt.h>
14 #include <linux/irq.h>
15 #include <linux/module.h>
17 #include <linux/platform_device.h>
18 #include <linux/pm_runtime.h>
19 #include <linux/scatterlist.h>
20 #include <linux/slab.h>
21 #include <linux/spi/spi.h>
22 #include <linux/spinlock.h>
24 #define SPFI_DEVICE_PARAMETER(x) (0x00 + 0x4 * (x))
25 #define SPFI_DEVICE_PARAMETER_BITCLK_SHIFT 24
26 #define SPFI_DEVICE_PARAMETER_BITCLK_MASK 0xff
27 #define SPFI_DEVICE_PARAMETER_CSSETUP_SHIFT 16
28 #define SPFI_DEVICE_PARAMETER_CSSETUP_MASK 0xff
29 #define SPFI_DEVICE_PARAMETER_CSHOLD_SHIFT 8
30 #define SPFI_DEVICE_PARAMETER_CSHOLD_MASK 0xff
31 #define SPFI_DEVICE_PARAMETER_CSDELAY_SHIFT 0
32 #define SPFI_DEVICE_PARAMETER_CSDELAY_MASK 0xff
34 #define SPFI_CONTROL 0x14
35 #define SPFI_CONTROL_CONTINUE BIT(12)
36 #define SPFI_CONTROL_SOFT_RESET BIT(11)
37 #define SPFI_CONTROL_SEND_DMA BIT(10)
38 #define SPFI_CONTROL_GET_DMA BIT(9)
39 #define SPFI_CONTROL_SE BIT(8)
40 #define SPFI_CONTROL_TMODE_SHIFT 5
41 #define SPFI_CONTROL_TMODE_MASK 0x7
42 #define SPFI_CONTROL_TMODE_SINGLE 0
43 #define SPFI_CONTROL_TMODE_DUAL 1
44 #define SPFI_CONTROL_TMODE_QUAD 2
45 #define SPFI_CONTROL_SPFI_EN BIT(0)
47 #define SPFI_TRANSACTION 0x18
48 #define SPFI_TRANSACTION_TSIZE_SHIFT 16
49 #define SPFI_TRANSACTION_TSIZE_MASK 0xffff
51 #define SPFI_PORT_STATE 0x1c
52 #define SPFI_PORT_STATE_DEV_SEL_SHIFT 20
53 #define SPFI_PORT_STATE_DEV_SEL_MASK 0x7
54 #define SPFI_PORT_STATE_CK_POL(x) BIT(19 - (x))
55 #define SPFI_PORT_STATE_CK_PHASE(x) BIT(14 - (x))
57 #define SPFI_TX_32BIT_VALID_DATA 0x20
58 #define SPFI_TX_8BIT_VALID_DATA 0x24
59 #define SPFI_RX_32BIT_VALID_DATA 0x28
60 #define SPFI_RX_8BIT_VALID_DATA 0x2c
62 #define SPFI_INTERRUPT_STATUS 0x30
63 #define SPFI_INTERRUPT_ENABLE 0x34
64 #define SPFI_INTERRUPT_CLEAR 0x38
65 #define SPFI_INTERRUPT_IACCESS BIT(12)
66 #define SPFI_INTERRUPT_GDEX8BIT BIT(11)
67 #define SPFI_INTERRUPT_ALLDONETRIG BIT(9)
68 #define SPFI_INTERRUPT_GDFUL BIT(8)
69 #define SPFI_INTERRUPT_GDHF BIT(7)
70 #define SPFI_INTERRUPT_GDEX32BIT BIT(6)
71 #define SPFI_INTERRUPT_GDTRIG BIT(5)
72 #define SPFI_INTERRUPT_SDFUL BIT(3)
73 #define SPFI_INTERRUPT_SDHF BIT(2)
74 #define SPFI_INTERRUPT_SDE BIT(1)
75 #define SPFI_INTERRUPT_SDTRIG BIT(0)
78 * There are four parallel FIFOs of 16 bytes each. The word buffer
79 * (*_32BIT_VALID_DATA) accesses all four FIFOs at once, resulting in an
80 * effective FIFO size of 64 bytes. The byte buffer (*_8BIT_VALID_DATA)
81 * accesses only a single FIFO, resulting in an effective FIFO size of
84 #define SPFI_32BIT_FIFO_SIZE 64
85 #define SPFI_8BIT_FIFO_SIZE 16
89 struct spi_controller *host;
98 struct dma_chan *rx_ch;
99 struct dma_chan *tx_ch;
104 static inline u32 spfi_readl(struct img_spfi *spfi, u32 reg)
106 return readl(spfi->regs + reg);
109 static inline void spfi_writel(struct img_spfi *spfi, u32 val, u32 reg)
111 writel(val, spfi->regs + reg);
114 static inline void spfi_start(struct img_spfi *spfi)
118 val = spfi_readl(spfi, SPFI_CONTROL);
119 val |= SPFI_CONTROL_SPFI_EN;
120 spfi_writel(spfi, val, SPFI_CONTROL);
123 static inline void spfi_reset(struct img_spfi *spfi)
125 spfi_writel(spfi, SPFI_CONTROL_SOFT_RESET, SPFI_CONTROL);
126 spfi_writel(spfi, 0, SPFI_CONTROL);
129 static int spfi_wait_all_done(struct img_spfi *spfi)
131 unsigned long timeout = jiffies + msecs_to_jiffies(50);
133 while (time_before(jiffies, timeout)) {
134 u32 status = spfi_readl(spfi, SPFI_INTERRUPT_STATUS);
136 if (status & SPFI_INTERRUPT_ALLDONETRIG) {
137 spfi_writel(spfi, SPFI_INTERRUPT_ALLDONETRIG,
138 SPFI_INTERRUPT_CLEAR);
144 dev_err(spfi->dev, "Timed out waiting for transaction to complete\n");
150 static unsigned int spfi_pio_write32(struct img_spfi *spfi, const u32 *buf,
153 unsigned int count = 0;
156 while (count < max / 4) {
157 spfi_writel(spfi, SPFI_INTERRUPT_SDFUL, SPFI_INTERRUPT_CLEAR);
158 status = spfi_readl(spfi, SPFI_INTERRUPT_STATUS);
159 if (status & SPFI_INTERRUPT_SDFUL)
161 spfi_writel(spfi, buf[count], SPFI_TX_32BIT_VALID_DATA);
168 static unsigned int spfi_pio_write8(struct img_spfi *spfi, const u8 *buf,
171 unsigned int count = 0;
174 while (count < max) {
175 spfi_writel(spfi, SPFI_INTERRUPT_SDFUL, SPFI_INTERRUPT_CLEAR);
176 status = spfi_readl(spfi, SPFI_INTERRUPT_STATUS);
177 if (status & SPFI_INTERRUPT_SDFUL)
179 spfi_writel(spfi, buf[count], SPFI_TX_8BIT_VALID_DATA);
186 static unsigned int spfi_pio_read32(struct img_spfi *spfi, u32 *buf,
189 unsigned int count = 0;
192 while (count < max / 4) {
193 spfi_writel(spfi, SPFI_INTERRUPT_GDEX32BIT,
194 SPFI_INTERRUPT_CLEAR);
195 status = spfi_readl(spfi, SPFI_INTERRUPT_STATUS);
196 if (!(status & SPFI_INTERRUPT_GDEX32BIT))
198 buf[count] = spfi_readl(spfi, SPFI_RX_32BIT_VALID_DATA);
205 static unsigned int spfi_pio_read8(struct img_spfi *spfi, u8 *buf,
208 unsigned int count = 0;
211 while (count < max) {
212 spfi_writel(spfi, SPFI_INTERRUPT_GDEX8BIT,
213 SPFI_INTERRUPT_CLEAR);
214 status = spfi_readl(spfi, SPFI_INTERRUPT_STATUS);
215 if (!(status & SPFI_INTERRUPT_GDEX8BIT))
217 buf[count] = spfi_readl(spfi, SPFI_RX_8BIT_VALID_DATA);
224 static int img_spfi_start_pio(struct spi_controller *host,
225 struct spi_device *spi,
226 struct spi_transfer *xfer)
228 struct img_spfi *spfi = spi_controller_get_devdata(spi->controller);
229 unsigned int tx_bytes = 0, rx_bytes = 0;
230 const void *tx_buf = xfer->tx_buf;
231 void *rx_buf = xfer->rx_buf;
232 unsigned long timeout;
236 tx_bytes = xfer->len;
238 rx_bytes = xfer->len;
243 msecs_to_jiffies(xfer->len * 8 * 1000 / xfer->speed_hz + 100);
244 while ((tx_bytes > 0 || rx_bytes > 0) &&
245 time_before(jiffies, timeout)) {
246 unsigned int tx_count, rx_count;
249 tx_count = spfi_pio_write32(spfi, tx_buf, tx_bytes);
251 tx_count = spfi_pio_write8(spfi, tx_buf, tx_bytes);
254 rx_count = spfi_pio_read32(spfi, rx_buf, rx_bytes);
256 rx_count = spfi_pio_read8(spfi, rx_buf, rx_bytes);
260 tx_bytes -= tx_count;
261 rx_bytes -= rx_count;
266 if (rx_bytes > 0 || tx_bytes > 0) {
267 dev_err(spfi->dev, "PIO transfer timed out\n");
271 ret = spfi_wait_all_done(spfi);
278 static void img_spfi_dma_rx_cb(void *data)
280 struct img_spfi *spfi = data;
283 spfi_wait_all_done(spfi);
285 spin_lock_irqsave(&spfi->lock, flags);
286 spfi->rx_dma_busy = false;
287 if (!spfi->tx_dma_busy)
288 spi_finalize_current_transfer(spfi->host);
289 spin_unlock_irqrestore(&spfi->lock, flags);
292 static void img_spfi_dma_tx_cb(void *data)
294 struct img_spfi *spfi = data;
297 spfi_wait_all_done(spfi);
299 spin_lock_irqsave(&spfi->lock, flags);
300 spfi->tx_dma_busy = false;
301 if (!spfi->rx_dma_busy)
302 spi_finalize_current_transfer(spfi->host);
303 spin_unlock_irqrestore(&spfi->lock, flags);
306 static int img_spfi_start_dma(struct spi_controller *host,
307 struct spi_device *spi,
308 struct spi_transfer *xfer)
310 struct img_spfi *spfi = spi_controller_get_devdata(spi->controller);
311 struct dma_async_tx_descriptor *rxdesc = NULL, *txdesc = NULL;
312 struct dma_slave_config rxconf, txconf;
314 spfi->rx_dma_busy = false;
315 spfi->tx_dma_busy = false;
318 rxconf.direction = DMA_DEV_TO_MEM;
319 if (xfer->len % 4 == 0) {
320 rxconf.src_addr = spfi->phys + SPFI_RX_32BIT_VALID_DATA;
321 rxconf.src_addr_width = 4;
322 rxconf.src_maxburst = 4;
324 rxconf.src_addr = spfi->phys + SPFI_RX_8BIT_VALID_DATA;
325 rxconf.src_addr_width = 1;
326 rxconf.src_maxburst = 4;
328 dmaengine_slave_config(spfi->rx_ch, &rxconf);
330 rxdesc = dmaengine_prep_slave_sg(spfi->rx_ch, xfer->rx_sg.sgl,
337 rxdesc->callback = img_spfi_dma_rx_cb;
338 rxdesc->callback_param = spfi;
342 txconf.direction = DMA_MEM_TO_DEV;
343 if (xfer->len % 4 == 0) {
344 txconf.dst_addr = spfi->phys + SPFI_TX_32BIT_VALID_DATA;
345 txconf.dst_addr_width = 4;
346 txconf.dst_maxburst = 4;
348 txconf.dst_addr = spfi->phys + SPFI_TX_8BIT_VALID_DATA;
349 txconf.dst_addr_width = 1;
350 txconf.dst_maxburst = 4;
352 dmaengine_slave_config(spfi->tx_ch, &txconf);
354 txdesc = dmaengine_prep_slave_sg(spfi->tx_ch, xfer->tx_sg.sgl,
361 txdesc->callback = img_spfi_dma_tx_cb;
362 txdesc->callback_param = spfi;
366 spfi->rx_dma_busy = true;
367 dmaengine_submit(rxdesc);
368 dma_async_issue_pending(spfi->rx_ch);
374 spfi->tx_dma_busy = true;
375 dmaengine_submit(txdesc);
376 dma_async_issue_pending(spfi->tx_ch);
382 dmaengine_terminate_all(spfi->rx_ch);
383 dmaengine_terminate_all(spfi->tx_ch);
387 static void img_spfi_handle_err(struct spi_controller *host,
388 struct spi_message *msg)
390 struct img_spfi *spfi = spi_controller_get_devdata(host);
394 * Stop all DMA and reset the controller if the previous transaction
395 * timed-out and never completed it's DMA.
397 spin_lock_irqsave(&spfi->lock, flags);
398 if (spfi->tx_dma_busy || spfi->rx_dma_busy) {
399 spfi->tx_dma_busy = false;
400 spfi->rx_dma_busy = false;
402 dmaengine_terminate_all(spfi->tx_ch);
403 dmaengine_terminate_all(spfi->rx_ch);
405 spin_unlock_irqrestore(&spfi->lock, flags);
408 static int img_spfi_prepare(struct spi_controller *host, struct spi_message *msg)
410 struct img_spfi *spfi = spi_controller_get_devdata(host);
413 val = spfi_readl(spfi, SPFI_PORT_STATE);
414 val &= ~(SPFI_PORT_STATE_DEV_SEL_MASK <<
415 SPFI_PORT_STATE_DEV_SEL_SHIFT);
416 val |= spi_get_chipselect(msg->spi, 0) << SPFI_PORT_STATE_DEV_SEL_SHIFT;
417 if (msg->spi->mode & SPI_CPHA)
418 val |= SPFI_PORT_STATE_CK_PHASE(spi_get_chipselect(msg->spi, 0));
420 val &= ~SPFI_PORT_STATE_CK_PHASE(spi_get_chipselect(msg->spi, 0));
421 if (msg->spi->mode & SPI_CPOL)
422 val |= SPFI_PORT_STATE_CK_POL(spi_get_chipselect(msg->spi, 0));
424 val &= ~SPFI_PORT_STATE_CK_POL(spi_get_chipselect(msg->spi, 0));
425 spfi_writel(spfi, val, SPFI_PORT_STATE);
430 static int img_spfi_unprepare(struct spi_controller *host,
431 struct spi_message *msg)
433 struct img_spfi *spfi = spi_controller_get_devdata(host);
440 static void img_spfi_config(struct spi_controller *host, struct spi_device *spi,
441 struct spi_transfer *xfer)
443 struct img_spfi *spfi = spi_controller_get_devdata(spi->controller);
447 * output = spfi_clk * (BITCLK / 512), where BITCLK must be a
448 * power of 2 up to 128
450 div = DIV_ROUND_UP(clk_get_rate(spfi->spfi_clk), xfer->speed_hz);
451 div = clamp(512 / (1 << get_count_order(div)), 1, 128);
453 val = spfi_readl(spfi, SPFI_DEVICE_PARAMETER(spi_get_chipselect(spi, 0)));
454 val &= ~(SPFI_DEVICE_PARAMETER_BITCLK_MASK <<
455 SPFI_DEVICE_PARAMETER_BITCLK_SHIFT);
456 val |= div << SPFI_DEVICE_PARAMETER_BITCLK_SHIFT;
457 spfi_writel(spfi, val, SPFI_DEVICE_PARAMETER(spi_get_chipselect(spi, 0)));
459 spfi_writel(spfi, xfer->len << SPFI_TRANSACTION_TSIZE_SHIFT,
462 val = spfi_readl(spfi, SPFI_CONTROL);
463 val &= ~(SPFI_CONTROL_SEND_DMA | SPFI_CONTROL_GET_DMA);
465 val |= SPFI_CONTROL_SEND_DMA;
467 val |= SPFI_CONTROL_GET_DMA;
468 val &= ~(SPFI_CONTROL_TMODE_MASK << SPFI_CONTROL_TMODE_SHIFT);
469 if (xfer->tx_nbits == SPI_NBITS_DUAL &&
470 xfer->rx_nbits == SPI_NBITS_DUAL)
471 val |= SPFI_CONTROL_TMODE_DUAL << SPFI_CONTROL_TMODE_SHIFT;
472 else if (xfer->tx_nbits == SPI_NBITS_QUAD &&
473 xfer->rx_nbits == SPI_NBITS_QUAD)
474 val |= SPFI_CONTROL_TMODE_QUAD << SPFI_CONTROL_TMODE_SHIFT;
475 val |= SPFI_CONTROL_SE;
476 spfi_writel(spfi, val, SPFI_CONTROL);
479 static int img_spfi_transfer_one(struct spi_controller *host,
480 struct spi_device *spi,
481 struct spi_transfer *xfer)
483 struct img_spfi *spfi = spi_controller_get_devdata(spi->controller);
486 if (xfer->len > SPFI_TRANSACTION_TSIZE_MASK) {
488 "Transfer length (%d) is greater than the max supported (%d)",
489 xfer->len, SPFI_TRANSACTION_TSIZE_MASK);
493 img_spfi_config(host, spi, xfer);
494 if (host->can_dma && host->can_dma(host, spi, xfer))
495 ret = img_spfi_start_dma(host, spi, xfer);
497 ret = img_spfi_start_pio(host, spi, xfer);
502 static bool img_spfi_can_dma(struct spi_controller *host, struct spi_device *spi,
503 struct spi_transfer *xfer)
505 if (xfer->len > SPFI_32BIT_FIFO_SIZE)
510 static irqreturn_t img_spfi_irq(int irq, void *dev_id)
512 struct img_spfi *spfi = (struct img_spfi *)dev_id;
515 status = spfi_readl(spfi, SPFI_INTERRUPT_STATUS);
516 if (status & SPFI_INTERRUPT_IACCESS) {
517 spfi_writel(spfi, SPFI_INTERRUPT_IACCESS, SPFI_INTERRUPT_CLEAR);
518 dev_err(spfi->dev, "Illegal access interrupt");
525 static int img_spfi_probe(struct platform_device *pdev)
527 struct spi_controller *host;
528 struct img_spfi *spfi;
529 struct resource *res;
533 host = spi_alloc_host(&pdev->dev, sizeof(*spfi));
536 platform_set_drvdata(pdev, host);
538 spfi = spi_controller_get_devdata(host);
539 spfi->dev = &pdev->dev;
541 spin_lock_init(&spfi->lock);
543 spfi->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
544 if (IS_ERR(spfi->regs)) {
545 ret = PTR_ERR(spfi->regs);
548 spfi->phys = res->start;
550 spfi->irq = platform_get_irq(pdev, 0);
555 ret = devm_request_irq(spfi->dev, spfi->irq, img_spfi_irq,
556 IRQ_TYPE_LEVEL_HIGH, dev_name(spfi->dev), spfi);
560 spfi->sys_clk = devm_clk_get(spfi->dev, "sys");
561 if (IS_ERR(spfi->sys_clk)) {
562 ret = PTR_ERR(spfi->sys_clk);
565 spfi->spfi_clk = devm_clk_get(spfi->dev, "spfi");
566 if (IS_ERR(spfi->spfi_clk)) {
567 ret = PTR_ERR(spfi->spfi_clk);
571 ret = clk_prepare_enable(spfi->sys_clk);
574 ret = clk_prepare_enable(spfi->spfi_clk);
580 * Only enable the error (IACCESS) interrupt. In PIO mode we'll
581 * poll the status of the FIFOs.
583 spfi_writel(spfi, SPFI_INTERRUPT_IACCESS, SPFI_INTERRUPT_ENABLE);
585 host->auto_runtime_pm = true;
586 host->bus_num = pdev->id;
587 host->mode_bits = SPI_CPOL | SPI_CPHA | SPI_TX_DUAL | SPI_RX_DUAL;
588 if (of_property_read_bool(spfi->dev->of_node, "img,supports-quad-mode"))
589 host->mode_bits |= SPI_TX_QUAD | SPI_RX_QUAD;
590 host->dev.of_node = pdev->dev.of_node;
591 host->bits_per_word_mask = SPI_BPW_MASK(32) | SPI_BPW_MASK(8);
592 host->max_speed_hz = clk_get_rate(spfi->spfi_clk) / 4;
593 host->min_speed_hz = clk_get_rate(spfi->spfi_clk) / 512;
596 * Maximum speed supported by spfi is limited to the lower value
597 * between 1/4 of the SPFI clock or to "spfi-max-frequency"
598 * defined in the device tree.
599 * If no value is defined in the device tree assume the maximum
600 * speed supported to be 1/4 of the SPFI clock.
602 if (!of_property_read_u32(spfi->dev->of_node, "spfi-max-frequency",
604 if (host->max_speed_hz > max_speed_hz)
605 host->max_speed_hz = max_speed_hz;
608 host->transfer_one = img_spfi_transfer_one;
609 host->prepare_message = img_spfi_prepare;
610 host->unprepare_message = img_spfi_unprepare;
611 host->handle_err = img_spfi_handle_err;
612 host->use_gpio_descriptors = true;
614 spfi->tx_ch = dma_request_chan(spfi->dev, "tx");
615 if (IS_ERR(spfi->tx_ch)) {
616 ret = PTR_ERR(spfi->tx_ch);
618 if (ret == -EPROBE_DEFER)
622 spfi->rx_ch = dma_request_chan(spfi->dev, "rx");
623 if (IS_ERR(spfi->rx_ch)) {
624 ret = PTR_ERR(spfi->rx_ch);
626 if (ret == -EPROBE_DEFER)
630 if (!spfi->tx_ch || !spfi->rx_ch) {
632 dma_release_channel(spfi->tx_ch);
634 dma_release_channel(spfi->rx_ch);
637 dev_warn(spfi->dev, "Failed to get DMA channels, falling back to PIO mode\n");
639 host->dma_tx = spfi->tx_ch;
640 host->dma_rx = spfi->rx_ch;
641 host->can_dma = img_spfi_can_dma;
644 pm_runtime_set_active(spfi->dev);
645 pm_runtime_enable(spfi->dev);
647 ret = devm_spi_register_controller(spfi->dev, host);
654 pm_runtime_disable(spfi->dev);
656 dma_release_channel(spfi->rx_ch);
658 dma_release_channel(spfi->tx_ch);
659 clk_disable_unprepare(spfi->spfi_clk);
661 clk_disable_unprepare(spfi->sys_clk);
663 spi_controller_put(host);
668 static void img_spfi_remove(struct platform_device *pdev)
670 struct spi_controller *host = platform_get_drvdata(pdev);
671 struct img_spfi *spfi = spi_controller_get_devdata(host);
674 dma_release_channel(spfi->tx_ch);
676 dma_release_channel(spfi->rx_ch);
678 pm_runtime_disable(spfi->dev);
679 if (!pm_runtime_status_suspended(spfi->dev)) {
680 clk_disable_unprepare(spfi->spfi_clk);
681 clk_disable_unprepare(spfi->sys_clk);
686 static int img_spfi_runtime_suspend(struct device *dev)
688 struct spi_controller *host = dev_get_drvdata(dev);
689 struct img_spfi *spfi = spi_controller_get_devdata(host);
691 clk_disable_unprepare(spfi->spfi_clk);
692 clk_disable_unprepare(spfi->sys_clk);
697 static int img_spfi_runtime_resume(struct device *dev)
699 struct spi_controller *host = dev_get_drvdata(dev);
700 struct img_spfi *spfi = spi_controller_get_devdata(host);
703 ret = clk_prepare_enable(spfi->sys_clk);
706 ret = clk_prepare_enable(spfi->spfi_clk);
708 clk_disable_unprepare(spfi->sys_clk);
714 #endif /* CONFIG_PM */
716 #ifdef CONFIG_PM_SLEEP
717 static int img_spfi_suspend(struct device *dev)
719 struct spi_controller *host = dev_get_drvdata(dev);
721 return spi_controller_suspend(host);
724 static int img_spfi_resume(struct device *dev)
726 struct spi_controller *host = dev_get_drvdata(dev);
727 struct img_spfi *spfi = spi_controller_get_devdata(host);
730 ret = pm_runtime_resume_and_get(dev);
736 return spi_controller_resume(host);
738 #endif /* CONFIG_PM_SLEEP */
740 static const struct dev_pm_ops img_spfi_pm_ops = {
741 SET_RUNTIME_PM_OPS(img_spfi_runtime_suspend, img_spfi_runtime_resume,
743 SET_SYSTEM_SLEEP_PM_OPS(img_spfi_suspend, img_spfi_resume)
746 static const struct of_device_id img_spfi_of_match[] = {
747 { .compatible = "img,spfi", },
750 MODULE_DEVICE_TABLE(of, img_spfi_of_match);
752 static struct platform_driver img_spfi_driver = {
755 .pm = &img_spfi_pm_ops,
756 .of_match_table = of_match_ptr(img_spfi_of_match),
758 .probe = img_spfi_probe,
759 .remove_new = img_spfi_remove,
761 module_platform_driver(img_spfi_driver);
763 MODULE_DESCRIPTION("IMG SPFI controller driver");
764 MODULE_AUTHOR("Andrew Bresticker <abrestic@chromium.org>");
765 MODULE_LICENSE("GPL v2");