diff options
author | David Brownell <david-b@pacbell.net> | 2006-01-08 16:34:25 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-01-13 19:29:55 -0500 |
commit | 0c868461fcb8413cb9f691d68e5b99b0fd3c0737 (patch) | |
tree | b43db6239f5d72a279b35b14de85cf34d8f6bc74 /Documentation/spi | |
parent | b885244eb2628e0b8206e7edaaa6a314da78e9a4 (diff) |
[PATCH] SPI core tweaks, bugfix
This includes various updates to the SPI core:
- Fixes a driver model refcount bug in spi_unregister_master() paths.
- The spi_master structures now have wrappers which help keep drivers
from needing class-level get/put for device data or for refcounts.
- Check for a few setup errors that would cause oopsing later.
- Docs say more about memory management. Highlights the use of DMA-safe
i/o buffers, and zero-initializing spi_message and such metadata.
- Provide a simple alloc/free for spi_message and its spi_transfer;
this is only one of the possible memory management policies.
Nothing to break code that already works.
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 'Documentation/spi')
-rw-r--r-- | Documentation/spi/spi-summary | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Documentation/spi/spi-summary b/Documentation/spi/spi-summary index c6152d1ff2b0..761debf748e9 100644 --- a/Documentation/spi/spi-summary +++ b/Documentation/spi/spi-summary | |||
@@ -363,6 +363,22 @@ upper boundaries might include sysfs (especially for sensor readings), | |||
363 | the input layer, ALSA, networking, MTD, the character device framework, | 363 | the input layer, ALSA, networking, MTD, the character device framework, |
364 | or other Linux subsystems. | 364 | or other Linux subsystems. |
365 | 365 | ||
366 | Note that there are two types of memory your driver must manage as part | ||
367 | of interacting with SPI devices. | ||
368 | |||
369 | - I/O buffers use the usual Linux rules, and must be DMA-safe. | ||
370 | You'd normally allocate them from the heap or free page pool. | ||
371 | Don't use the stack, or anything that's declared "static". | ||
372 | |||
373 | - The spi_message and spi_transfer metadata used to glue those | ||
374 | I/O buffers into a group of protocol transactions. These can | ||
375 | be allocated anywhere it's convenient, including as part of | ||
376 | other allocate-once driver data structures. Zero-init these. | ||
377 | |||
378 | If you like, spi_message_alloc() and spi_message_free() convenience | ||
379 | routines are available to allocate and zero-initialize an spi_message | ||
380 | with several transfers. | ||
381 | |||
366 | 382 | ||
367 | How do I write an "SPI Master Controller Driver"? | 383 | How do I write an "SPI Master Controller Driver"? |
368 | ------------------------------------------------- | 384 | ------------------------------------------------- |