]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/spi/spi_s3c24xx.c
[POWERPC] spufs: spu_find_victim may choose wrong victim
[linux-2.6-omap-h63xx.git] / drivers / spi / spi_s3c24xx.c
index d5a710f6e445cf3aa0bf64e1fb1c6f5f827f50eb..89d6685a5ca4860594773a346e37dbad40021762 100644 (file)
@@ -28,7 +28,7 @@
 #include <asm/hardware.h>
 
 #include <asm/arch/regs-gpio.h>
-#include <asm/arch/regs-spi.h>
+#include <asm/plat-s3c24xx/regs-spi.h>
 #include <asm/arch/spi.h>
 
 struct s3c24xx_spi {
@@ -146,6 +146,9 @@ static int s3c24xx_spi_setupxfer(struct spi_device *spi,
        return 0;
 }
 
+/* the spi->mode bits understood by this driver: */
+#define MODEBITS (SPI_CPOL | SPI_CPHA | SPI_CS_HIGH)
+
 static int s3c24xx_spi_setup(struct spi_device *spi)
 {
        int ret;
@@ -153,8 +156,11 @@ static int s3c24xx_spi_setup(struct spi_device *spi)
        if (!spi->bits_per_word)
                spi->bits_per_word = 8;
 
-       if ((spi->mode & SPI_LSB_FIRST) != 0)
+       if (spi->mode & ~MODEBITS) {
+               dev_dbg(&spi->dev, "setup: unsupported mode bits %x\n",
+                       spi->mode & ~MODEBITS);
                return -EINVAL;
+       }
 
        ret = s3c24xx_spi_setupxfer(spi, NULL);
        if (ret < 0) {
@@ -227,7 +233,7 @@ static irqreturn_t s3c24xx_spi_irq(int irq, void *dev)
        return IRQ_HANDLED;
 }
 
-static int s3c24xx_spi_probe(struct platform_device *pdev)
+static int __init s3c24xx_spi_probe(struct platform_device *pdev)
 {
        struct s3c24xx_spi *hw;
        struct spi_master *master;
@@ -376,7 +382,7 @@ static int s3c24xx_spi_probe(struct platform_device *pdev)
        return err;
 }
 
-static int s3c24xx_spi_remove(struct platform_device *dev)
+static int __exit s3c24xx_spi_remove(struct platform_device *dev)
 {
        struct s3c24xx_spi *hw = platform_get_drvdata(dev);
 
@@ -421,9 +427,9 @@ static int s3c24xx_spi_resume(struct platform_device *pdev)
 #define s3c24xx_spi_resume  NULL
 #endif
 
+MODULE_ALIAS("s3c2410_spi");                   /* for platform bus hotplug */
 static struct platform_driver s3c24xx_spidrv = {
-       .probe          = s3c24xx_spi_probe,
-       .remove         = s3c24xx_spi_remove,
+       .remove         = __exit_p(s3c24xx_spi_remove),
        .suspend        = s3c24xx_spi_suspend,
        .resume         = s3c24xx_spi_resume,
        .driver         = {
@@ -434,7 +440,7 @@ static struct platform_driver s3c24xx_spidrv = {
 
 static int __init s3c24xx_spi_init(void)
 {
-        return platform_driver_register(&s3c24xx_spidrv);
+        return platform_driver_probe(&s3c24xx_spidrv, s3c24xx_spi_probe);
 }
 
 static void __exit s3c24xx_spi_exit(void)