diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-24 21:00:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-24 21:00:17 -0400 |
commit | 4864ccbb5a6f99e4c44dc816304007547a268b9f (patch) | |
tree | d6cbb0ea8671dffcaab98b17fbf9a72e16245ad0 /drivers/spi | |
parent | 735f0a985ac414b6e5f09cf6199b6fd5e118ff62 (diff) | |
parent | 213d27a42ce1646989966011d2af8563feac5635 (diff) |
Merge tag 'spi-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc
Pull spi fixes from Mark Brown:
"A bunch of fixes here, mostly minor except for the pl022 which has
just been a bit of a shambles all round, the recent runtime PM changes
have as far as I can tell never worked so they're just getting thrown
out."
* tag 'spi-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc:
spi/pl022: Revert recent runtime PM changes
spi: tsc2005: delete soon-obsolete e-mail address
spi: spi-rspi: fix build error for the latest shdma driver
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi-pl022.c | 3 | ||||
-rw-r--r-- | drivers/spi/spi-rspi.c | 56 |
2 files changed, 34 insertions, 25 deletions
diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c index 919464102d33..a1db91a99b89 100644 --- a/drivers/spi/spi-pl022.c +++ b/drivers/spi/spi-pl022.c | |||
@@ -2186,8 +2186,6 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id) | |||
2186 | printk(KERN_INFO "pl022: mapped registers from 0x%08x to %p\n", | 2186 | printk(KERN_INFO "pl022: mapped registers from 0x%08x to %p\n", |
2187 | adev->res.start, pl022->virtbase); | 2187 | adev->res.start, pl022->virtbase); |
2188 | 2188 | ||
2189 | pm_runtime_resume(dev); | ||
2190 | |||
2191 | pl022->clk = devm_clk_get(&adev->dev, NULL); | 2189 | pl022->clk = devm_clk_get(&adev->dev, NULL); |
2192 | if (IS_ERR(pl022->clk)) { | 2190 | if (IS_ERR(pl022->clk)) { |
2193 | status = PTR_ERR(pl022->clk); | 2191 | status = PTR_ERR(pl022->clk); |
@@ -2292,7 +2290,6 @@ pl022_remove(struct amba_device *adev) | |||
2292 | 2290 | ||
2293 | clk_disable(pl022->clk); | 2291 | clk_disable(pl022->clk); |
2294 | clk_unprepare(pl022->clk); | 2292 | clk_unprepare(pl022->clk); |
2295 | pm_runtime_disable(&adev->dev); | ||
2296 | amba_release_regions(adev); | 2293 | amba_release_regions(adev); |
2297 | tasklet_disable(&pl022->pump_transfers); | 2294 | tasklet_disable(&pl022->pump_transfers); |
2298 | spi_unregister_master(pl022->master); | 2295 | spi_unregister_master(pl022->master); |
diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c index 4894bde4bbff..30faf6d4ab91 100644 --- a/drivers/spi/spi-rspi.c +++ b/drivers/spi/spi-rspi.c | |||
@@ -147,8 +147,6 @@ struct rspi_data { | |||
147 | unsigned char spsr; | 147 | unsigned char spsr; |
148 | 148 | ||
149 | /* for dmaengine */ | 149 | /* for dmaengine */ |
150 | struct sh_dmae_slave dma_tx; | ||
151 | struct sh_dmae_slave dma_rx; | ||
152 | struct dma_chan *chan_tx; | 150 | struct dma_chan *chan_tx; |
153 | struct dma_chan *chan_rx; | 151 | struct dma_chan *chan_rx; |
154 | int irq; | 152 | int irq; |
@@ -663,20 +661,16 @@ static irqreturn_t rspi_irq(int irq, void *_sr) | |||
663 | return ret; | 661 | return ret; |
664 | } | 662 | } |
665 | 663 | ||
666 | static bool rspi_filter(struct dma_chan *chan, void *filter_param) | 664 | static int __devinit rspi_request_dma(struct rspi_data *rspi, |
667 | { | 665 | struct platform_device *pdev) |
668 | chan->private = filter_param; | ||
669 | return true; | ||
670 | } | ||
671 | |||
672 | static void __devinit rspi_request_dma(struct rspi_data *rspi, | ||
673 | struct platform_device *pdev) | ||
674 | { | 666 | { |
675 | struct rspi_plat_data *rspi_pd = pdev->dev.platform_data; | 667 | struct rspi_plat_data *rspi_pd = pdev->dev.platform_data; |
676 | dma_cap_mask_t mask; | 668 | dma_cap_mask_t mask; |
669 | struct dma_slave_config cfg; | ||
670 | int ret; | ||
677 | 671 | ||
678 | if (!rspi_pd) | 672 | if (!rspi_pd) |
679 | return; | 673 | return 0; /* The driver assumes no error. */ |
680 | 674 | ||
681 | rspi->dma_width_16bit = rspi_pd->dma_width_16bit; | 675 | rspi->dma_width_16bit = rspi_pd->dma_width_16bit; |
682 | 676 | ||
@@ -684,21 +678,35 @@ static void __devinit rspi_request_dma(struct rspi_data *rspi, | |||
684 | if (rspi_pd->dma_rx_id && rspi_pd->dma_tx_id) { | 678 | if (rspi_pd->dma_rx_id && rspi_pd->dma_tx_id) { |
685 | dma_cap_zero(mask); | 679 | dma_cap_zero(mask); |
686 | dma_cap_set(DMA_SLAVE, mask); | 680 | dma_cap_set(DMA_SLAVE, mask); |
687 | rspi->dma_rx.slave_id = rspi_pd->dma_rx_id; | 681 | rspi->chan_rx = dma_request_channel(mask, shdma_chan_filter, |
688 | rspi->chan_rx = dma_request_channel(mask, rspi_filter, | 682 | (void *)rspi_pd->dma_rx_id); |
689 | &rspi->dma_rx); | 683 | if (rspi->chan_rx) { |
690 | if (rspi->chan_rx) | 684 | cfg.slave_id = rspi_pd->dma_rx_id; |
691 | dev_info(&pdev->dev, "Use DMA when rx.\n"); | 685 | cfg.direction = DMA_DEV_TO_MEM; |
686 | ret = dmaengine_slave_config(rspi->chan_rx, &cfg); | ||
687 | if (!ret) | ||
688 | dev_info(&pdev->dev, "Use DMA when rx.\n"); | ||
689 | else | ||
690 | return ret; | ||
691 | } | ||
692 | } | 692 | } |
693 | if (rspi_pd->dma_tx_id) { | 693 | if (rspi_pd->dma_tx_id) { |
694 | dma_cap_zero(mask); | 694 | dma_cap_zero(mask); |
695 | dma_cap_set(DMA_SLAVE, mask); | 695 | dma_cap_set(DMA_SLAVE, mask); |
696 | rspi->dma_tx.slave_id = rspi_pd->dma_tx_id; | 696 | rspi->chan_tx = dma_request_channel(mask, shdma_chan_filter, |
697 | rspi->chan_tx = dma_request_channel(mask, rspi_filter, | 697 | (void *)rspi_pd->dma_tx_id); |
698 | &rspi->dma_tx); | 698 | if (rspi->chan_tx) { |
699 | if (rspi->chan_tx) | 699 | cfg.slave_id = rspi_pd->dma_tx_id; |
700 | dev_info(&pdev->dev, "Use DMA when tx\n"); | 700 | cfg.direction = DMA_MEM_TO_DEV; |
701 | ret = dmaengine_slave_config(rspi->chan_tx, &cfg); | ||
702 | if (!ret) | ||
703 | dev_info(&pdev->dev, "Use DMA when tx\n"); | ||
704 | else | ||
705 | return ret; | ||
706 | } | ||
701 | } | 707 | } |
708 | |||
709 | return 0; | ||
702 | } | 710 | } |
703 | 711 | ||
704 | static void __devexit rspi_release_dma(struct rspi_data *rspi) | 712 | static void __devexit rspi_release_dma(struct rspi_data *rspi) |
@@ -788,7 +796,11 @@ static int __devinit rspi_probe(struct platform_device *pdev) | |||
788 | } | 796 | } |
789 | 797 | ||
790 | rspi->irq = irq; | 798 | rspi->irq = irq; |
791 | rspi_request_dma(rspi, pdev); | 799 | ret = rspi_request_dma(rspi, pdev); |
800 | if (ret < 0) { | ||
801 | dev_err(&pdev->dev, "rspi_request_dma failed.\n"); | ||
802 | goto error4; | ||
803 | } | ||
792 | 804 | ||
793 | ret = spi_register_master(master); | 805 | ret = spi_register_master(master); |
794 | if (ret < 0) { | 806 | if (ret < 0) { |