spi/spi-dw: Rework message processing
authorDirk Brandewie <dirk.brandewie@gmail.com>
Fri, 15 Jul 2011 13:39:27 +0000 (14:39 +0100)
committermgross <mark.gross@intel.com>
Wed, 9 Nov 2011 20:36:45 +0000 (12:36 -0800)
commitab958656505564534f53e2d0ad1d8103382dbffe
treeb5ef291837acfb9e4752f65c37de625d8de09317
parent4fbdbd46ccdf674e7eb99cf8461675ab2a5f1013
spi/spi-dw: Rework message processing

This patch reworks the message pump worker thread function to run
    until all messages queued to the driver have been handled. The
    function to handle individual spi_transfers is now a synchronus
    function the tasklet to handle spi_transfers has been removed. Work
    for the worker thread is only queued in host controller transfer
    function.

    Psuedo code for new thread function:
      message = get_message()
      while (message){
        for_each_transfer_in_msg(message){
          transfer_setup(transfer)
          do_transfer()
        }
        complete_message()
        message = get_message()
      }

    Changes that fell out of the message thread changes:
    Non-DMA transfers that are larger than the size of the controller FIFO
    are handled as interrupt driven transfers.

    Common FIFO handling functions shared PIO and interrupt transfers.

    Simplified queue stop/start funcitons.

    Cleanup fixes:
    Changed exported all exported function names to have spi_dw_ prefix

    Set fifo lenght in dw_spi_mid_init()

    Added dw_spi_{en,dis}able inline functions to replace spi_enable_chip()
    Added dw_spi_{mask,umask}_intr inline functions

Change-Id: I6a5f015ff1dbfa5d41297ca4c37bd3fbd9859959
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
drivers/spi/dw_spi.c
drivers/spi/dw_spi.h
drivers/spi/dw_spi_mid.c