aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx/files/arch/mips/ath79/mach-rb750.c
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2012-03-19 15:56:59 +0000
committerGabor Juhos <juhosg@openwrt.org>2012-03-19 15:56:59 +0000
commitc0a33c12b0805710338626e59f129afceee7996e (patch)
tree73e73c314d68ff0e92bcc9e9db9b54f9ed4d0166 /target/linux/ar71xx/files/arch/mips/ath79/mach-rb750.c
parent17f9a8bedf6ba3749512f9727e4cf5e30d434a91 (diff)
downloadmaster-187ad058-c0a33c12b0805710338626e59f129afceee7996e.tar.gz
master-187ad058-c0a33c12b0805710338626e59f129afceee7996e.tar.bz2
master-187ad058-c0a33c12b0805710338626e59f129afceee7996e.zip
ar71xx: add platform data for the RB750 NAND driver
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31022 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar71xx/files/arch/mips/ath79/mach-rb750.c')
-rw-r--r--target/linux/ar71xx/files/arch/mips/ath79/mach-rb750.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb750.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb750.c
index 976617bb36..bcd961e1bd 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb750.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb750.c
@@ -1,5 +1,5 @@
/*
- * MikroTik RouterBOARD 750 support
+ * MikroTik RouterBOARD 750/750GL support
*
* Copyright (C) 2010-2012 Gabor Juhos <juhosg@openwrt.org>
*
@@ -59,9 +59,13 @@ static struct platform_device rb750_leds_device = {
}
};
+static struct rb7xx_nand_platform_data rb750_nand_data;
static struct platform_device rb750_nand_device = {
.name = "rb750-nand",
.id = -1,
+ .dev = {
+ .platform_data = &rb750_nand_data,
+ }
};
int rb750_latch_change(u32 mask_clr, u32 mask_set)
@@ -113,19 +117,24 @@ unlock:
}
EXPORT_SYMBOL_GPL(rb750_latch_change);
-void rb750_nand_pins_enable(void)
+static void rb750_nand_enable_pins(void)
{
+ rb750_latch_change(RB750_LVC573_LE, 0);
ath79_gpio_function_setup(AR724X_GPIO_FUNC_JTAG_DISABLE,
AR724X_GPIO_FUNC_SPI_EN);
}
-EXPORT_SYMBOL_GPL(rb750_nand_pins_enable);
-void rb750_nand_pins_disable(void)
+static void rb750_nand_disable_pins(void)
{
ath79_gpio_function_setup(AR724X_GPIO_FUNC_SPI_EN,
AR724X_GPIO_FUNC_JTAG_DISABLE);
+ rb750_latch_change(0, RB750_LVC573_LE);
+}
+
+static void rb750_nand_latch_change(u32 clear, u32 set)
+{
+ rb750_latch_change(clear, set);
}
-EXPORT_SYMBOL_GPL(rb750_nand_pins_disable);
static void __init rb750_setup(void)
{
@@ -147,6 +156,11 @@ static void __init rb750_setup(void)
ath79_register_eth(0);
platform_device_register(&rb750_leds_device);
+
+ rb750_nand_data.nce_line = RB750_NAND_NCE;
+ rb750_nand_data.enable_pins = rb750_nand_enable_pins;
+ rb750_nand_data.disable_pins = rb750_nand_disable_pins;
+ rb750_nand_data.latch_change = rb750_nand_latch_change;
platform_device_register(&rb750_nand_device);
}