summaryrefslogtreecommitdiff
path: root/drivers/spi
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2014-10-22 21:56:04 +0200
committerJagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>2014-10-27 22:37:03 +0530
commitcdcdad851f7abc4e3328bae3f675349f3f5cda4a (patch)
tree7f2dfb6199fabb4d7d34257d92f27b1a78a52ce2 /drivers/spi
parentdf155672ff262dd779ef12c04d9fc1911b778990 (diff)
spi: altera: Move the config options to the top
Just move the configuration options scattered all over the driver to the top of the source file. No functional change. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Chin Liang See <clsee@altera.com> Cc: Dinh Nguyen <dinguyen@altera.com> Cc: Albert Aribaud <albert.u.boot@aribaud.net> Cc: Pavel Machek <pavel@denx.de> Acked-by: Pavel Machek <pavel@denx.de> Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/altera_spi.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/spi/altera_spi.c b/drivers/spi/altera_spi.c
index c08969d8c9..a4d03d97cf 100644
--- a/drivers/spi/altera_spi.c
+++ b/drivers/spi/altera_spi.c
@@ -12,6 +12,14 @@
#include <malloc.h>
#include <spi.h>
+#ifndef CONFIG_ALTERA_SPI_IDLE_VAL
+#define CONFIG_ALTERA_SPI_IDLE_VAL 0xff
+#endif
+
+#ifndef CONFIG_SYS_ALTERA_SPI_LIST
+#define CONFIG_SYS_ALTERA_SPI_LIST { CONFIG_SYS_SPI_BASE }
+#endif
+
struct altera_spi_regs {
u32 rxdata;
u32 txdata;
@@ -35,10 +43,6 @@ struct altera_spi_regs {
#define ALTERA_SPI_CONTROL_IE_MSK (1 << 8)
#define ALTERA_SPI_CONTROL_SSO_MSK (1 << 10)
-#ifndef CONFIG_SYS_ALTERA_SPI_LIST
-#define CONFIG_SYS_ALTERA_SPI_LIST { CONFIG_SYS_SPI_BASE }
-#endif
-
static ulong altera_spi_base_list[] = CONFIG_SYS_ALTERA_SPI_LIST;
struct altera_spi_slave {
@@ -117,10 +121,6 @@ void spi_release_bus(struct spi_slave *slave)
writel(0, &altspi->regs->slave_sel);
}
-#ifndef CONFIG_ALTERA_SPI_IDLE_VAL
-# define CONFIG_ALTERA_SPI_IDLE_VAL 0xff
-#endif
-
int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout,
void *din, unsigned long flags)
{