aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2008-12-20 08:28:39 +0000
committerGabor Juhos <juhosg@openwrt.org>2008-12-20 08:28:39 +0000
commit2a33d0dd821b1a4b2444da6c4cebee3c99216a2d (patch)
tree79dd08210f0b42d797ab6d574cafdb190931f790
parent581a7a36a9d3f570d5294fabf54a33d8519a511b (diff)
downloadupstream-2a33d0dd821b1a4b2444da6c4cebee3c99216a2d.tar.gz
upstream-2a33d0dd821b1a4b2444da6c4cebee3c99216a2d.tar.bz2
upstream-2a33d0dd821b1a4b2444da6c4cebee3c99216a2d.zip
fix GPIO function select bit definitions (based on a patch by Jonas <jmajau at ubnt.com>)
SVN-Revision: 13699
-rw-r--r--target/linux/ar71xx/files-2.6.28/arch/mips/include/asm/mach-ar71xx/ar71xx.h5
-rw-r--r--target/linux/ar71xx/files/arch/mips/ar71xx/mach-rb-4xx.c3
-rw-r--r--target/linux/ar71xx/files/arch/mips/ar71xx/platform.c2
-rw-r--r--target/linux/ar71xx/files/include/asm-mips/mach-ar71xx/ar71xx.h5
4 files changed, 7 insertions, 8 deletions
diff --git a/target/linux/ar71xx/files-2.6.28/arch/mips/include/asm/mach-ar71xx/ar71xx.h b/target/linux/ar71xx/files-2.6.28/arch/mips/include/asm/mach-ar71xx/ar71xx.h
index 8379aedab1..f5de7c0330 100644
--- a/target/linux/ar71xx/files-2.6.28/arch/mips/include/asm/mach-ar71xx/ar71xx.h
+++ b/target/linux/ar71xx/files-2.6.28/arch/mips/include/asm/mach-ar71xx/ar71xx.h
@@ -201,9 +201,8 @@ extern void ar71xx_add_device_usb(void) __init;
#define GPIO_FUNC_STEREO_EN BIT(17)
#define GPIO_FUNC_SLIC_EN BIT(16)
-#define GPIO_FUNC_SPI_CS1_EN BIT(15)
-#define GPIO_FUNC_SPI_CS0_EN BIT(14)
-#define GPIO_FUNC_SPI_EN BIT(13)
+#define GPIO_FUNC_SPI_CS2_EN BIT(13)
+#define GPIO_FUNC_SPI_CS1_EN BIT(12)
#define GPIO_FUNC_UART_EN BIT(8)
#define GPIO_FUNC_USB_OC_EN BIT(4)
#define GPIO_FUNC_USB_CLK_EN BIT(0)
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-rb-4xx.c b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-rb-4xx.c
index f8e76c40c6..ec3ac0497d 100644
--- a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-rb-4xx.c
+++ b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-rb-4xx.c
@@ -152,6 +152,9 @@ static inline void rb433_add_device_spi(void) {}
static void __init rb4xx_generic_setup(void)
{
+ ar71xx_gpio_function_enable(GPIO_FUNC_SPI_CS1_EN |
+ GPIO_FUNC_SPI_CS2_EN);
+
ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(rb4xx_leds_gpio),
rb4xx_leds_gpio);
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/platform.c b/target/linux/ar71xx/files/arch/mips/ar71xx/platform.c
index ab9cabb1b7..705f24315a 100644
--- a/target/linux/ar71xx/files/arch/mips/ar71xx/platform.c
+++ b/target/linux/ar71xx/files/arch/mips/ar71xx/platform.c
@@ -481,8 +481,6 @@ void __init ar71xx_add_device_spi(struct ar71xx_spi_platform_data *pdata,
struct spi_board_info const *info,
unsigned n)
{
- ar71xx_gpio_function_enable(GPIO_FUNC_SPI_EN);
-
spi_register_board_info(info, n);
ar71xx_spi_device.dev.platform_data = pdata;
platform_device_register(&ar71xx_spi_device);
diff --git a/target/linux/ar71xx/files/include/asm-mips/mach-ar71xx/ar71xx.h b/target/linux/ar71xx/files/include/asm-mips/mach-ar71xx/ar71xx.h
index 8379aedab1..f5de7c0330 100644
--- a/target/linux/ar71xx/files/include/asm-mips/mach-ar71xx/ar71xx.h
+++ b/target/linux/ar71xx/files/include/asm-mips/mach-ar71xx/ar71xx.h
@@ -201,9 +201,8 @@ extern void ar71xx_add_device_usb(void) __init;
#define GPIO_FUNC_STEREO_EN BIT(17)
#define GPIO_FUNC_SLIC_EN BIT(16)
-#define GPIO_FUNC_SPI_CS1_EN BIT(15)
-#define GPIO_FUNC_SPI_CS0_EN BIT(14)
-#define GPIO_FUNC_SPI_EN BIT(13)
+#define GPIO_FUNC_SPI_CS2_EN BIT(13)
+#define GPIO_FUNC_SPI_CS1_EN BIT(12)
#define GPIO_FUNC_UART_EN BIT(8)
#define GPIO_FUNC_USB_OC_EN BIT(4)
#define GPIO_FUNC_USB_CLK_EN BIT(0)