1. 13 10月, 2010 2 次提交
    • G
      spi/topcliff: Tidy up Kconfig help text · cdbc8f04
      Grant Likely 提交于
      The original didn't specify Topcliff in the config prompt text.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      cdbc8f04
    • G
      spi/topcliff: cleanups for style and conciseness · 65308c46
      Grant Likely 提交于
      This patch makes multiple cleanups to the new topcliff pch spi driver
      including, but not limited to,
      - removing superfluous brackets around variables
      - open coding functions that are only used once
      - removing unnecessary line breaks
      - removing unused functions
      - simplifying the interrupt enable/disable code
      - remove unnecessary (void *) casts.
      - remove b_mem_fail from pch_spi_set_tx to code it more cleanly
      - shorten dev_dbg() messages for conciseness and readability
      
      More cleanups are still needed in this driver.  In particular,
      - the driver filename should be changed to spi_topcliff_pch.c
      - many of the dev_dbg() lines should be trimmed (particularly the ones
        on unconditional code paths).
      - I suspect that the locking model not correct.  I'd like to know what
        drivers' critical regions are, and how they are protected.
      - get_resources and release_resources probably should be open coded in
        .probe and .release respectively.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      65308c46
  2. 09 10月, 2010 1 次提交
  3. 29 9月, 2010 6 次提交
  4. 09 9月, 2010 8 次提交
  5. 08 9月, 2010 1 次提交
  6. 01 9月, 2010 3 次提交
  7. 18 8月, 2010 1 次提交
    • G
      m68knommu: include sched.h in ColdFire/SPI driver · 5e1c5335
      Greg Ungerer 提交于
      Using the coldfire qspi driver, I get the following error:
      
      drivers/spi/coldfire_qspi.c: In function 'mcfqspi_irq_handler':
      drivers/spi/coldfire_qspi.c:166: error: 'TASK_NORMAL' undeclared (first use in this function)
      drivers/spi/coldfire_qspi.c:166: error: (Each undeclared identifier is reported only once
      
      It is solved by adding the following include to coldfire_sqpi.c:
      
          #include <linux/sched.h>
      
      Fix suggested by Jate Sujjavanich <jsujjavanich@syntech-fuelmaster.com>
      Signed-off-by: NGreg Ungerer <gerg@uclinux.org>
      5e1c5335
  8. 06 8月, 2010 1 次提交
  9. 01 8月, 2010 2 次提交
  10. 30 7月, 2010 1 次提交
  11. 12 7月, 2010 1 次提交
  12. 06 7月, 2010 1 次提交
  13. 04 7月, 2010 4 次提交
  14. 29 6月, 2010 1 次提交
    • E
      spi/mmc_spi: SPI bus locking API, using mutex · cf32b71e
      Ernst Schwab 提交于
      SPI bus locking API to allow exclusive access to the SPI bus, especially, but
      not limited to, for the mmc_spi driver.
      
      Coded according to an outline from Grant Likely; here is his
      specification (accidentally swapped function names corrected):
      
      It requires 3 things to be added to struct spi_master.
      - 1 Mutex
      - 1 spin lock
      - 1 flag.
      
      The mutex protects spi_sync, and provides sleeping "for free"
      The spinlock protects the atomic spi_async call.
      The flag is set when the lock is obtained, and checked while holding
      the spinlock in spi_async().  If the flag is checked, then spi_async()
      must fail immediately.
      
      The current runtime API looks like this:
      spi_async(struct spi_device*, struct spi_message*);
      spi_sync(struct spi_device*, struct spi_message*);
      
      The API needs to be extended to this:
      spi_async(struct spi_device*, struct spi_message*)
      spi_sync(struct spi_device*, struct spi_message*)
      spi_bus_lock(struct spi_master*)  /* although struct spi_device* might
      be easier */
      spi_bus_unlock(struct spi_master*)
      spi_async_locked(struct spi_device*, struct spi_message*)
      spi_sync_locked(struct spi_device*, struct spi_message*)
      
      Drivers can only call the last two if they already hold the spi_master_lock().
      
      spi_bus_lock() obtains the mutex, obtains the spin lock, sets the
      flag, and releases the spin lock before returning.  It doesn't even
      need to sleep while waiting for "in-flight" spi_transactions to
      complete because its purpose is to guarantee no additional
      transactions are added.  It does not guarantee that the bus is idle.
      
      spi_bus_unlock() clears the flag and releases the mutex, which will
      wake up any waiters.
      
      The difference between spi_async() and spi_async_locked() is that the
      locked version bypasses the check of the lock flag.  Both versions
      need to obtain the spinlock.
      
      The difference between spi_sync() and spi_sync_locked() is that
      spi_sync() must hold the mutex while enqueuing a new transfer.
      spi_sync_locked() doesn't because the mutex is already held.  Note
      however that spi_sync must *not* continue to hold the mutex while
      waiting for the transfer to complete, otherwise only one transfer
      could be queued up at a time!
      
      Almost no code needs to be written.  The current spi_async() and
      spi_sync() can probably be renamed to __spi_async() and __spi_sync()
      so that spi_async(), spi_sync(), spi_async_locked() and
      spi_sync_locked() can just become wrappers around the common code.
      
      spi_sync() is protected by a mutex because it can sleep
      spi_async() needs to be protected with a flag and a spinlock because
      it can be called atomically and must not sleep
      Signed-off-by: NErnst Schwab <eschwab@online.de>
      [grant.likely@secretlab.ca: use spin_lock_irqsave()]
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Tested-by: NMatt Fleming <matt@console-pimps.org>
      Tested-by: NAntonio Ospite <ospite@studenti.unina.it>
      cf32b71e
  15. 03 6月, 2010 2 次提交
  16. 25 5月, 2010 5 次提交