summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-pxa2xx-pci.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2016-07-04 05:44:25 -0400
committerMark Brown <broonie@kernel.org>2016-07-04 10:13:42 -0400
commit4f4709109ef7e1248b5515c68df4b9c5ad39fbdf (patch)
tree8208282b621e5552194d0b46e723daf6d832601e /drivers/spi/spi-pxa2xx-pci.c
parent743485ea3bee852fa816a2ec6c64b3d500e39895 (diff)
spi: pxa2xx-pci: Enable SPI on Intel Merrifield
The SPI controllers used on Intel Merrifield are PXA2XX compatible. This patch enables them. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-pxa2xx-pci.c')
-rw-r--r--drivers/spi/spi-pxa2xx-pci.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/spi/spi-pxa2xx-pci.c b/drivers/spi/spi-pxa2xx-pci.c
index 8d58598c325d..b025eaf14f0f 100644
--- a/drivers/spi/spi-pxa2xx-pci.c
+++ b/drivers/spi/spi-pxa2xx-pci.c
@@ -15,6 +15,7 @@
15enum { 15enum {
16 PORT_CE4100, 16 PORT_CE4100,
17 PORT_BYT, 17 PORT_BYT,
18 PORT_MRFLD,
18 PORT_BSW0, 19 PORT_BSW0,
19 PORT_BSW1, 20 PORT_BSW1,
20 PORT_BSW2, 21 PORT_BSW2,
@@ -89,6 +90,27 @@ static int lpss_spi_setup(struct pci_dev *dev, struct pxa_spi_info *c)
89 return 0; 90 return 0;
90} 91}
91 92
93static int mrfld_spi_setup(struct pci_dev *dev, struct pxa_spi_info *c)
94{
95 switch (PCI_FUNC(dev->devfn)) {
96 case 0:
97 c->port_id = 3;
98 c->num_chipselect = 1;
99 break;
100 case 1:
101 c->port_id = 5;
102 c->num_chipselect = 4;
103 break;
104 case 2:
105 c->port_id = 6;
106 c->num_chipselect = 1;
107 break;
108 default:
109 return -ENODEV;
110 }
111 return 0;
112}
113
92static struct pxa_spi_info spi_info_configs[] = { 114static struct pxa_spi_info spi_info_configs[] = {
93 [PORT_CE4100] = { 115 [PORT_CE4100] = {
94 .type = PXA25x_SSP, 116 .type = PXA25x_SSP,
@@ -124,6 +146,11 @@ static struct pxa_spi_info spi_info_configs[] = {
124 .tx_param = &bsw2_tx_param, 146 .tx_param = &bsw2_tx_param,
125 .rx_param = &bsw2_rx_param, 147 .rx_param = &bsw2_rx_param,
126 }, 148 },
149 [PORT_MRFLD] = {
150 .type = PXA27x_SSP,
151 .max_clk_rate = 25000000,
152 .setup = mrfld_spi_setup,
153 },
127 [PORT_QUARK_X1000] = { 154 [PORT_QUARK_X1000] = {
128 .type = QUARK_X1000_SSP, 155 .type = QUARK_X1000_SSP,
129 .port_id = -1, 156 .port_id = -1,
@@ -222,6 +249,7 @@ static const struct pci_device_id pxa2xx_spi_pci_devices[] = {
222 { PCI_VDEVICE(INTEL, 0x2e6a), PORT_CE4100 }, 249 { PCI_VDEVICE(INTEL, 0x2e6a), PORT_CE4100 },
223 { PCI_VDEVICE(INTEL, 0x0935), PORT_QUARK_X1000 }, 250 { PCI_VDEVICE(INTEL, 0x0935), PORT_QUARK_X1000 },
224 { PCI_VDEVICE(INTEL, 0x0f0e), PORT_BYT }, 251 { PCI_VDEVICE(INTEL, 0x0f0e), PORT_BYT },
252 { PCI_VDEVICE(INTEL, 0x1194), PORT_MRFLD },
225 { PCI_VDEVICE(INTEL, 0x228e), PORT_BSW0 }, 253 { PCI_VDEVICE(INTEL, 0x228e), PORT_BSW0 },
226 { PCI_VDEVICE(INTEL, 0x2290), PORT_BSW1 }, 254 { PCI_VDEVICE(INTEL, 0x2290), PORT_BSW1 },
227 { PCI_VDEVICE(INTEL, 0x22ac), PORT_BSW2 }, 255 { PCI_VDEVICE(INTEL, 0x22ac), PORT_BSW2 },