aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2019-01-16 10:13:31 -0500
committerMark Brown <broonie@kernel.org>2019-01-23 05:59:56 -0500
commit51eea52d26d4939b788b7244c28cf47e902b4c4c (patch)
tree9eda241338419c926a471db7acbadf6913049896
parentbfc7af6d6df8d75b9c693b8eb98c21aa75c1e377 (diff)
pxa2xx: replace spi_master with spi_controller
It's also a slave controller driver now, calling it "master" is slightly misleading. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Acked-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--Documentation/spi/pxa2xx10
-rw-r--r--arch/arm/mach-pxa/cm-x255.c2
-rw-r--r--arch/arm/mach-pxa/cm-x270.c2
-rw-r--r--arch/arm/mach-pxa/corgi.c2
-rw-r--r--arch/arm/mach-pxa/devices.c2
-rw-r--r--arch/arm/mach-pxa/em-x270.c4
-rw-r--r--arch/arm/mach-pxa/hx4700.c2
-rw-r--r--arch/arm/mach-pxa/icontrol.c4
-rw-r--r--arch/arm/mach-pxa/littleton.c2
-rw-r--r--arch/arm/mach-pxa/lubbock.c2
-rw-r--r--arch/arm/mach-pxa/magician.c2
-rw-r--r--arch/arm/mach-pxa/pcm027.c2
-rw-r--r--arch/arm/mach-pxa/poodle.c2
-rw-r--r--arch/arm/mach-pxa/spitz.c2
-rw-r--r--arch/arm/mach-pxa/stargate2.c6
-rw-r--r--arch/arm/mach-pxa/tosa.c2
-rw-r--r--arch/arm/mach-pxa/z2.c4
-rw-r--r--arch/arm/mach-pxa/zeus.c2
-rw-r--r--drivers/spi/spi-pxa2xx-dma.c58
-rw-r--r--drivers/spi/spi-pxa2xx-pci.c4
-rw-r--r--drivers/spi/spi-pxa2xx.c156
-rw-r--r--drivers/spi/spi-pxa2xx.h4
-rw-r--r--include/linux/spi/pxa2xx_spi.h4
23 files changed, 140 insertions, 140 deletions
diff --git a/Documentation/spi/pxa2xx b/Documentation/spi/pxa2xx
index 13a0b7fb192f..551325b66b23 100644
--- a/Documentation/spi/pxa2xx
+++ b/Documentation/spi/pxa2xx
@@ -21,15 +21,15 @@ Typically a SPI master is defined in the arch/.../mach-*/board-*.c as a
21"platform device". The master configuration is passed to the driver via a table 21"platform device". The master configuration is passed to the driver via a table
22found in include/linux/spi/pxa2xx_spi.h: 22found in include/linux/spi/pxa2xx_spi.h:
23 23
24struct pxa2xx_spi_master { 24struct pxa2xx_spi_controller {
25 u16 num_chipselect; 25 u16 num_chipselect;
26 u8 enable_dma; 26 u8 enable_dma;
27}; 27};
28 28
29The "pxa2xx_spi_master.num_chipselect" field is used to determine the number of 29The "pxa2xx_spi_controller.num_chipselect" field is used to determine the number of
30slave device (chips) attached to this SPI master. 30slave device (chips) attached to this SPI master.
31 31
32The "pxa2xx_spi_master.enable_dma" field informs the driver that SSP DMA should 32The "pxa2xx_spi_controller.enable_dma" field informs the driver that SSP DMA should
33be used. This caused the driver to acquire two DMA channels: rx_channel and 33be used. This caused the driver to acquire two DMA channels: rx_channel and
34tx_channel. The rx_channel has a higher DMA service priority the tx_channel. 34tx_channel. The rx_channel has a higher DMA service priority the tx_channel.
35See the "PXA2xx Developer Manual" section "DMA Controller". 35See the "PXA2xx Developer Manual" section "DMA Controller".
@@ -51,7 +51,7 @@ static struct resource pxa_spi_nssp_resources[] = {
51 }, 51 },
52}; 52};
53 53
54static struct pxa2xx_spi_master pxa_nssp_master_info = { 54static struct pxa2xx_spi_controller pxa_nssp_master_info = {
55 .num_chipselect = 1, /* Matches the number of chips attached to NSSP */ 55 .num_chipselect = 1, /* Matches the number of chips attached to NSSP */
56 .enable_dma = 1, /* Enables NSSP DMA */ 56 .enable_dma = 1, /* Enables NSSP DMA */
57}; 57};
@@ -206,7 +206,7 @@ DMA and PIO I/O Support
206----------------------- 206-----------------------
207The pxa2xx_spi driver supports both DMA and interrupt driven PIO message 207The pxa2xx_spi driver supports both DMA and interrupt driven PIO message
208transfers. The driver defaults to PIO mode and DMA transfers must be enabled 208transfers. The driver defaults to PIO mode and DMA transfers must be enabled
209by setting the "enable_dma" flag in the "pxa2xx_spi_master" structure. The DMA 209by setting the "enable_dma" flag in the "pxa2xx_spi_controller" structure. The DMA
210mode supports both coherent and stream based DMA mappings. 210mode supports both coherent and stream based DMA mappings.
211 211
212The following logic is used to determine the type of I/O to be used on 212The following logic is used to determine the type of I/O to be used on
diff --git a/arch/arm/mach-pxa/cm-x255.c b/arch/arm/mach-pxa/cm-x255.c
index fa8e7dd4d898..4401dfcd7e68 100644
--- a/arch/arm/mach-pxa/cm-x255.c
+++ b/arch/arm/mach-pxa/cm-x255.c
@@ -98,7 +98,7 @@ static unsigned long cmx255_pin_config[] = {
98}; 98};
99 99
100#if defined(CONFIG_SPI_PXA2XX) 100#if defined(CONFIG_SPI_PXA2XX)
101static struct pxa2xx_spi_master pxa_ssp_master_info = { 101static struct pxa2xx_spi_controller pxa_ssp_master_info = {
102 .num_chipselect = 1, 102 .num_chipselect = 1,
103}; 103};
104 104
diff --git a/arch/arm/mach-pxa/cm-x270.c b/arch/arm/mach-pxa/cm-x270.c
index f7081a50dc67..279eeca7add0 100644
--- a/arch/arm/mach-pxa/cm-x270.c
+++ b/arch/arm/mach-pxa/cm-x270.c
@@ -313,7 +313,7 @@ static inline void cmx270_init_mmc(void) {}
313#endif 313#endif
314 314
315#if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE) 315#if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE)
316static struct pxa2xx_spi_master cm_x270_spi_info = { 316static struct pxa2xx_spi_controller cm_x270_spi_info = {
317 .num_chipselect = 1, 317 .num_chipselect = 1,
318 .enable_dma = 1, 318 .enable_dma = 1,
319}; 319};
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c
index c9732cace5e3..7ecf559bd71c 100644
--- a/arch/arm/mach-pxa/corgi.c
+++ b/arch/arm/mach-pxa/corgi.c
@@ -530,7 +530,7 @@ static struct pxa2xx_udc_mach_info udc_info __initdata = {
530}; 530};
531 531
532#if IS_ENABLED(CONFIG_SPI_PXA2XX) 532#if IS_ENABLED(CONFIG_SPI_PXA2XX)
533static struct pxa2xx_spi_master corgi_spi_info = { 533static struct pxa2xx_spi_controller corgi_spi_info = {
534 .num_chipselect = 3, 534 .num_chipselect = 3,
535}; 535};
536 536
diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c
index a24783a03827..524d6093e0c7 100644
--- a/arch/arm/mach-pxa/devices.c
+++ b/arch/arm/mach-pxa/devices.c
@@ -1065,7 +1065,7 @@ struct platform_device pxa93x_device_gpio = {
1065 1065
1066/* pxa2xx-spi platform-device ID equals respective SSP platform-device ID + 1. 1066/* pxa2xx-spi platform-device ID equals respective SSP platform-device ID + 1.
1067 * See comment in arch/arm/mach-pxa/ssp.c::ssp_probe() */ 1067 * See comment in arch/arm/mach-pxa/ssp.c::ssp_probe() */
1068void __init pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_master *info) 1068void __init pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_controller *info)
1069{ 1069{
1070 struct platform_device *pd; 1070 struct platform_device *pd;
1071 1071
diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c
index 32c1edeb3f14..5e372760f16e 100644
--- a/arch/arm/mach-pxa/em-x270.c
+++ b/arch/arm/mach-pxa/em-x270.c
@@ -689,7 +689,7 @@ static inline void em_x270_init_lcd(void) {}
689#endif 689#endif
690 690
691#if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE) 691#if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE)
692static struct pxa2xx_spi_master em_x270_spi_info = { 692static struct pxa2xx_spi_controller em_x270_spi_info = {
693 .num_chipselect = 1, 693 .num_chipselect = 1,
694}; 694};
695 695
@@ -703,7 +703,7 @@ static struct tdo24m_platform_data em_x270_tdo24m_pdata = {
703 .model = TDO35S, 703 .model = TDO35S,
704}; 704};
705 705
706static struct pxa2xx_spi_master em_x270_spi_2_info = { 706static struct pxa2xx_spi_controller em_x270_spi_2_info = {
707 .num_chipselect = 1, 707 .num_chipselect = 1,
708 .enable_dma = 1, 708 .enable_dma = 1,
709}; 709};
diff --git a/arch/arm/mach-pxa/hx4700.c b/arch/arm/mach-pxa/hx4700.c
index b79b757fdd41..c3b47557b3f2 100644
--- a/arch/arm/mach-pxa/hx4700.c
+++ b/arch/arm/mach-pxa/hx4700.c
@@ -629,7 +629,7 @@ static struct spi_board_info tsc2046_board_info[] __initdata = {
629 }, 629 },
630}; 630};
631 631
632static struct pxa2xx_spi_master pxa_ssp2_master_info = { 632static struct pxa2xx_spi_controller pxa_ssp2_master_info = {
633 .num_chipselect = 1, 633 .num_chipselect = 1,
634 .enable_dma = 1, 634 .enable_dma = 1,
635}; 635};
diff --git a/arch/arm/mach-pxa/icontrol.c b/arch/arm/mach-pxa/icontrol.c
index cbaf4f6edcda..7e30452e3840 100644
--- a/arch/arm/mach-pxa/icontrol.c
+++ b/arch/arm/mach-pxa/icontrol.c
@@ -115,12 +115,12 @@ static struct spi_board_info mcp251x_board_info[] = {
115 } 115 }
116}; 116};
117 117
118static struct pxa2xx_spi_master pxa_ssp3_spi_master_info = { 118static struct pxa2xx_spi_controller pxa_ssp3_spi_master_info = {
119 .num_chipselect = 2, 119 .num_chipselect = 2,
120 .enable_dma = 1 120 .enable_dma = 1
121}; 121};
122 122
123static struct pxa2xx_spi_master pxa_ssp4_spi_master_info = { 123static struct pxa2xx_spi_controller pxa_ssp4_spi_master_info = {
124 .num_chipselect = 2, 124 .num_chipselect = 2,
125 .enable_dma = 1 125 .enable_dma = 1
126}; 126};
diff --git a/arch/arm/mach-pxa/littleton.c b/arch/arm/mach-pxa/littleton.c
index 39db4898dc4a..464b8bd2bcb9 100644
--- a/arch/arm/mach-pxa/littleton.c
+++ b/arch/arm/mach-pxa/littleton.c
@@ -191,7 +191,7 @@ static inline void littleton_init_lcd(void) {};
191#endif /* CONFIG_FB_PXA || CONFIG_FB_PXA_MODULE */ 191#endif /* CONFIG_FB_PXA || CONFIG_FB_PXA_MODULE */
192 192
193#if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE) 193#if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE)
194static struct pxa2xx_spi_master littleton_spi_info = { 194static struct pxa2xx_spi_controller littleton_spi_info = {
195 .num_chipselect = 1, 195 .num_chipselect = 1,
196}; 196};
197 197
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c
index a1391e113ef4..c1bd0d544981 100644
--- a/arch/arm/mach-pxa/lubbock.c
+++ b/arch/arm/mach-pxa/lubbock.c
@@ -197,7 +197,7 @@ static struct platform_device sa1111_device = {
197 * (to J5) and poking board registers (as done below). Else it's only useful 197 * (to J5) and poking board registers (as done below). Else it's only useful
198 * for the temperature sensors. 198 * for the temperature sensors.
199 */ 199 */
200static struct pxa2xx_spi_master pxa_ssp_master_info = { 200static struct pxa2xx_spi_controller pxa_ssp_master_info = {
201 .num_chipselect = 1, 201 .num_chipselect = 1,
202}; 202};
203 203
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index 08b079653c3f..618bcff4cdc9 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -932,7 +932,7 @@ struct pxa2xx_spi_chip tsc2046_chip_info = {
932 .gpio_cs = GPIO14_MAGICIAN_TSC2046_CS, 932 .gpio_cs = GPIO14_MAGICIAN_TSC2046_CS,
933}; 933};
934 934
935static struct pxa2xx_spi_master magician_spi_info = { 935static struct pxa2xx_spi_controller magician_spi_info = {
936 .num_chipselect = 1, 936 .num_chipselect = 1,
937 .enable_dma = 1, 937 .enable_dma = 1,
938}; 938};
diff --git a/arch/arm/mach-pxa/pcm027.c b/arch/arm/mach-pxa/pcm027.c
index ccca9f7575c3..e2e613449660 100644
--- a/arch/arm/mach-pxa/pcm027.c
+++ b/arch/arm/mach-pxa/pcm027.c
@@ -132,7 +132,7 @@ static struct platform_device smc91x_device = {
132/* 132/*
133 * SPI host and devices 133 * SPI host and devices
134 */ 134 */
135static struct pxa2xx_spi_master pxa_ssp_master_info = { 135static struct pxa2xx_spi_controller pxa_ssp_master_info = {
136 .num_chipselect = 1, 136 .num_chipselect = 1,
137}; 137};
138 138
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c
index c2a43d4cfd3e..9450a523cd0b 100644
--- a/arch/arm/mach-pxa/poodle.c
+++ b/arch/arm/mach-pxa/poodle.c
@@ -196,7 +196,7 @@ struct platform_device poodle_locomo_device = {
196EXPORT_SYMBOL(poodle_locomo_device); 196EXPORT_SYMBOL(poodle_locomo_device);
197 197
198#if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE) 198#if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE)
199static struct pxa2xx_spi_master poodle_spi_info = { 199static struct pxa2xx_spi_controller poodle_spi_info = {
200 .num_chipselect = 1, 200 .num_chipselect = 1,
201}; 201};
202 202
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index 306818e2cf54..8dac824a85df 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -572,7 +572,7 @@ static struct spi_board_info spitz_spi_devices[] = {
572 }, 572 },
573}; 573};
574 574
575static struct pxa2xx_spi_master spitz_spi_info = { 575static struct pxa2xx_spi_controller spitz_spi_info = {
576 .num_chipselect = 3, 576 .num_chipselect = 3,
577}; 577};
578 578
diff --git a/arch/arm/mach-pxa/stargate2.c b/arch/arm/mach-pxa/stargate2.c
index e0d6c872270a..c28d19b126a7 100644
--- a/arch/arm/mach-pxa/stargate2.c
+++ b/arch/arm/mach-pxa/stargate2.c
@@ -337,15 +337,15 @@ static struct platform_device stargate2_flash_device = {
337 .num_resources = 1, 337 .num_resources = 1,
338}; 338};
339 339
340static struct pxa2xx_spi_master pxa_ssp_master_0_info = { 340static struct pxa2xx_spi_controller pxa_ssp_master_0_info = {
341 .num_chipselect = 1, 341 .num_chipselect = 1,
342}; 342};
343 343
344static struct pxa2xx_spi_master pxa_ssp_master_1_info = { 344static struct pxa2xx_spi_controller pxa_ssp_master_1_info = {
345 .num_chipselect = 1, 345 .num_chipselect = 1,
346}; 346};
347 347
348static struct pxa2xx_spi_master pxa_ssp_master_2_info = { 348static struct pxa2xx_spi_controller pxa_ssp_master_2_info = {
349 .num_chipselect = 1, 349 .num_chipselect = 1,
350}; 350};
351 351
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c
index e8a93c088c35..7439798d58e4 100644
--- a/arch/arm/mach-pxa/tosa.c
+++ b/arch/arm/mach-pxa/tosa.c
@@ -813,7 +813,7 @@ static struct platform_device tosa_bt_device = {
813 .dev.platform_data = &tosa_bt_data, 813 .dev.platform_data = &tosa_bt_data,
814}; 814};
815 815
816static struct pxa2xx_spi_master pxa_ssp_master_info = { 816static struct pxa2xx_spi_controller pxa_ssp_master_info = {
817 .num_chipselect = 1, 817 .num_chipselect = 1,
818}; 818};
819 819
diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c
index e2353e75bb28..ad082e11e2a4 100644
--- a/arch/arm/mach-pxa/z2.c
+++ b/arch/arm/mach-pxa/z2.c
@@ -607,12 +607,12 @@ static struct spi_board_info spi_board_info[] __initdata = {
607}, 607},
608}; 608};
609 609
610static struct pxa2xx_spi_master pxa_ssp1_master_info = { 610static struct pxa2xx_spi_controller pxa_ssp1_master_info = {
611 .num_chipselect = 1, 611 .num_chipselect = 1,
612 .enable_dma = 1, 612 .enable_dma = 1,
613}; 613};
614 614
615static struct pxa2xx_spi_master pxa_ssp2_master_info = { 615static struct pxa2xx_spi_controller pxa_ssp2_master_info = {
616 .num_chipselect = 1, 616 .num_chipselect = 1,
617}; 617};
618 618
diff --git a/arch/arm/mach-pxa/zeus.c b/arch/arm/mach-pxa/zeus.c
index c411f79d4cb5..bdbcf46595f9 100644
--- a/arch/arm/mach-pxa/zeus.c
+++ b/arch/arm/mach-pxa/zeus.c
@@ -391,7 +391,7 @@ static struct platform_device zeus_sram_device = {
391}; 391};
392 392
393/* SPI interface on SSP3 */ 393/* SPI interface on SSP3 */
394static struct pxa2xx_spi_master pxa2xx_spi_ssp3_master_info = { 394static struct pxa2xx_spi_controller pxa2xx_spi_ssp3_master_info = {
395 .num_chipselect = 1, 395 .num_chipselect = 1,
396 .enable_dma = 1, 396 .enable_dma = 1,
397}; 397};
diff --git a/drivers/spi/spi-pxa2xx-dma.c b/drivers/spi/spi-pxa2xx-dma.c
index 2fa7f4b43492..15592598273e 100644
--- a/drivers/spi/spi-pxa2xx-dma.c
+++ b/drivers/spi/spi-pxa2xx-dma.c
@@ -23,7 +23,7 @@
23static void pxa2xx_spi_dma_transfer_complete(struct driver_data *drv_data, 23static void pxa2xx_spi_dma_transfer_complete(struct driver_data *drv_data,
24 bool error) 24 bool error)
25{ 25{
26 struct spi_message *msg = drv_data->master->cur_msg; 26 struct spi_message *msg = drv_data->controller->cur_msg;
27 27
28 /* 28 /*
29 * It is possible that one CPU is handling ROR interrupt and other 29 * It is possible that one CPU is handling ROR interrupt and other
@@ -59,7 +59,7 @@ static void pxa2xx_spi_dma_transfer_complete(struct driver_data *drv_data,
59 msg->status = -EIO; 59 msg->status = -EIO;
60 } 60 }
61 61
62 spi_finalize_current_transfer(drv_data->master); 62 spi_finalize_current_transfer(drv_data->controller);
63 } 63 }
64} 64}
65 65
@@ -74,7 +74,7 @@ pxa2xx_spi_dma_prepare_one(struct driver_data *drv_data,
74 struct spi_transfer *xfer) 74 struct spi_transfer *xfer)
75{ 75{
76 struct chip_data *chip = 76 struct chip_data *chip =
77 spi_get_ctldata(drv_data->master->cur_msg->spi); 77 spi_get_ctldata(drv_data->controller->cur_msg->spi);
78 enum dma_slave_buswidth width; 78 enum dma_slave_buswidth width;
79 struct dma_slave_config cfg; 79 struct dma_slave_config cfg;
80 struct dma_chan *chan; 80 struct dma_chan *chan;
@@ -102,14 +102,14 @@ pxa2xx_spi_dma_prepare_one(struct driver_data *drv_data,
102 cfg.dst_maxburst = chip->dma_burst_size; 102 cfg.dst_maxburst = chip->dma_burst_size;
103 103
104 sgt = &xfer->tx_sg; 104 sgt = &xfer->tx_sg;
105 chan = drv_data->master->dma_tx; 105 chan = drv_data->controller->dma_tx;
106 } else { 106 } else {
107 cfg.src_addr = drv_data->ssdr_physical; 107 cfg.src_addr = drv_data->ssdr_physical;
108 cfg.src_addr_width = width; 108 cfg.src_addr_width = width;
109 cfg.src_maxburst = chip->dma_burst_size; 109 cfg.src_maxburst = chip->dma_burst_size;
110 110
111 sgt = &xfer->rx_sg; 111 sgt = &xfer->rx_sg;
112 chan = drv_data->master->dma_rx; 112 chan = drv_data->controller->dma_rx;
113 } 113 }
114 114
115 ret = dmaengine_slave_config(chan, &cfg); 115 ret = dmaengine_slave_config(chan, &cfg);
@@ -130,8 +130,8 @@ irqreturn_t pxa2xx_spi_dma_transfer(struct driver_data *drv_data)
130 if (status & SSSR_ROR) { 130 if (status & SSSR_ROR) {
131 dev_err(&drv_data->pdev->dev, "FIFO overrun\n"); 131 dev_err(&drv_data->pdev->dev, "FIFO overrun\n");
132 132
133 dmaengine_terminate_async(drv_data->master->dma_rx); 133 dmaengine_terminate_async(drv_data->controller->dma_rx);
134 dmaengine_terminate_async(drv_data->master->dma_tx); 134 dmaengine_terminate_async(drv_data->controller->dma_tx);
135 135
136 pxa2xx_spi_dma_transfer_complete(drv_data, true); 136 pxa2xx_spi_dma_transfer_complete(drv_data, true);
137 return IRQ_HANDLED; 137 return IRQ_HANDLED;
@@ -171,15 +171,15 @@ int pxa2xx_spi_dma_prepare(struct driver_data *drv_data,
171 return 0; 171 return 0;
172 172
173err_rx: 173err_rx:
174 dmaengine_terminate_async(drv_data->master->dma_tx); 174 dmaengine_terminate_async(drv_data->controller->dma_tx);
175err_tx: 175err_tx:
176 return err; 176 return err;
177} 177}
178 178
179void pxa2xx_spi_dma_start(struct driver_data *drv_data) 179void pxa2xx_spi_dma_start(struct driver_data *drv_data)
180{ 180{
181 dma_async_issue_pending(drv_data->master->dma_rx); 181 dma_async_issue_pending(drv_data->controller->dma_rx);
182 dma_async_issue_pending(drv_data->master->dma_tx); 182 dma_async_issue_pending(drv_data->controller->dma_tx);
183 183
184 atomic_set(&drv_data->dma_running, 1); 184 atomic_set(&drv_data->dma_running, 1);
185} 185}
@@ -187,30 +187,30 @@ void pxa2xx_spi_dma_start(struct driver_data *drv_data)
187void pxa2xx_spi_dma_stop(struct driver_data *drv_data) 187void pxa2xx_spi_dma_stop(struct driver_data *drv_data)
188{ 188{
189 atomic_set(&drv_data->dma_running, 0); 189 atomic_set(&drv_data->dma_running, 0);
190 dmaengine_terminate_sync(drv_data->master->dma_rx); 190 dmaengine_terminate_sync(drv_data->controller->dma_rx);
191 dmaengine_terminate_sync(drv_data->master->dma_tx); 191 dmaengine_terminate_sync(drv_data->controller->dma_tx);
192} 192}
193 193
194int pxa2xx_spi_dma_setup(struct driver_data *drv_data) 194int pxa2xx_spi_dma_setup(struct driver_data *drv_data)
195{ 195{
196 struct pxa2xx_spi_master *pdata = drv_data->master_info; 196 struct pxa2xx_spi_controller *pdata = drv_data->controller_info;
197 struct device *dev = &drv_data->pdev->dev; 197 struct device *dev = &drv_data->pdev->dev;
198 struct spi_controller *master = drv_data->master; 198 struct spi_controller *controller = drv_data->controller;
199 dma_cap_mask_t mask; 199 dma_cap_mask_t mask;
200 200
201 dma_cap_zero(mask); 201 dma_cap_zero(mask);
202 dma_cap_set(DMA_SLAVE, mask); 202 dma_cap_set(DMA_SLAVE, mask);
203 203
204 master->dma_tx = dma_request_slave_channel_compat(mask, 204 controller->dma_tx = dma_request_slave_channel_compat(mask,
205 pdata->dma_filter, pdata->tx_param, dev, "tx"); 205 pdata->dma_filter, pdata->tx_param, dev, "tx");
206 if (!master->dma_tx) 206 if (!controller->dma_tx)
207 return -ENODEV; 207 return -ENODEV;
208 208
209 master->dma_rx = dma_request_slave_channel_compat(mask, 209 controller->dma_rx = dma_request_slave_channel_compat(mask,
210 pdata->dma_filter, pdata->rx_param, dev, "rx"); 210 pdata->dma_filter, pdata->rx_param, dev, "rx");
211 if (!master->dma_rx) { 211 if (!controller->dma_rx) {
212 dma_release_channel(master->dma_tx); 212 dma_release_channel(controller->dma_tx);
213 master->dma_tx = NULL; 213 controller->dma_tx = NULL;
214 return -ENODEV; 214 return -ENODEV;
215 } 215 }
216 216
@@ -219,17 +219,17 @@ int pxa2xx_spi_dma_setup(struct driver_data *drv_data)
219 219
220void pxa2xx_spi_dma_release(struct driver_data *drv_data) 220void pxa2xx_spi_dma_release(struct driver_data *drv_data)
221{ 221{
222 struct spi_controller *master = drv_data->master; 222 struct spi_controller *controller = drv_data->controller;
223 223
224 if (master->dma_rx) { 224 if (controller->dma_rx) {
225 dmaengine_terminate_sync(master->dma_rx); 225 dmaengine_terminate_sync(controller->dma_rx);
226 dma_release_channel(master->dma_rx); 226 dma_release_channel(controller->dma_rx);
227 master->dma_rx = NULL; 227 controller->dma_rx = NULL;
228 } 228 }
229 if (master->dma_tx) { 229 if (controller->dma_tx) {
230 dmaengine_terminate_sync(master->dma_tx); 230 dmaengine_terminate_sync(controller->dma_tx);
231 dma_release_channel(master->dma_tx); 231 dma_release_channel(controller->dma_tx);
232 master->dma_tx = NULL; 232 controller->dma_tx = NULL;
233 } 233 }
234} 234}
235 235
diff --git a/drivers/spi/spi-pxa2xx-pci.c b/drivers/spi/spi-pxa2xx-pci.c
index 869f188b02eb..1727fdfbac28 100644
--- a/drivers/spi/spi-pxa2xx-pci.c
+++ b/drivers/spi/spi-pxa2xx-pci.c
@@ -197,7 +197,7 @@ static int pxa2xx_spi_pci_probe(struct pci_dev *dev,
197 struct platform_device_info pi; 197 struct platform_device_info pi;
198 int ret; 198 int ret;
199 struct platform_device *pdev; 199 struct platform_device *pdev;
200 struct pxa2xx_spi_master spi_pdata; 200 struct pxa2xx_spi_controller spi_pdata;
201 struct ssp_device *ssp; 201 struct ssp_device *ssp;
202 struct pxa_spi_info *c; 202 struct pxa_spi_info *c;
203 char buf[40]; 203 char buf[40];
@@ -265,7 +265,7 @@ static int pxa2xx_spi_pci_probe(struct pci_dev *dev,
265static void pxa2xx_spi_pci_remove(struct pci_dev *dev) 265static void pxa2xx_spi_pci_remove(struct pci_dev *dev)
266{ 266{
267 struct platform_device *pdev = pci_get_drvdata(dev); 267 struct platform_device *pdev = pci_get_drvdata(dev);
268 struct pxa2xx_spi_master *spi_pdata; 268 struct pxa2xx_spi_controller *spi_pdata;
269 269
270 spi_pdata = dev_get_platdata(&pdev->dev); 270 spi_pdata = dev_get_platdata(&pdev->dev);
271 271
diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
index d84b893a64d7..69e874a2ad1e 100644
--- a/drivers/spi/spi-pxa2xx.c
+++ b/drivers/spi/spi-pxa2xx.c
@@ -328,7 +328,7 @@ static void lpss_ssp_setup(struct driver_data *drv_data)
328 __lpss_ssp_write_priv(drv_data, config->reg_cs_ctrl, value); 328 __lpss_ssp_write_priv(drv_data, config->reg_cs_ctrl, value);
329 329
330 /* Enable multiblock DMA transfers */ 330 /* Enable multiblock DMA transfers */
331 if (drv_data->master_info->enable_dma) { 331 if (drv_data->controller_info->enable_dma) {
332 __lpss_ssp_write_priv(drv_data, config->reg_ssp, 1); 332 __lpss_ssp_write_priv(drv_data, config->reg_ssp, 1);
333 333
334 if (config->reg_general >= 0) { 334 if (config->reg_general >= 0) {
@@ -368,7 +368,7 @@ static void lpss_ssp_select_cs(struct spi_device *spi,
368 __lpss_ssp_write_priv(drv_data, 368 __lpss_ssp_write_priv(drv_data,
369 config->reg_cs_ctrl, value); 369 config->reg_cs_ctrl, value);
370 ndelay(1000000000 / 370 ndelay(1000000000 /
371 (drv_data->master->max_speed_hz / 2)); 371 (drv_data->controller->max_speed_hz / 2));
372 } 372 }
373} 373}
374 374
@@ -567,7 +567,7 @@ static int u32_reader(struct driver_data *drv_data)
567static void reset_sccr1(struct driver_data *drv_data) 567static void reset_sccr1(struct driver_data *drv_data)
568{ 568{
569 struct chip_data *chip = 569 struct chip_data *chip =
570 spi_get_ctldata(drv_data->master->cur_msg->spi); 570 spi_get_ctldata(drv_data->controller->cur_msg->spi);
571 u32 sccr1_reg; 571 u32 sccr1_reg;
572 572
573 sccr1_reg = pxa2xx_spi_read(drv_data, SSCR1) & ~drv_data->int_cr1; 573 sccr1_reg = pxa2xx_spi_read(drv_data, SSCR1) & ~drv_data->int_cr1;
@@ -599,8 +599,8 @@ static void int_error_stop(struct driver_data *drv_data, const char* msg)
599 599
600 dev_err(&drv_data->pdev->dev, "%s\n", msg); 600 dev_err(&drv_data->pdev->dev, "%s\n", msg);
601 601
602 drv_data->master->cur_msg->status = -EIO; 602 drv_data->controller->cur_msg->status = -EIO;
603 spi_finalize_current_transfer(drv_data->master); 603 spi_finalize_current_transfer(drv_data->controller);
604} 604}
605 605
606static void int_transfer_complete(struct driver_data *drv_data) 606static void int_transfer_complete(struct driver_data *drv_data)
@@ -611,7 +611,7 @@ static void int_transfer_complete(struct driver_data *drv_data)
611 if (!pxa25x_ssp_comp(drv_data)) 611 if (!pxa25x_ssp_comp(drv_data))
612 pxa2xx_spi_write(drv_data, SSTO, 0); 612 pxa2xx_spi_write(drv_data, SSTO, 0);
613 613
614 spi_finalize_current_transfer(drv_data->master); 614 spi_finalize_current_transfer(drv_data->controller);
615} 615}
616 616
617static irqreturn_t interrupt_transfer(struct driver_data *drv_data) 617static irqreturn_t interrupt_transfer(struct driver_data *drv_data)
@@ -747,7 +747,7 @@ static irqreturn_t ssp_int(int irq, void *dev_id)
747 pxa2xx_spi_write(drv_data, SSCR1, sccr1_reg & ~drv_data->int_cr1); 747 pxa2xx_spi_write(drv_data, SSCR1, sccr1_reg & ~drv_data->int_cr1);
748 pxa2xx_spi_write(drv_data, SSCR1, sccr1_reg); 748 pxa2xx_spi_write(drv_data, SSCR1, sccr1_reg);
749 749
750 if (!drv_data->master->cur_msg) { 750 if (!drv_data->controller->cur_msg) {
751 handle_bad_msg(drv_data); 751 handle_bad_msg(drv_data);
752 /* Never fail */ 752 /* Never fail */
753 return IRQ_HANDLED; 753 return IRQ_HANDLED;
@@ -879,7 +879,7 @@ static unsigned int quark_x1000_get_clk_div(int rate, u32 *dds)
879 879
880static unsigned int ssp_get_clk_div(struct driver_data *drv_data, int rate) 880static unsigned int ssp_get_clk_div(struct driver_data *drv_data, int rate)
881{ 881{
882 unsigned long ssp_clk = drv_data->master->max_speed_hz; 882 unsigned long ssp_clk = drv_data->controller->max_speed_hz;
883 const struct ssp_device *ssp = drv_data->ssp; 883 const struct ssp_device *ssp = drv_data->ssp;
884 884
885 rate = min_t(int, ssp_clk, rate); 885 rate = min_t(int, ssp_clk, rate);
@@ -894,7 +894,7 @@ static unsigned int pxa2xx_ssp_get_clk_div(struct driver_data *drv_data,
894 int rate) 894 int rate)
895{ 895{
896 struct chip_data *chip = 896 struct chip_data *chip =
897 spi_get_ctldata(drv_data->master->cur_msg->spi); 897 spi_get_ctldata(drv_data->controller->cur_msg->spi);
898 unsigned int clk_div; 898 unsigned int clk_div;
899 899
900 switch (drv_data->ssp_type) { 900 switch (drv_data->ssp_type) {
@@ -908,7 +908,7 @@ static unsigned int pxa2xx_ssp_get_clk_div(struct driver_data *drv_data,
908 return clk_div << 8; 908 return clk_div << 8;
909} 909}
910 910
911static bool pxa2xx_spi_can_dma(struct spi_controller *master, 911static bool pxa2xx_spi_can_dma(struct spi_controller *controller,
912 struct spi_device *spi, 912 struct spi_device *spi,
913 struct spi_transfer *xfer) 913 struct spi_transfer *xfer)
914{ 914{
@@ -919,12 +919,12 @@ static bool pxa2xx_spi_can_dma(struct spi_controller *master,
919 xfer->len >= chip->dma_burst_size; 919 xfer->len >= chip->dma_burst_size;
920} 920}
921 921
922static int pxa2xx_spi_transfer_one(struct spi_controller *master, 922static int pxa2xx_spi_transfer_one(struct spi_controller *controller,
923 struct spi_device *spi, 923 struct spi_device *spi,
924 struct spi_transfer *transfer) 924 struct spi_transfer *transfer)
925{ 925{
926 struct driver_data *drv_data = spi_controller_get_devdata(master); 926 struct driver_data *drv_data = spi_controller_get_devdata(controller);
927 struct spi_message *message = master->cur_msg; 927 struct spi_message *message = controller->cur_msg;
928 struct chip_data *chip = spi_get_ctldata(message->spi); 928 struct chip_data *chip = spi_get_ctldata(message->spi);
929 u32 dma_thresh = chip->dma_threshold; 929 u32 dma_thresh = chip->dma_threshold;
930 u32 dma_burst = chip->dma_burst_size; 930 u32 dma_burst = chip->dma_burst_size;
@@ -1006,9 +1006,9 @@ static int pxa2xx_spi_transfer_one(struct spi_controller *master,
1006 "DMA burst size reduced to match bits_per_word\n"); 1006 "DMA burst size reduced to match bits_per_word\n");
1007 } 1007 }
1008 1008
1009 dma_mapped = master->can_dma && 1009 dma_mapped = controller->can_dma &&
1010 master->can_dma(master, message->spi, transfer) && 1010 controller->can_dma(controller, message->spi, transfer) &&
1011 master->cur_msg_mapped; 1011 controller->cur_msg_mapped;
1012 if (dma_mapped) { 1012 if (dma_mapped) {
1013 1013
1014 /* Ensure we have the correct interrupt handler */ 1014 /* Ensure we have the correct interrupt handler */
@@ -1036,12 +1036,12 @@ static int pxa2xx_spi_transfer_one(struct spi_controller *master,
1036 cr0 = pxa2xx_configure_sscr0(drv_data, clk_div, bits); 1036 cr0 = pxa2xx_configure_sscr0(drv_data, clk_div, bits);
1037 if (!pxa25x_ssp_comp(drv_data)) 1037 if (!pxa25x_ssp_comp(drv_data))
1038 dev_dbg(&message->spi->dev, "%u Hz actual, %s\n", 1038 dev_dbg(&message->spi->dev, "%u Hz actual, %s\n",
1039 master->max_speed_hz 1039 controller->max_speed_hz
1040 / (1 + ((cr0 & SSCR0_SCR(0xfff)) >> 8)), 1040 / (1 + ((cr0 & SSCR0_SCR(0xfff)) >> 8)),
1041 dma_mapped ? "DMA" : "PIO"); 1041 dma_mapped ? "DMA" : "PIO");
1042 else 1042 else
1043 dev_dbg(&message->spi->dev, "%u Hz actual, %s\n", 1043 dev_dbg(&message->spi->dev, "%u Hz actual, %s\n",
1044 master->max_speed_hz / 2 1044 controller->max_speed_hz / 2
1045 / (1 + ((cr0 & SSCR0_SCR(0x0ff)) >> 8)), 1045 / (1 + ((cr0 & SSCR0_SCR(0x0ff)) >> 8)),
1046 dma_mapped ? "DMA" : "PIO"); 1046 dma_mapped ? "DMA" : "PIO");
1047 1047
@@ -1092,7 +1092,7 @@ static int pxa2xx_spi_transfer_one(struct spi_controller *master,
1092 } 1092 }
1093 } 1093 }
1094 1094
1095 if (spi_controller_is_slave(master)) { 1095 if (spi_controller_is_slave(controller)) {
1096 while (drv_data->write(drv_data)) 1096 while (drv_data->write(drv_data))
1097 ; 1097 ;
1098 if (drv_data->gpiod_ready) { 1098 if (drv_data->gpiod_ready) {
@@ -1111,9 +1111,9 @@ static int pxa2xx_spi_transfer_one(struct spi_controller *master,
1111 return 1; 1111 return 1;
1112} 1112}
1113 1113
1114static int pxa2xx_spi_slave_abort(struct spi_master *master) 1114static int pxa2xx_spi_slave_abort(struct spi_controller *controller)
1115{ 1115{
1116 struct driver_data *drv_data = spi_controller_get_devdata(master); 1116 struct driver_data *drv_data = spi_controller_get_devdata(controller);
1117 1117
1118 /* Stop and reset SSP */ 1118 /* Stop and reset SSP */
1119 write_SSSR_CS(drv_data, drv_data->clear_sr); 1119 write_SSSR_CS(drv_data, drv_data->clear_sr);
@@ -1126,16 +1126,16 @@ static int pxa2xx_spi_slave_abort(struct spi_master *master)
1126 1126
1127 dev_dbg(&drv_data->pdev->dev, "transfer aborted\n"); 1127 dev_dbg(&drv_data->pdev->dev, "transfer aborted\n");
1128 1128
1129 drv_data->master->cur_msg->status = -EINTR; 1129 drv_data->controller->cur_msg->status = -EINTR;
1130 spi_finalize_current_transfer(drv_data->master); 1130 spi_finalize_current_transfer(drv_data->controller);
1131 1131
1132 return 0; 1132 return 0;
1133} 1133}
1134 1134
1135static void pxa2xx_spi_handle_err(struct spi_controller *master, 1135static void pxa2xx_spi_handle_err(struct spi_controller *controller,
1136 struct spi_message *msg) 1136 struct spi_message *msg)
1137{ 1137{
1138 struct driver_data *drv_data = spi_controller_get_devdata(master); 1138 struct driver_data *drv_data = spi_controller_get_devdata(controller);
1139 1139
1140 /* Disable the SSP */ 1140 /* Disable the SSP */
1141 pxa2xx_spi_write(drv_data, SSCR0, 1141 pxa2xx_spi_write(drv_data, SSCR0,
@@ -1159,9 +1159,9 @@ static void pxa2xx_spi_handle_err(struct spi_controller *master,
1159 pxa2xx_spi_dma_stop(drv_data); 1159 pxa2xx_spi_dma_stop(drv_data);
1160} 1160}
1161 1161
1162static int pxa2xx_spi_unprepare_transfer(struct spi_controller *master) 1162static int pxa2xx_spi_unprepare_transfer(struct spi_controller *controller)
1163{ 1163{
1164 struct driver_data *drv_data = spi_controller_get_devdata(master); 1164 struct driver_data *drv_data = spi_controller_get_devdata(controller);
1165 1165
1166 /* Disable the SSP now */ 1166 /* Disable the SSP now */
1167 pxa2xx_spi_write(drv_data, SSCR0, 1167 pxa2xx_spi_write(drv_data, SSCR0,
@@ -1260,7 +1260,7 @@ static int setup(struct spi_device *spi)
1260 break; 1260 break;
1261 default: 1261 default:
1262 tx_hi_thres = 0; 1262 tx_hi_thres = 0;
1263 if (spi_controller_is_slave(drv_data->master)) { 1263 if (spi_controller_is_slave(drv_data->controller)) {
1264 tx_thres = 1; 1264 tx_thres = 1;
1265 rx_thres = 2; 1265 rx_thres = 2;
1266 } else { 1266 } else {
@@ -1287,7 +1287,7 @@ static int setup(struct spi_device *spi)
1287 1287
1288 chip->frm = spi->chip_select; 1288 chip->frm = spi->chip_select;
1289 } 1289 }
1290 chip->enable_dma = drv_data->master_info->enable_dma; 1290 chip->enable_dma = drv_data->controller_info->enable_dma;
1291 chip->timeout = TIMOUT_DFLT; 1291 chip->timeout = TIMOUT_DFLT;
1292 } 1292 }
1293 1293
@@ -1310,7 +1310,7 @@ static int setup(struct spi_device *spi)
1310 if (chip_info->enable_loopback) 1310 if (chip_info->enable_loopback)
1311 chip->cr1 = SSCR1_LBM; 1311 chip->cr1 = SSCR1_LBM;
1312 } 1312 }
1313 if (spi_controller_is_slave(drv_data->master)) { 1313 if (spi_controller_is_slave(drv_data->controller)) {
1314 chip->cr1 |= SSCR1_SCFR; 1314 chip->cr1 |= SSCR1_SCFR;
1315 chip->cr1 |= SSCR1_SCLKDIR; 1315 chip->cr1 |= SSCR1_SCLKDIR;
1316 chip->cr1 |= SSCR1_SFRMDIR; 1316 chip->cr1 |= SSCR1_SFRMDIR;
@@ -1497,10 +1497,10 @@ static bool pxa2xx_spi_idma_filter(struct dma_chan *chan, void *param)
1497 1497
1498#endif /* CONFIG_PCI */ 1498#endif /* CONFIG_PCI */
1499 1499
1500static struct pxa2xx_spi_master * 1500static struct pxa2xx_spi_controller *
1501pxa2xx_spi_init_pdata(struct platform_device *pdev) 1501pxa2xx_spi_init_pdata(struct platform_device *pdev)
1502{ 1502{
1503 struct pxa2xx_spi_master *pdata; 1503 struct pxa2xx_spi_controller *pdata;
1504 struct acpi_device *adev; 1504 struct acpi_device *adev;
1505 struct ssp_device *ssp; 1505 struct ssp_device *ssp;
1506 struct resource *res; 1506 struct resource *res;
@@ -1568,10 +1568,10 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev)
1568 return pdata; 1568 return pdata;
1569} 1569}
1570 1570
1571static int pxa2xx_spi_fw_translate_cs(struct spi_controller *master, 1571static int pxa2xx_spi_fw_translate_cs(struct spi_controller *controller,
1572 unsigned int cs) 1572 unsigned int cs)
1573{ 1573{
1574 struct driver_data *drv_data = spi_controller_get_devdata(master); 1574 struct driver_data *drv_data = spi_controller_get_devdata(controller);
1575 1575
1576 if (has_acpi_companion(&drv_data->pdev->dev)) { 1576 if (has_acpi_companion(&drv_data->pdev->dev)) {
1577 switch (drv_data->ssp_type) { 1577 switch (drv_data->ssp_type) {
@@ -1595,8 +1595,8 @@ static int pxa2xx_spi_fw_translate_cs(struct spi_controller *master,
1595static int pxa2xx_spi_probe(struct platform_device *pdev) 1595static int pxa2xx_spi_probe(struct platform_device *pdev)
1596{ 1596{
1597 struct device *dev = &pdev->dev; 1597 struct device *dev = &pdev->dev;
1598 struct pxa2xx_spi_master *platform_info; 1598 struct pxa2xx_spi_controller *platform_info;
1599 struct spi_controller *master; 1599 struct spi_controller *controller;
1600 struct driver_data *drv_data; 1600 struct driver_data *drv_data;
1601 struct ssp_device *ssp; 1601 struct ssp_device *ssp;
1602 const struct lpss_config *config; 1602 const struct lpss_config *config;
@@ -1622,37 +1622,37 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
1622 } 1622 }
1623 1623
1624 if (platform_info->is_slave) 1624 if (platform_info->is_slave)
1625 master = spi_alloc_slave(dev, sizeof(struct driver_data)); 1625 controller = spi_alloc_slave(dev, sizeof(struct driver_data));
1626 else 1626 else
1627 master = spi_alloc_master(dev, sizeof(struct driver_data)); 1627 controller = spi_alloc_master(dev, sizeof(struct driver_data));
1628 1628
1629 if (!master) { 1629 if (!controller) {
1630 dev_err(&pdev->dev, "cannot alloc spi_master\n"); 1630 dev_err(&pdev->dev, "cannot alloc spi_controller\n");
1631 pxa_ssp_free(ssp); 1631 pxa_ssp_free(ssp);
1632 return -ENOMEM; 1632 return -ENOMEM;
1633 } 1633 }
1634 drv_data = spi_controller_get_devdata(master); 1634 drv_data = spi_controller_get_devdata(controller);
1635 drv_data->master = master; 1635 drv_data->controller = controller;
1636 drv_data->master_info = platform_info; 1636 drv_data->controller_info = platform_info;
1637 drv_data->pdev = pdev; 1637 drv_data->pdev = pdev;
1638 drv_data->ssp = ssp; 1638 drv_data->ssp = ssp;
1639 1639
1640 master->dev.of_node = pdev->dev.of_node; 1640 controller->dev.of_node = pdev->dev.of_node;
1641 /* the spi->mode bits understood by this driver: */ 1641 /* the spi->mode bits understood by this driver: */
1642 master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LOOP; 1642 controller->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LOOP;
1643 1643
1644 master->bus_num = ssp->port_id; 1644 controller->bus_num = ssp->port_id;
1645 master->dma_alignment = DMA_ALIGNMENT; 1645 controller->dma_alignment = DMA_ALIGNMENT;
1646 master->cleanup = cleanup; 1646 controller->cleanup = cleanup;
1647 master->setup = setup; 1647 controller->setup = setup;
1648 master->set_cs = pxa2xx_spi_set_cs; 1648 controller->set_cs = pxa2xx_spi_set_cs;
1649 master->transfer_one = pxa2xx_spi_transfer_one; 1649 controller->transfer_one = pxa2xx_spi_transfer_one;
1650 master->slave_abort = pxa2xx_spi_slave_abort; 1650 controller->slave_abort = pxa2xx_spi_slave_abort;
1651 master->handle_err = pxa2xx_spi_handle_err; 1651 controller->handle_err = pxa2xx_spi_handle_err;
1652 master->unprepare_transfer_hardware = pxa2xx_spi_unprepare_transfer; 1652 controller->unprepare_transfer_hardware = pxa2xx_spi_unprepare_transfer;
1653 master->fw_translate_cs = pxa2xx_spi_fw_translate_cs; 1653 controller->fw_translate_cs = pxa2xx_spi_fw_translate_cs;
1654 master->auto_runtime_pm = true; 1654 controller->auto_runtime_pm = true;
1655 master->flags = SPI_CONTROLLER_MUST_RX | SPI_CONTROLLER_MUST_TX; 1655 controller->flags = SPI_CONTROLLER_MUST_RX | SPI_CONTROLLER_MUST_TX;
1656 1656
1657 drv_data->ssp_type = ssp->type; 1657 drv_data->ssp_type = ssp->type;
1658 1658
@@ -1661,10 +1661,10 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
1661 if (pxa25x_ssp_comp(drv_data)) { 1661 if (pxa25x_ssp_comp(drv_data)) {
1662 switch (drv_data->ssp_type) { 1662 switch (drv_data->ssp_type) {
1663 case QUARK_X1000_SSP: 1663 case QUARK_X1000_SSP:
1664 master->bits_per_word_mask = SPI_BPW_RANGE_MASK(4, 32); 1664 controller->bits_per_word_mask = SPI_BPW_RANGE_MASK(4, 32);
1665 break; 1665 break;
1666 default: 1666 default:
1667 master->bits_per_word_mask = SPI_BPW_RANGE_MASK(4, 16); 1667 controller->bits_per_word_mask = SPI_BPW_RANGE_MASK(4, 16);
1668 break; 1668 break;
1669 } 1669 }
1670 1670
@@ -1673,7 +1673,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
1673 drv_data->clear_sr = SSSR_ROR; 1673 drv_data->clear_sr = SSSR_ROR;
1674 drv_data->mask_sr = SSSR_RFS | SSSR_TFS | SSSR_ROR; 1674 drv_data->mask_sr = SSSR_RFS | SSSR_TFS | SSSR_ROR;
1675 } else { 1675 } else {
1676 master->bits_per_word_mask = SPI_BPW_RANGE_MASK(4, 32); 1676 controller->bits_per_word_mask = SPI_BPW_RANGE_MASK(4, 32);
1677 drv_data->int_cr1 = SSCR1_TIE | SSCR1_RIE | SSCR1_TINTE; 1677 drv_data->int_cr1 = SSCR1_TIE | SSCR1_RIE | SSCR1_TINTE;
1678 drv_data->dma_cr1 = DEFAULT_DMA_CR1; 1678 drv_data->dma_cr1 = DEFAULT_DMA_CR1;
1679 drv_data->clear_sr = SSSR_ROR | SSSR_TINT; 1679 drv_data->clear_sr = SSSR_ROR | SSSR_TINT;
@@ -1685,7 +1685,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
1685 drv_data); 1685 drv_data);
1686 if (status < 0) { 1686 if (status < 0) {
1687 dev_err(&pdev->dev, "cannot get IRQ %d\n", ssp->irq); 1687 dev_err(&pdev->dev, "cannot get IRQ %d\n", ssp->irq);
1688 goto out_error_master_alloc; 1688 goto out_error_controller_alloc;
1689 } 1689 }
1690 1690
1691 /* Setup DMA if requested */ 1691 /* Setup DMA if requested */
@@ -1695,7 +1695,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
1695 dev_dbg(dev, "no DMA channels available, using PIO\n"); 1695 dev_dbg(dev, "no DMA channels available, using PIO\n");
1696 platform_info->enable_dma = false; 1696 platform_info->enable_dma = false;
1697 } else { 1697 } else {
1698 master->can_dma = pxa2xx_spi_can_dma; 1698 controller->can_dma = pxa2xx_spi_can_dma;
1699 } 1699 }
1700 } 1700 }
1701 1701
@@ -1704,7 +1704,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
1704 if (status) 1704 if (status)
1705 goto out_error_dma_irq_alloc; 1705 goto out_error_dma_irq_alloc;
1706 1706
1707 master->max_speed_hz = clk_get_rate(ssp->clk); 1707 controller->max_speed_hz = clk_get_rate(ssp->clk);
1708 1708
1709 /* Load default SSP configuration */ 1709 /* Load default SSP configuration */
1710 pxa2xx_spi_write(drv_data, SSCR0, 0); 1710 pxa2xx_spi_write(drv_data, SSCR0, 0);
@@ -1727,7 +1727,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
1727 break; 1727 break;
1728 default: 1728 default:
1729 1729
1730 if (spi_controller_is_slave(master)) { 1730 if (spi_controller_is_slave(controller)) {
1731 tmp = SSCR1_SCFR | 1731 tmp = SSCR1_SCFR |
1732 SSCR1_SCLKDIR | 1732 SSCR1_SCLKDIR |
1733 SSCR1_SFRMDIR | 1733 SSCR1_SFRMDIR |
@@ -1740,7 +1740,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
1740 } 1740 }
1741 pxa2xx_spi_write(drv_data, SSCR1, tmp); 1741 pxa2xx_spi_write(drv_data, SSCR1, tmp);
1742 tmp = SSCR0_Motorola | SSCR0_DataSize(8); 1742 tmp = SSCR0_Motorola | SSCR0_DataSize(8);
1743 if (!spi_controller_is_slave(master)) 1743 if (!spi_controller_is_slave(controller))
1744 tmp |= SSCR0_SCR(2); 1744 tmp |= SSCR0_SCR(2);
1745 pxa2xx_spi_write(drv_data, SSCR0, tmp); 1745 pxa2xx_spi_write(drv_data, SSCR0, tmp);
1746 break; 1746 break;
@@ -1765,24 +1765,24 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
1765 platform_info->num_chipselect = config->cs_num; 1765 platform_info->num_chipselect = config->cs_num;
1766 } 1766 }
1767 } 1767 }
1768 master->num_chipselect = platform_info->num_chipselect; 1768 controller->num_chipselect = platform_info->num_chipselect;
1769 1769
1770 count = gpiod_count(&pdev->dev, "cs"); 1770 count = gpiod_count(&pdev->dev, "cs");
1771 if (count > 0) { 1771 if (count > 0) {
1772 int i; 1772 int i;
1773 1773
1774 master->num_chipselect = max_t(int, count, 1774 controller->num_chipselect = max_t(int, count,
1775 master->num_chipselect); 1775 controller->num_chipselect);
1776 1776
1777 drv_data->cs_gpiods = devm_kcalloc(&pdev->dev, 1777 drv_data->cs_gpiods = devm_kcalloc(&pdev->dev,
1778 master->num_chipselect, sizeof(struct gpio_desc *), 1778 controller->num_chipselect, sizeof(struct gpio_desc *),
1779 GFP_KERNEL); 1779 GFP_KERNEL);
1780 if (!drv_data->cs_gpiods) { 1780 if (!drv_data->cs_gpiods) {
1781 status = -ENOMEM; 1781 status = -ENOMEM;
1782 goto out_error_clock_enabled; 1782 goto out_error_clock_enabled;
1783 } 1783 }
1784 1784
1785 for (i = 0; i < master->num_chipselect; i++) { 1785 for (i = 0; i < controller->num_chipselect; i++) {
1786 struct gpio_desc *gpiod; 1786 struct gpio_desc *gpiod;
1787 1787
1788 gpiod = devm_gpiod_get_index(dev, "cs", i, GPIOD_ASIS); 1788 gpiod = devm_gpiod_get_index(dev, "cs", i, GPIOD_ASIS);
@@ -1815,9 +1815,9 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
1815 1815
1816 /* Register with the SPI framework */ 1816 /* Register with the SPI framework */
1817 platform_set_drvdata(pdev, drv_data); 1817 platform_set_drvdata(pdev, drv_data);
1818 status = devm_spi_register_controller(&pdev->dev, master); 1818 status = devm_spi_register_controller(&pdev->dev, controller);
1819 if (status != 0) { 1819 if (status != 0) {
1820 dev_err(&pdev->dev, "problem registering spi master\n"); 1820 dev_err(&pdev->dev, "problem registering spi controller\n");
1821 goto out_error_clock_enabled; 1821 goto out_error_clock_enabled;
1822 } 1822 }
1823 1823
@@ -1832,8 +1832,8 @@ out_error_dma_irq_alloc:
1832 pxa2xx_spi_dma_release(drv_data); 1832 pxa2xx_spi_dma_release(drv_data);
1833 free_irq(ssp->irq, drv_data); 1833 free_irq(ssp->irq, drv_data);
1834 1834
1835out_error_master_alloc: 1835out_error_controller_alloc:
1836 spi_controller_put(master); 1836 spi_controller_put(controller);
1837 pxa_ssp_free(ssp); 1837 pxa_ssp_free(ssp);
1838 return status; 1838 return status;
1839} 1839}
@@ -1854,7 +1854,7 @@ static int pxa2xx_spi_remove(struct platform_device *pdev)
1854 clk_disable_unprepare(ssp->clk); 1854 clk_disable_unprepare(ssp->clk);
1855 1855
1856 /* Release DMA */ 1856 /* Release DMA */
1857 if (drv_data->master_info->enable_dma) 1857 if (drv_data->controller_info->enable_dma)
1858 pxa2xx_spi_dma_release(drv_data); 1858 pxa2xx_spi_dma_release(drv_data);
1859 1859
1860 pm_runtime_put_noidle(&pdev->dev); 1860 pm_runtime_put_noidle(&pdev->dev);
@@ -1876,7 +1876,7 @@ static int pxa2xx_spi_suspend(struct device *dev)
1876 struct ssp_device *ssp = drv_data->ssp; 1876 struct ssp_device *ssp = drv_data->ssp;
1877 int status; 1877 int status;
1878 1878
1879 status = spi_controller_suspend(drv_data->master); 1879 status = spi_controller_suspend(drv_data->controller);
1880 if (status != 0) 1880 if (status != 0)
1881 return status; 1881 return status;
1882 pxa2xx_spi_write(drv_data, SSCR0, 0); 1882 pxa2xx_spi_write(drv_data, SSCR0, 0);
@@ -1901,7 +1901,7 @@ static int pxa2xx_spi_resume(struct device *dev)
1901 } 1901 }
1902 1902
1903 /* Start the queue running */ 1903 /* Start the queue running */
1904 return spi_controller_resume(drv_data->master); 1904 return spi_controller_resume(drv_data->controller);
1905} 1905}
1906#endif 1906#endif
1907 1907
diff --git a/drivers/spi/spi-pxa2xx.h b/drivers/spi/spi-pxa2xx.h
index 4e324da66ef7..aba777b4502d 100644
--- a/drivers/spi/spi-pxa2xx.h
+++ b/drivers/spi/spi-pxa2xx.h
@@ -31,10 +31,10 @@ struct driver_data {
31 31
32 /* SPI framework hookup */ 32 /* SPI framework hookup */
33 enum pxa_ssp_type ssp_type; 33 enum pxa_ssp_type ssp_type;
34 struct spi_controller *master; 34 struct spi_controller *controller;
35 35
36 /* PXA hookup */ 36 /* PXA hookup */
37 struct pxa2xx_spi_master *master_info; 37 struct pxa2xx_spi_controller *controller_info;
38 38
39 /* SSP register addresses */ 39 /* SSP register addresses */
40 void __iomem *ioaddr; 40 void __iomem *ioaddr;
diff --git a/include/linux/spi/pxa2xx_spi.h b/include/linux/spi/pxa2xx_spi.h
index b0674e330ef6..c1c59473cef9 100644
--- a/include/linux/spi/pxa2xx_spi.h
+++ b/include/linux/spi/pxa2xx_spi.h
@@ -22,7 +22,7 @@
22struct dma_chan; 22struct dma_chan;
23 23
24/* device.platform_data for SSP controller devices */ 24/* device.platform_data for SSP controller devices */
25struct pxa2xx_spi_master { 25struct pxa2xx_spi_controller {
26 u16 num_chipselect; 26 u16 num_chipselect;
27 u8 enable_dma; 27 u8 enable_dma;
28 bool is_slave; 28 bool is_slave;
@@ -54,7 +54,7 @@ struct pxa2xx_spi_chip {
54 54
55#include <linux/clk.h> 55#include <linux/clk.h>
56 56
57extern void pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_master *info); 57extern void pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_controller *info);
58 58
59#endif 59#endif
60#endif 60#endif