diff options
author | Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 2011-05-29 09:49:22 -0400 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@intel.com> | 2011-09-11 08:01:57 -0400 |
commit | 1754aab9bb869c173aa03b57587256827250e488 (patch) | |
tree | fafa68ef3f589204534a5fb89d45dfa19addadfd /arch/avr32 | |
parent | 9eeff8243677b8bbfc17e8e606e965bb591a759d (diff) |
mtd: ATMEL, AVR32: inline nand partition table access
Currently atmel_nand driver used by AT91 and AVR32 calls a special callback
which return nand partition table and number of partitions. However in all
boards this callback returns just static data. So drop this callback and
make atmel_nand use partition table provided statically via platform_data.
Nicolas Ferre: I am in favor for a mainline inclusion through linux-mtd tree.
Hans-Christian Egtvedt: I'm fine by sending the changes for AVR32 through linux-mtd
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Acked-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'arch/avr32')
-rw-r--r-- | arch/avr32/boards/atngw100/setup.c | 8 | ||||
-rw-r--r-- | arch/avr32/boards/atstk1000/atstk1002.c | 9 | ||||
-rw-r--r-- | arch/avr32/mach-at32ap/include/mach/board.h | 3 |
3 files changed, 6 insertions, 14 deletions
diff --git a/arch/avr32/boards/atngw100/setup.c b/arch/avr32/boards/atngw100/setup.c index fafed4c38fd2..1f17bde52cd4 100644 --- a/arch/avr32/boards/atngw100/setup.c +++ b/arch/avr32/boards/atngw100/setup.c | |||
@@ -90,11 +90,6 @@ static struct mtd_partition nand_partitions[] = { | |||
90 | }, | 90 | }, |
91 | }; | 91 | }; |
92 | 92 | ||
93 | static struct mtd_partition *nand_part_info(int size, int *num_partitions) | ||
94 | { | ||
95 | *num_partitions = ARRAY_SIZE(nand_partitions); | ||
96 | return nand_partitions; | ||
97 | } | ||
98 | 93 | ||
99 | static struct atmel_nand_data atngw100mkii_nand_data __initdata = { | 94 | static struct atmel_nand_data atngw100mkii_nand_data __initdata = { |
100 | .cle = 21, | 95 | .cle = 21, |
@@ -102,7 +97,8 @@ static struct atmel_nand_data atngw100mkii_nand_data __initdata = { | |||
102 | .rdy_pin = GPIO_PIN_PB(28), | 97 | .rdy_pin = GPIO_PIN_PB(28), |
103 | .enable_pin = GPIO_PIN_PE(23), | 98 | .enable_pin = GPIO_PIN_PE(23), |
104 | .bus_width_16 = true, | 99 | .bus_width_16 = true, |
105 | .partition_info = nand_part_info, | 100 | .parts = nand_partitions, |
101 | .num_parts = ARRAY_SIZE(nand_partitions), | ||
106 | }; | 102 | }; |
107 | #endif | 103 | #endif |
108 | 104 | ||
diff --git a/arch/avr32/boards/atstk1000/atstk1002.c b/arch/avr32/boards/atstk1000/atstk1002.c index 6ce30fb2ec94..4643ff5107c9 100644 --- a/arch/avr32/boards/atstk1000/atstk1002.c +++ b/arch/avr32/boards/atstk1000/atstk1002.c | |||
@@ -90,18 +90,13 @@ static struct mtd_partition nand_partitions[] = { | |||
90 | }, | 90 | }, |
91 | }; | 91 | }; |
92 | 92 | ||
93 | static struct mtd_partition *nand_part_info(int size, int *num_partitions) | ||
94 | { | ||
95 | *num_partitions = ARRAY_SIZE(nand_partitions); | ||
96 | return nand_partitions; | ||
97 | } | ||
98 | |||
99 | static struct atmel_nand_data atstk1006_nand_data __initdata = { | 93 | static struct atmel_nand_data atstk1006_nand_data __initdata = { |
100 | .cle = 21, | 94 | .cle = 21, |
101 | .ale = 22, | 95 | .ale = 22, |
102 | .rdy_pin = GPIO_PIN_PB(30), | 96 | .rdy_pin = GPIO_PIN_PB(30), |
103 | .enable_pin = GPIO_PIN_PB(29), | 97 | .enable_pin = GPIO_PIN_PB(29), |
104 | .partition_info = nand_part_info, | 98 | .parts = nand_partitions, |
99 | .num_parts = ARRAY_SIZE(num_partitions), | ||
105 | }; | 100 | }; |
106 | #endif | 101 | #endif |
107 | 102 | ||
diff --git a/arch/avr32/mach-at32ap/include/mach/board.h b/arch/avr32/mach-at32ap/include/mach/board.h index 679458d9a622..5d7ffca7d69f 100644 --- a/arch/avr32/mach-at32ap/include/mach/board.h +++ b/arch/avr32/mach-at32ap/include/mach/board.h | |||
@@ -128,7 +128,8 @@ struct atmel_nand_data { | |||
128 | u8 ale; /* address line number connected to ALE */ | 128 | u8 ale; /* address line number connected to ALE */ |
129 | u8 cle; /* address line number connected to CLE */ | 129 | u8 cle; /* address line number connected to CLE */ |
130 | u8 bus_width_16; /* buswidth is 16 bit */ | 130 | u8 bus_width_16; /* buswidth is 16 bit */ |
131 | struct mtd_partition *(*partition_info)(int size, int *num_partitions); | 131 | struct mtd_partition *parts; |
132 | unsigned int num_parts; | ||
132 | }; | 133 | }; |
133 | struct platform_device * | 134 | struct platform_device * |
134 | at32_add_device_nand(unsigned int id, struct atmel_nand_data *data); | 135 | at32_add_device_nand(unsigned int id, struct atmel_nand_data *data); |