]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commit
omap2_mcspi fixes + cleanups
authorDavid Brownell <david-b@pacbell.net>
Thu, 24 May 2007 03:46:12 +0000 (20:46 -0700)
committerTony Lindgren <tony@atomide.com>
Fri, 25 May 2007 00:37:54 +0000 (17:37 -0700)
commit7fc39f1f2f1f9998dd6d237e1de911020ba819fc
treeb3ba43a2a3ca7d7073ef78af2d5ca80db2b955de
parentfb20311f2077c4452ba73445b14a8c1642e4e331
omap2_mcspi fixes + cleanups

McSPI functional updates:

 - Implement the spi_transfer.delay_usecs mechanism (previously omitted).

 - Remove strange per-device <asm/arch/mcspi.h> hookery ... it's not even
   correct as a per-device config.  We *always* want "single channel" mode
   (in "keep chipselect active" mode); and if we used "turbo", it would
   be a per-transfer option (as an rx-only double buffering tweak).

 - When enabling/disabling a channel, old value is irrelevant; don't read.

 - Sanity check spi->mode bits, and reject ones we don't support.

 - Streamline DMA channel selection:  do it once during probe(), using static
   tables; smaller, faster.  OMAP 2430 still needs changes here, minimally for
   the third SPI controller.  (Board init should change too, to not assume
   all SPI controllers are used on every board...)

 - Remove #ifdefs around doing reset on driver startup ... enable clocks
   so we can do that (!), and turn on auto-idle.

 - Waste less time enabling/disabling the clocks while working the queue.

 - Flag DMA channels as freed when we do so ... so they can't get reused
   later (when another driver may own them).

 - Minor PIO fix: don't need to verify TX side completed except for TX_ONLY
   mode, since RX completed implies TX completed.

 - Remove bogus code which always dropped chipselect after the last RX_ONLY
   word (rather than leaving it enabled).

 - Move error checks out of work loop into setup() and transfer(), so that
   they're reported ASAP rather than as mysterious transfer errors).

Plus a handful of cleanups:  whitespace fixes, comments.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
drivers/spi/omap2_mcspi.c