summaryrefslogtreecommitdiffstats
path: root/drivers/spi/atmel_spi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/spi/atmel_spi.c')
-rw-r--r--drivers/spi/atmel_spi.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c
index c2a9fef58ed..66e7bc98579 100644
--- a/drivers/spi/atmel_spi.c
+++ b/drivers/spi/atmel_spi.c
@@ -23,6 +23,10 @@
#include <asm/arch/board.h>
#include <asm/arch/gpio.h>
+#ifdef CONFIG_ARCH_AT91
+#include <asm/arch/cpu.h>
+#endif
+
#include "atmel_spi.h"
/*
@@ -421,7 +425,7 @@ static int atmel_spi_setup(struct spi_device *spi)
if (ret)
return ret;
spi->controller_state = (void *)npcs_pin;
- gpio_direction_output(npcs_pin);
+ gpio_direction_output(npcs_pin, !(spi->mode & SPI_CS_HIGH));
}
dev_dbg(&spi->dev,
@@ -491,7 +495,7 @@ static int atmel_spi_transfer(struct spi_device *spi, struct spi_message *msg)
return 0;
}
-static void atmel_spi_cleanup(const struct spi_device *spi)
+static void atmel_spi_cleanup(struct spi_device *spi)
{
if (spi->controller_state)
gpio_free((unsigned int)spi->controller_data);