aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-dw-pci.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2015-03-05 14:52:18 -0500
committerIngo Molnar <mingo@kernel.org>2015-03-05 14:52:18 -0500
commit33ca8a53f262b4af40611bea331b8c87d133af72 (patch)
treed6468c820a556c4915bcb5b761204a0fb19e8225 /drivers/spi/spi-dw-pci.c
parentdb2dcb4f91d5fec5c346a82c309187ee821e2495 (diff)
parent13a7a6ac0a11197edcd0f756a035f472b42cdf8b (diff)
Merge tag 'v4.0-rc2' into irq/core, to refresh the tree before applying new changes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/spi/spi-dw-pci.c')
-rw-r--r--drivers/spi/spi-dw-pci.c38
1 files changed, 30 insertions, 8 deletions
diff --git a/drivers/spi/spi-dw-pci.c b/drivers/spi/spi-dw-pci.c
index ba68da12cdf0..5ba331047cbe 100644
--- a/drivers/spi/spi-dw-pci.c
+++ b/drivers/spi/spi-dw-pci.c
@@ -30,10 +30,20 @@ struct dw_spi_pci {
30 30
31struct spi_pci_desc { 31struct spi_pci_desc {
32 int (*setup)(struct dw_spi *); 32 int (*setup)(struct dw_spi *);
33 u16 num_cs;
34 u16 bus_num;
33}; 35};
34 36
35static struct spi_pci_desc spi_pci_mid_desc = { 37static struct spi_pci_desc spi_pci_mid_desc_1 = {
36 .setup = dw_spi_mid_init, 38 .setup = dw_spi_mid_init,
39 .num_cs = 32,
40 .bus_num = 0,
41};
42
43static struct spi_pci_desc spi_pci_mid_desc_2 = {
44 .setup = dw_spi_mid_init,
45 .num_cs = 4,
46 .bus_num = 1,
37}; 47};
38 48
39static int spi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) 49static int spi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
@@ -65,18 +75,23 @@ static int spi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
65 75
66 dws->regs = pcim_iomap_table(pdev)[pci_bar]; 76 dws->regs = pcim_iomap_table(pdev)[pci_bar];
67 77
68 dws->bus_num = 0;
69 dws->num_cs = 4;
70 dws->irq = pdev->irq; 78 dws->irq = pdev->irq;
71 79
72 /* 80 /*
73 * Specific handling for paltforms, like dma setup, 81 * Specific handling for paltforms, like dma setup,
74 * clock rate, FIFO depth. 82 * clock rate, FIFO depth.
75 */ 83 */
76 if (desc && desc->setup) { 84 if (desc) {
77 ret = desc->setup(dws); 85 dws->num_cs = desc->num_cs;
78 if (ret) 86 dws->bus_num = desc->bus_num;
79 return ret; 87
88 if (desc->setup) {
89 ret = desc->setup(dws);
90 if (ret)
91 return ret;
92 }
93 } else {
94 return -ENODEV;
80 } 95 }
81 96
82 ret = dw_spi_add_host(&pdev->dev, dws); 97 ret = dw_spi_add_host(&pdev->dev, dws);
@@ -121,7 +136,14 @@ static SIMPLE_DEV_PM_OPS(dw_spi_pm_ops, spi_suspend, spi_resume);
121 136
122static const struct pci_device_id pci_ids[] = { 137static const struct pci_device_id pci_ids[] = {
123 /* Intel MID platform SPI controller 0 */ 138 /* Intel MID platform SPI controller 0 */
124 { PCI_VDEVICE(INTEL, 0x0800), (kernel_ulong_t)&spi_pci_mid_desc}, 139 /*
140 * The access to the device 8086:0801 is disabled by HW, since it's
141 * exclusively used by SCU to communicate with MSIC.
142 */
143 /* Intel MID platform SPI controller 1 */
144 { PCI_VDEVICE(INTEL, 0x0800), (kernel_ulong_t)&spi_pci_mid_desc_1},
145 /* Intel MID platform SPI controller 2 */
146 { PCI_VDEVICE(INTEL, 0x0812), (kernel_ulong_t)&spi_pci_mid_desc_2},
125 {}, 147 {},
126}; 148};
127 149