spi: Fixes for v3.14

A scattering of driver specific fixes here.  The fixes from Axel cover
 bitrot in apparently unmaintained drivers, the at79 bug is fixing a
 glitch on /CS during initialisation of some devices which could break
 some slaves and the remainder are fixes for recently introduced bugs
 from the past release cycle or so.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIbBAABAgAGBQJTGVKmAAoJELSic+t+oim9us4P9RSbIcwJWobTy2Px/7yPH2e9
 mAjlTVnBQ2EqwPAI+iro1xQfTeeyn3fAkdINrkWe6xGkbXH4n4OezWZzdH0VbPFV
 buUPc9EYt8FysG/Xne3nyW3cCDzv0+CzvD5CY/83SDa2YMd+2134dxb/8UOpLE+Q
 ptde7EsR11z2XF9PLdm4Wc7ouGEczm3zfbgy1v1uO0UZqeFe8sbzroYLdTZnRYZ5
 s9BD3hUgcB9+cV/v4gv988hYhofmvmsYluBmo8Q7OVgMJ90ne281P8X9CqxEEn1w
 vsebrQ3xFIybDk1GGp79IMTyNooX48+2eTalsJa4+eWsGYpZjMW7wHx+pYX5pqnI
 hxrKU4yXQ8Sa7CMwfGcLgzJpa7DPbTKJZrw7X1x71+Pu8HcBHEKO1xKJ9YNY98Kd
 B0zvdPaYmEFX5e4T7Tv2opk3TVYZtrlNmu16DxgktzYEUdArkDZAV0SVHMtGzpGn
 /AMtvm5LIH58smyhdsocQtdddjE2oELVuLqtfIZgq8KuARmFYVzDro/q9BXcJMWK
 0LJCscr4bxljFEm+NDhPTwtQ1TX3Ahl+sTDkyx1sYjfQXEUsJyP0YesLqbyIP1xY
 gzAURogPooS7Gz4ggkyZv0cvcsKcziXvf4MYpIKT58HjfVgGk5Kk7LU6E2eUJMXU
 AzmQoeKfWrIUzKYOk8w=
 =2e3U
 -----END PGP SIGNATURE-----

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

Pull spi fixes from Mark Brown:
 "A scattering of driver specific fixes here.

  The fixes from Axel cover bitrot in apparently unmaintained drivers,
  the at79 bug is fixing a glitch on /CS during initialisation of some
  devices which could break some slaves and the remainder are fixes for
  recently introduced bugs from the past release cycle or so"

* tag 'spi-v3.14-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
  spi: atmel: add missing spi_master_{resume,suspend} calls to PM callbacks
  spi: coldfire-qspi: Fix getting correct address for *mcfqspi
  spi: fsl-dspi: Fix getting correct address for master
  spi: spi-ath79: fix initial GPIO CS line setup
  spi: spi-imx: spi_imx_remove: do not disable disabled clocks
  spi-topcliff-pch: Fix probing when DMA mode is used
  spi/topcliff-pch: Fix DMA channel
This commit is contained in:
Linus Torvalds 2014-03-09 13:51:47 -07:00
commit 4aa41ba7f7
6 changed files with 35 additions and 17 deletions

View File

@ -132,9 +132,9 @@ static int ath79_spi_setup_cs(struct spi_device *spi)
flags = GPIOF_DIR_OUT; flags = GPIOF_DIR_OUT;
if (spi->mode & SPI_CS_HIGH) if (spi->mode & SPI_CS_HIGH)
flags |= GPIOF_INIT_HIGH;
else
flags |= GPIOF_INIT_LOW; flags |= GPIOF_INIT_LOW;
else
flags |= GPIOF_INIT_HIGH;
status = gpio_request_one(cdata->gpio, flags, status = gpio_request_one(cdata->gpio, flags,
dev_name(&spi->dev)); dev_name(&spi->dev));

View File

