]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/spi/omap2_mcspi.c
spi: omap2_mcspi handles omap3 too
[linux-2.6-omap-h63xx.git] / drivers / spi / omap2_mcspi.c
index ea61724ae2256fe33035f77e29cce9a0a67eb48a..a6ba11afb03f798bb7f8520c352b419ff6bb119d 100644 (file)
@@ -915,6 +915,28 @@ static u8 __initdata spi2_txdma_id[] = {
        OMAP24XX_DMA_SPI2_TX1,
 };
 
+#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP34XX)
+static u8 __initdata spi3_rxdma_id[] = {
+       OMAP24XX_DMA_SPI3_RX0,
+       OMAP24XX_DMA_SPI3_RX1,
+};
+
+static u8 __initdata spi3_txdma_id[] = {
+       OMAP24XX_DMA_SPI3_TX0,
+       OMAP24XX_DMA_SPI3_TX1,
+};
+#endif
+
+#ifdef CONFIG_ARCH_OMAP3
+static u8 __initdata spi4_rxdma_id[] = {
+       OMAP34XX_DMA_SPI4_RX0,
+};
+
+static u8 __initdata spi4_txdma_id[] = {
+       OMAP34XX_DMA_SPI4_TX0,
+};
+#endif
+
 static int __init omap2_mcspi_probe(struct platform_device *pdev)
 {
        struct spi_master       *master;
@@ -935,7 +957,20 @@ static int __init omap2_mcspi_probe(struct platform_device *pdev)
                txdma_id = spi2_txdma_id;
                num_chipselect = 2;
                break;
-       /* REVISIT omap2430 has a third McSPI ... */
+#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3)
+       case 3:
+               rxdma_id = spi3_rxdma_id;
+               txdma_id = spi3_txdma_id;
+               num_chipselect = 2;
+               break;
+#endif
+#ifdef CONFIG_ARCH_OMAP3
+       case 4:
+               rxdma_id = spi4_rxdma_id;
+               txdma_id = spi4_txdma_id;
+               num_chipselect = 1;
+               break;
+#endif
        default:
                return -EINVAL;
        }