aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-05-07 14:22:14 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-07 14:22:14 -0400
commit1bf25e78af317e6d5d9b5594dfeb0036e0d589d6 (patch)
tree49dbd2d7bd6856b8ae1864c2dd0c0eb5e36d5398 /drivers/ata
parent38f56f33ca381751f9b8910f67e7a805ec0b68cb (diff)
parent0592c2189ece16f3e0c5a56245634aba93d0c9dd (diff)
Merge tag 'cleanup-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC late cleanups from Arnd Bergmann: "These are cleanups and smaller changes that either depend on earlier feature branches or came in late during the development cycle. We normally try to get all cleanups early, so these are the exceptions: - A follow-up on the clocksource reworks, hopefully the last time we need to merge clocksource subsystem changes through arm-soc. A first set of patches was part of the original 3.10 arm-soc cleanup series because of interdependencies with timer drivers now moved out of arch/arm. - Migrating the SPEAr13xx platform away from using auxdata for DMA channel descriptions towards using information in device tree, based on the earlier SPEAr multiplatform series - A few follow-ups on the Atmel SAMA5 support and other changes for Atmel at91 based on the larger at91 reworks. - Moving the armada irqchip implementation to drivers/irqchip - Several OMAP cleanups following up on the larger series already merged in 3.10." * tag 'cleanup-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (50 commits) ARM: OMAP4: change the device names in usb_bind_phy ARM: OMAP2+: Fix mismerge for timer.c between ff931c82 and da4a686a ARM: SPEAr: conditionalize SMP code ARM: arch_timer: Silence debug preempt warnings ARM: OMAP: remove unused variable serial: amba-pl011: fix !CONFIG_DMA_ENGINE case ata: arasan: remove the need for platform_data ARM: at91/sama5d34ek.dts: remove not needed compatibility string ARM: at91: dts: add MCI DMA support ARM: at91: dts: add i2c dma support ARM: at91: dts: set #dma-cells to the correct value ARM: at91: suspend both memory controllers on at91sam9263 irqchip: armada-370-xp: slightly cleanup irq controller driver irqchip: armada-370-xp: move IRQ handler to avoid forward declaration irqchip: move IRQ driver for Armada 370/XP ARM: mvebu: move L2 cache initialization in init_early() devtree: add binding documentation for sp804 ARM: integrator-cp: convert use CLKSRC_OF for timer init ARM: versatile: use OF init for sp804 timer ARM: versatile: add versatile dtbs to dtbs target ...
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/pata_arasan_cf.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c
index 405022d302c3..7638121cb5d1 100644
--- a/drivers/ata/pata_arasan_cf.c
+++ b/drivers/ata/pata_arasan_cf.c
@@ -209,8 +209,6 @@ struct arasan_cf_dev {
209 struct dma_chan *dma_chan; 209 struct dma_chan *dma_chan;
210 /* Mask for DMA transfers */ 210 /* Mask for DMA transfers */
211 dma_cap_mask_t mask; 211 dma_cap_mask_t mask;
212 /* dma channel private data */
213 void *dma_priv;
214 /* DMA transfer work */ 212 /* DMA transfer work */
215 struct work_struct work; 213 struct work_struct work;
216 /* DMA delayed finish work */ 214 /* DMA delayed finish work */
@@ -308,6 +306,7 @@ static void cf_card_detect(struct arasan_cf_dev *acdev, bool hotplugged)
308static int cf_init(struct arasan_cf_dev *acdev) 306static int cf_init(struct arasan_cf_dev *acdev)
309{ 307{
310 struct arasan_cf_pdata *pdata = dev_get_platdata(acdev->host->dev); 308 struct arasan_cf_pdata *pdata = dev_get_platdata(acdev->host->dev);
309 unsigned int if_clk;
311 unsigned long flags; 310 unsigned long flags;
312 int ret = 0; 311 int ret = 0;
313 312
@@ -325,8 +324,12 @@ static int cf_init(struct arasan_cf_dev *acdev)
325 324
326 spin_lock_irqsave(&acdev->host->lock, flags); 325 spin_lock_irqsave(&acdev->host->lock, flags);
327 /* configure CF interface clock */ 326 /* configure CF interface clock */
328 writel((pdata->cf_if_clk <= CF_IF_CLK_200M) ? pdata->cf_if_clk : 327 /* TODO: read from device tree */
329 CF_IF_CLK_166M, acdev->vbase + CLK_CFG); 328 if_clk = CF_IF_CLK_166M;
329 if (pdata && pdata->cf_if_clk <= CF_IF_CLK_200M)
330 if_clk = pdata->cf_if_clk;
331
332 writel(if_clk, acdev->vbase + CLK_CFG);
330 333
331 writel(TRUE_IDE_MODE | CFHOST_ENB, acdev->vbase + OP_MODE); 334 writel(TRUE_IDE_MODE | CFHOST_ENB, acdev->vbase + OP_MODE);
332 cf_interrupt_enable(acdev, CARD_DETECT_IRQ, 1); 335 cf_interrupt_enable(acdev, CARD_DETECT_IRQ, 1);
@@ -357,12 +360,6 @@ static void dma_callback(void *dev)
357 complete(&acdev->dma_completion); 360 complete(&acdev->dma_completion);
358} 361}
359 362
360static bool filter(struct dma_chan *chan, void *slave)
361{
362 chan->private = slave;
363 return true;
364}
365
366static inline void dma_complete(struct arasan_cf_dev *acdev) 363static inline void dma_complete(struct arasan_cf_dev *acdev)
367{ 364{
368 struct ata_queued_cmd *qc = acdev->qc; 365 struct ata_queued_cmd *qc = acdev->qc;
@@ -530,8 +527,7 @@ static void data_xfer(struct work_struct *work)
530 527
531 /* request dma channels */ 528 /* request dma channels */
532 /* dma_request_channel may sleep, so calling from process context */ 529 /* dma_request_channel may sleep, so calling from process context */
533 acdev->dma_chan = dma_request_channel(acdev->mask, filter, 530 acdev->dma_chan = dma_request_slave_channel(acdev->host->dev, "data");
534 acdev->dma_priv);
535 if (!acdev->dma_chan) { 531 if (!acdev->dma_chan) {
536 dev_err(acdev->host->dev, "Unable to get dma_chan\n"); 532 dev_err(acdev->host->dev, "Unable to get dma_chan\n");
537 goto chan_request_fail; 533 goto chan_request_fail;
@@ -798,6 +794,7 @@ static int arasan_cf_probe(struct platform_device *pdev)
798 struct ata_host *host; 794 struct ata_host *host;
799 struct ata_port *ap; 795 struct ata_port *ap;
800 struct resource *res; 796 struct resource *res;
797 u32 quirk;
801 irq_handler_t irq_handler = NULL; 798 irq_handler_t irq_handler = NULL;
802 int ret = 0; 799 int ret = 0;
803 800
@@ -817,12 +814,17 @@ static int arasan_cf_probe(struct platform_device *pdev)
817 return -ENOMEM; 814 return -ENOMEM;
818 } 815 }
819 816
817 if (pdata)
818 quirk = pdata->quirk;
819 else
820 quirk = CF_BROKEN_UDMA; /* as it is on spear1340 */
821
820 /* if irq is 0, support only PIO */ 822 /* if irq is 0, support only PIO */
821 acdev->irq = platform_get_irq(pdev, 0); 823 acdev->irq = platform_get_irq(pdev, 0);
822 if (acdev->irq) 824 if (acdev->irq)
823 irq_handler = arasan_cf_interrupt; 825 irq_handler = arasan_cf_interrupt;
824 else 826 else
825 pdata->quirk |= CF_BROKEN_MWDMA | CF_BROKEN_UDMA; 827 quirk |= CF_BROKEN_MWDMA | CF_BROKEN_UDMA;
826 828
827 acdev->pbase = res->start; 829 acdev->pbase = res->start;
828 acdev->vbase = devm_ioremap_nocache(&pdev->dev, res->start, 830 acdev->vbase = devm_ioremap_nocache(&pdev->dev, res->start,
@@ -859,17 +861,16 @@ static int arasan_cf_probe(struct platform_device *pdev)
859 INIT_WORK(&acdev->work, data_xfer); 861 INIT_WORK(&acdev->work, data_xfer);
860 INIT_DELAYED_WORK(&acdev->dwork, delayed_finish); 862 INIT_DELAYED_WORK(&acdev->dwork, delayed_finish);
861 dma_cap_set(DMA_MEMCPY, acdev->mask); 863 dma_cap_set(DMA_MEMCPY, acdev->mask);
862 acdev->dma_priv = pdata->dma_priv;
863 864
864 /* Handle platform specific quirks */ 865 /* Handle platform specific quirks */
865 if (pdata->quirk) { 866 if (quirk) {
866 if (pdata->quirk & CF_BROKEN_PIO) { 867 if (quirk & CF_BROKEN_PIO) {
867 ap->ops->set_piomode = NULL; 868 ap->ops->set_piomode = NULL;
868 ap->pio_mask = 0; 869 ap->pio_mask = 0;
869 } 870 }
870 if (pdata->quirk & CF_BROKEN_MWDMA) 871 if (quirk & CF_BROKEN_MWDMA)
871 ap->mwdma_mask = 0; 872 ap->mwdma_mask = 0;
872 if (pdata->quirk & CF_BROKEN_UDMA) 873 if (quirk & CF_BROKEN_UDMA)
873 ap->udma_mask = 0; 874 ap->udma_mask = 0;
874 } 875 }
875 ap->flags |= ATA_FLAG_PIO_POLLING | ATA_FLAG_NO_ATAPI; 876 ap->flags |= ATA_FLAG_PIO_POLLING | ATA_FLAG_NO_ATAPI;