@ -1455,6 +1455,14 @@ static int atmel_spi_suspend(struct device *dev)
{ {
struct spi_master *master = dev_get_drvdata(dev); struct spi_master *master = dev_get_drvdata(dev);
struct atmel_spi *as = spi_master_get_devdata(master); struct atmel_spi *as = spi_master_get_devdata(master);
int ret;
/* Stop the queue running */
ret = spi_master_suspend(master);
if (ret) {
dev_warn(dev, "cannot suspend master\n");
return ret;
}
clk_disable_unprepare(as->clk); clk_disable_unprepare(as->clk);
return 0; return 0;
@ -1464,9 +1472,16 @@ static int atmel_spi_resume(struct device *dev)
{ {
struct spi_master *master = dev_get_drvdata(dev); struct spi_master *master = dev_get_drvdata(dev);
struct atmel_spi *as = spi_master_get_devdata(master); struct atmel_spi *as = spi_master_get_devdata(master);
int ret;
clk_prepare_enable(as->clk); clk_prepare_enable(as->clk);
return 0;
/* Start the queue running */
ret = spi_master_resume(master);
if (ret)
dev_err(dev, "problem starting queue (%d)\n", ret);
return ret;
} }
static SIMPLE_DEV_PM_OPS(atmel_spi_pm_ops, atmel_spi_suspend, atmel_spi_resume); static SIMPLE_DEV_PM_OPS(atmel_spi_pm_ops, atmel_spi_suspend, atmel_spi_resume);

View File

@ -514,7 +514,8 @@ static int mcfqspi_resume(struct device *dev)
#ifdef CONFIG_PM_RUNTIME #ifdef CONFIG_PM_RUNTIME
static int mcfqspi_runtime_suspend(struct device *dev) static int mcfqspi_runtime_suspend(struct device *dev)
{ {
struct mcfqspi *mcfqspi = dev_get_drvdata(dev); struct spi_master *master = dev_get_drvdata(dev);
struct mcfqspi *mcfqspi = spi_master_get_devdata(master);
clk_disable(mcfqspi->clk); clk_disable(mcfqspi->clk);
@ -523,7 +524,8 @@ static int mcfqspi_runtime_suspend(struct device *dev)
static int mcfqspi_runtime_resume(struct device *dev) static int mcfqspi_runtime_resume(struct device *dev)
{ {
struct mcfqspi *mcfqspi = dev_get_drvdata(dev); struct spi_master *master = dev_get_drvdata(dev);
struct mcfqspi *mcfqspi = spi_master_get_devdata(master);
clk_enable(mcfqspi->clk); clk_enable(mcfqspi->clk);

View File

@ -420,7 +420,6 @@ static int dspi_suspend(struct device *dev)
static int dspi_resume(struct device *dev) static int dspi_resume(struct device *dev)
{ {
struct spi_master *master = dev_get_drvdata(dev); struct spi_master *master = dev_get_drvdata(dev);
struct fsl_dspi *dspi = spi_master_get_devdata(master); struct fsl_dspi *dspi = spi_master_get_devdata(master);
@ -504,7 +503,7 @@ static int dspi_probe(struct platform_device *pdev)
clk_prepare_enable(dspi->clk); clk_prepare_enable(dspi->clk);
init_waitqueue_head(&dspi->waitq); init_waitqueue_head(&dspi->waitq);
platform_set_drvdata(pdev, dspi); platform_set_drvdata(pdev, master);
ret = spi_bitbang_start(&dspi->bitbang); ret = spi_bitbang_start(&dspi->bitbang);
if (ret != 0) { if (ret != 0) {
@ -525,7 +524,8 @@ out_master_put:
static int dspi_remove(struct platform_device *pdev) static int dspi_remove(struct platform_device *pdev)
{ {
struct fsl_dspi *dspi = platform_get_drvdata(pdev); struct spi_master *master = platform_get_drvdata(pdev);
struct fsl_dspi *dspi = spi_master_get_devdata(master);
/* Disconnect from the SPI framework */ /* Disconnect from the SPI framework */
spi_bitbang_stop(&dspi->bitbang); spi_bitbang_stop(&dspi->bitbang);

View File

@ -948,8 +948,8 @@ static int spi_imx_remove(struct platform_device *pdev)
spi_bitbang_stop(&spi_imx->bitbang); spi_bitbang_stop(&spi_imx->bitbang);
writel(0, spi_imx->base + MXC_CSPICTRL); writel(0, spi_imx->base + MXC_CSPICTRL);
clk_disable_unprepare(spi_imx->clk_ipg); clk_unprepare(spi_imx->clk_ipg);
clk_disable_unprepare(spi_imx->clk_per); clk_unprepare(spi_imx->clk_per);
spi_master_put(master); spi_master_put(master);
return 0; return 0;

View File

@ -915,7 +915,7 @@ static void pch_spi_request_dma(struct pch_spi_data *data, int bpw)
/* Set Tx DMA */ /* Set Tx DMA */
param = &dma->param_tx; param = &dma->param_tx;
param->dma_dev = &dma_dev->dev; param->dma_dev = &dma_dev->dev;
param->chan_id = data->master->bus_num * 2; /* Tx = 0, 2 */ param->chan_id = data->ch * 2; /* Tx = 0, 2 */;
param->tx_reg = data->io_base_addr + PCH_SPDWR; param->tx_reg = data->io_base_addr + PCH_SPDWR;
param->width = width; param->width = width;
chan = dma_request_channel(mask, pch_spi_filter, param); chan = dma_request_channel(mask, pch_spi_filter, param);
@ -930,7 +930,7 @@ static void pch_spi_request_dma(struct pch_spi_data *data, int bpw)
/* Set Rx DMA */ /* Set Rx DMA */
param = &dma->param_rx; param = &dma->param_rx;
param->dma_dev = &dma_dev->dev; param->dma_dev = &dma_dev->dev;
param->chan_id = data->master->bus_num * 2 + 1; /* Rx = Tx + 1 */ param->chan_id = data->ch * 2 + 1; /* Rx = Tx + 1 */;
param->rx_reg = data->io_base_addr + PCH_SPDRR; param->rx_reg = data->io_base_addr + PCH_SPDRR;
param->width = width; param->width = width;
chan = dma_request_channel(mask, pch_spi_filter, param); chan = dma_request_channel(mask, pch_spi_filter, param);
@ -1452,6 +1452,11 @@ static int pch_spi_pd_probe(struct platform_device *plat_dev)
pch_spi_set_master_mode(master); pch_spi_set_master_mode(master);
if (use_dma) {
dev_info(&plat_dev->dev, "Use DMA for data transfers\n");
pch_alloc_dma_buf(board_dat, data);
}
ret = spi_register_master(master); ret = spi_register_master(master);
if (ret != 0) { if (ret != 0) {
dev_err(&plat_dev->dev, dev_err(&plat_dev->dev,
@ -1459,14 +1464,10 @@ static int pch_spi_pd_probe(struct platform_device *plat_dev)
goto err_spi_register_master; goto err_spi_register_master;
} }
if (use_dma) {
dev_info(&plat_dev->dev, "Use DMA for data transfers\n");
pch_alloc_dma_buf(board_dat, data);
}
return 0; return 0;
err_spi_register_master: err_spi_register_master:
pch_free_dma_buf(board_dat, data);
free_irq(board_dat->pdev->irq, data); free_irq(board_dat->pdev->irq, data);
err_request_irq: err_request_irq:
pch_spi_free_resources(board_dat, data); pch_spi_free_resources(board_dat, data);