aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/dw_spi_pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/spi/dw_spi_pci.c')
-rw-r--r--drivers/spi/dw_spi_pci.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/drivers/spi/dw_spi_pci.c b/drivers/spi/dw_spi_pci.c
index 1f52755dc878..ad260aa5e526 100644
--- a/drivers/spi/dw_spi_pci.c
+++ b/drivers/spi/dw_spi_pci.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * mrst_spi_pci.c - PCI interface driver for DW SPI Core 2 * dw_spi_pci.c - PCI interface driver for DW SPI Core
3 * 3 *
4 * Copyright (c) 2009, Intel Corporation. 4 * Copyright (c) 2009, Intel Corporation.
5 * 5 *
@@ -20,14 +20,15 @@
20#include <linux/interrupt.h> 20#include <linux/interrupt.h>
21#include <linux/pci.h> 21#include <linux/pci.h>
22#include <linux/slab.h> 22#include <linux/slab.h>
23#include <linux/spi/dw_spi.h>
24#include <linux/spi/spi.h> 23#include <linux/spi/spi.h>
25 24
25#include "dw_spi.h"
26
26#define DRIVER_NAME "dw_spi_pci" 27#define DRIVER_NAME "dw_spi_pci"
27 28
28struct dw_spi_pci { 29struct dw_spi_pci {
29 struct pci_dev *pdev; 30 struct pci_dev *pdev;
30 struct dw_spi dws; 31 struct dw_spi dws;
31}; 32};
32 33
33static int __devinit spi_pci_probe(struct pci_dev *pdev, 34static int __devinit spi_pci_probe(struct pci_dev *pdev,
@@ -72,9 +73,17 @@ static int __devinit spi_pci_probe(struct pci_dev *pdev,
72 dws->parent_dev = &pdev->dev; 73 dws->parent_dev = &pdev->dev;
73 dws->bus_num = 0; 74 dws->bus_num = 0;
74 dws->num_cs = 4; 75 dws->num_cs = 4;
75 dws->max_freq = 25000000; /* for Moorestwon */
76 dws->irq = pdev->irq; 76 dws->irq = pdev->irq;
77 dws->fifo_len = 40; /* FIFO has 40 words buffer */ 77
78 /*
79 * Specific handling for Intel MID paltforms, like dma setup,
80 * clock rate, FIFO depth.
81 */
82 if (pdev->device == 0x0800) {
83 ret = dw_spi_mid_init(dws);
84 if (ret)
85 goto err_unmap;
86 }
78 87
79 ret = dw_spi_add_host(dws); 88 ret = dw_spi_add_host(dws);
80 if (ret) 89 if (ret)
@@ -140,7 +149,7 @@ static int spi_resume(struct pci_dev *pdev)
140#endif 149#endif
141 150
142static const struct pci_device_id pci_ids[] __devinitdata = { 151static const struct pci_device_id pci_ids[] __devinitdata = {
143 /* Intel Moorestown platform SPI controller 0 */ 152 /* Intel MID platform SPI controller 0 */
144 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x0800) }, 153 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x0800) },
145 {}, 154 {},
146}; 155};