Merge tag 'spi-v3.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi fixes from Mark Brown:
"A few driver specific fixes here:

- SH HSPI was dealing with its clocks incorrectly which meant it
didn't work on some SoCs, fixing this also requires a small fix to
one of the SoC clock trees to avoid breaking existing users.
- The SiRF driver appears to have had several quality problems, it's
fairly new and not widely used so this isn't too worrying.
- A brute force fix for excessive locking in the Atmel driver, it
needs further investigation but this deals with the immediate
issue.
- A build fix for the Blackfin driver"

* tag 'spi-v3.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
spi: atmel: Fix scheduling while atomic bug
spi: sh-hspi: Do not specifically request shyway_clk clock
ARM: shmobile: r8a7778: Use clks as MSTP007 parent
spi: sirf: make GPIO chipselect function work well
spi: sirf: set SPI controller in RISC IO chipselect mode
spi: sirf: correct TXFIFO empty interrupt status bit
spi: bfin5xx: fix build error

+24 -6
+1 -1
arch/arm/mach-shmobile/clock-r8a7778.c
··· 170 [MSTP010] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 10, 0), /* SSI2 */ 171 [MSTP009] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 9, 0), /* SSI3 */ 172 [MSTP008] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 8, 0), /* SRU */ 173 - [MSTP007] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 7, 0), /* HSPI */ 174 }; 175 176 static struct clk_lookup lookups[] = {
··· 170 [MSTP010] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 10, 0), /* SSI2 */ 171 [MSTP009] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 9, 0), /* SSI3 */ 172 [MSTP008] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 8, 0), /* SRU */ 173 + [MSTP007] = SH_CLK_MSTP32(&s_clk, MSTPCR0, 7, 0), /* HSPI */ 174 }; 175 176 static struct clk_lookup lookups[] = {
+3
drivers/spi/spi-atmel.c
··· 1115 atmel_spi_next_xfer_pio(master, xfer); 1116 } 1117 1118 ret = wait_for_completion_timeout(&as->xfer_completion, 1119 SPI_DMA_TIMEOUT); 1120 if (WARN_ON(ret == 0)) { 1121 dev_err(&spi->dev, 1122 "spi trasfer timeout, err %d\n", ret);
··· 1115 atmel_spi_next_xfer_pio(master, xfer); 1116 } 1117 1118 + /* interrupts are disabled, so free the lock for schedule */ 1119 + atmel_spi_unlock(as); 1120 ret = wait_for_completion_timeout(&as->xfer_completion, 1121 SPI_DMA_TIMEOUT); 1122 + atmel_spi_lock(as); 1123 if (WARN_ON(ret == 0)) { 1124 dev_err(&spi->dev, 1125 "spi trasfer timeout, err %d\n", ret);
+1
drivers/spi/spi-bfin5xx.c
··· 12 #include <linux/module.h> 13 #include <linux/delay.h> 14 #include <linux/device.h> 15 #include <linux/slab.h> 16 #include <linux/io.h> 17 #include <linux/ioport.h>
··· 12 #include <linux/module.h> 13 #include <linux/delay.h> 14 #include <linux/device.h> 15 + #include <linux/gpio.h> 16 #include <linux/slab.h> 17 #include <linux/io.h> 18 #include <linux/ioport.h>
+2 -2
drivers/spi/spi-sh-hspi.c
··· 244 return -ENOMEM; 245 } 246 247 - clk = clk_get(NULL, "shyway_clk"); 248 if (IS_ERR(clk)) { 249 - dev_err(&pdev->dev, "shyway_clk is required\n"); 250 ret = -EINVAL; 251 goto error0; 252 }
··· 244 return -ENOMEM; 245 } 246 247 + clk = clk_get(&pdev->dev, NULL); 248 if (IS_ERR(clk)) { 249 + dev_err(&pdev->dev, "couldn't get clock\n"); 250 ret = -EINVAL; 251 goto error0; 252 }
+17 -3
drivers/spi/spi-sirf.c
··· 287 sspi->left_rx_word) 288 sspi->rx_word(sspi); 289 290 - if (spi_stat & (SIRFSOC_SPI_FIFO_EMPTY 291 - | SIRFSOC_SPI_TXFIFO_THD_REACH)) 292 while (!((readl(sspi->base + SIRFSOC_SPI_TXFIFO_STATUS) 293 & SIRFSOC_SPI_FIFO_FULL)) && 294 sspi->left_tx_word) ··· 470 writel(regval, sspi->base + SIRFSOC_SPI_CTRL); 471 } else { 472 int gpio = sspi->chipselect[spi->chip_select]; 473 - gpio_direction_output(gpio, spi->mode & SPI_CS_HIGH ? 0 : 1); 474 } 475 } 476 ··· 568 regval &= ~SIRFSOC_SPI_CMD_MODE; 569 sspi->tx_by_cmd = false; 570 } 571 writel(regval, sspi->base + SIRFSOC_SPI_CTRL); 572 573 if (IS_DMA_VALID(t)) {
··· 287 sspi->left_rx_word) 288 sspi->rx_word(sspi); 289 290 + if (spi_stat & (SIRFSOC_SPI_TXFIFO_EMPTY | 291 + SIRFSOC_SPI_TXFIFO_THD_REACH)) 292 while (!((readl(sspi->base + SIRFSOC_SPI_TXFIFO_STATUS) 293 & SIRFSOC_SPI_FIFO_FULL)) && 294 sspi->left_tx_word) ··· 470 writel(regval, sspi->base + SIRFSOC_SPI_CTRL); 471 } else { 472 int gpio = sspi->chipselect[spi->chip_select]; 473 + switch (value) { 474 + case BITBANG_CS_ACTIVE: 475 + gpio_direction_output(gpio, 476 + spi->mode & SPI_CS_HIGH ? 1 : 0); 477 + break; 478 + case BITBANG_CS_INACTIVE: 479 + gpio_direction_output(gpio, 480 + spi->mode & SPI_CS_HIGH ? 0 : 1); 481 + break; 482 + } 483 } 484 } 485 ··· 559 regval &= ~SIRFSOC_SPI_CMD_MODE; 560 sspi->tx_by_cmd = false; 561 } 562 + /* 563 + * set spi controller in RISC chipselect mode, we are controlling CS by 564 + * software BITBANG_CS_ACTIVE and BITBANG_CS_INACTIVE. 565 + */ 566 + regval |= SIRFSOC_SPI_CS_IO_MODE; 567 writel(regval, sspi->base + SIRFSOC_SPI_CTRL); 568 569 if (IS_DMA_VALID(t)) {