diff options
author | David Brownell <david-b@pacbell.net> | 2006-01-08 16:34:22 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-01-13 19:29:54 -0500 |
commit | 1d6432fe10c3e724e307dd7137cd293a0edcae80 (patch) | |
tree | e32ba2eaecff99b2b86455ed2df8365b082cd396 /include/linux/spi | |
parent | ffa458c1bd9b6f653008d450f337602f3d52a646 (diff) |
[PATCH] spi: mtd dataflash driver
This is a conversion of the AT91rm9200 DataFlash MTD driver to use the
lightweight SPI framework, and no longer be AT91-specific. It compiles
down to less than 3KBytes on ARM.
The driver allows board-specific init code to provide platform_data with
the relevant MTD partitioning information, and hotplugs.
This version has been lightly tested. Its parent at91_dataflash driver has
been pretty well banged on, although kernel.org JFFS2 dataflash support was
acting broken the last time I tried it.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux/spi')
-rw-r--r-- | include/linux/spi/flash.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/linux/spi/flash.h b/include/linux/spi/flash.h new file mode 100644 index 000000000000..2ce6558bf3f8 --- /dev/null +++ b/include/linux/spi/flash.h | |||
@@ -0,0 +1,27 @@ | |||
1 | #ifndef LINUX_SPI_FLASH_H | ||
2 | #define LINUX_SPI_FLASH_H | ||
3 | |||
4 | struct mtd_partition; | ||
5 | |||
6 | /** | ||
7 | * struct flash_platform_data: board-specific flash data | ||
8 | * @name: optional flash device name (eg, as used with mtdparts=) | ||
9 | * @parts: optional array of mtd_partitions for static partitioning | ||
10 | * @nr_parts: number of mtd_partitions for static partitoning | ||
11 | * | ||
12 | * Board init code (in arch/.../mach-xxx/board-yyy.c files) can | ||
13 | * provide information about SPI flash parts (such as DataFlash) to | ||
14 | * help set up the device and its appropriate default partitioning. | ||
15 | * | ||
16 | * Note that for DataFlash, sizes for pages, blocks, and sectors are | ||
17 | * rarely powers of two; and partitions should be sector-aligned. | ||
18 | */ | ||
19 | struct flash_platform_data { | ||
20 | char *name; | ||
21 | struct mtd_partition *parts; | ||
22 | unsigned int nr_parts; | ||
23 | |||
24 | /* we'll likely add more ... use JEDEC IDs, etc */ | ||
25 | }; | ||
26 | |||
27 | #endif | ||