1. 14 1月, 2006 9 次提交
    • D
      [PATCH] spi: add spi_bitbang driver · 9904f22a
      David Brownell 提交于
      This adds a bitbanging spi master, hooking up to board/adapter-specific glue
      code which knows how to set and read the signals (gpios etc).
      
      This code kicks in after the glue code creates a platform_device with the
      right platform_data.  That data includes I/O loops, which will usually
      come from expanding an inline function (provided in the header).  One goal
      is that the I/O loops should be easily optimized down to a few GPIO register
      accesses, in common cases, for speed and minimized overhead.
      
      This understands all the currently defined protocol tweaking options in the
      SPI framework, and might eventually serve as as reference implementation.
      
        - different word sizes (1..32 bits)
        - differing clock rates
        - SPI modes differing by CPOL (affecting chip select and I/O loops)
        - SPI modes differing by CPHA (affecting I/O loops)
        - delays (usecs) after transfers
        - temporarily deselecting chips in mid-transfer
      
      A lot of hardware could work with this framework, though common types of
      controller can't reach peak performance without switching to a driver
      structure that supports pipelining of transfers (e.g.  DMA queues) and maybe
      controllers (e.g.  IRQ driven).
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      9904f22a
    • D
      [PATCH] spi: ads7836 uses spi_driver · 2e5a7bd9
      David Brownell 提交于
      This updates the ads7864 driver to use the new "spi_driver" struct, and
      includes some minor unrelated cleanup.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      2e5a7bd9
    • D
      [PATCH] SPI core tweaks, bugfix · 0c868461
      David Brownell 提交于
      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: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      0c868461
    • D
      [PATCH] spi: add spi_driver to SPI framework · b885244e
      David Brownell 提交于
      This is a refresh of the "Simple SPI Framework" found in 2.6.15-rc3-mm1
      which makes the following changes:
      
        * There's now a "struct spi_driver".  This increase the footprint
          of the core a bit, since it now includes code to do what the driver
          core was previously handling directly.  Documentation and comments
          were updated to match.
      
        * spi_alloc_master() now does class_device_initialize(), so it can
          at least be refcounted before spi_register_master().  To match,
          spi_register_master() switched over to class_device_add().
      
        * States explicitly that after transfer errors, spi_devices will be
          deselected.  We want fault recovery procedures to work the same
          for all controller drivers.
      
        * Minor tweaks:  controller_data no longer points to readonly data;
          prevent some potential cast-from-null bugs with container_of calls;
          clarifies some existing kerneldoc,
      
      And a few small cleanups.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b885244e
    • D
      [PATCH] spi: mtd dataflash driver · 1d6432fe
      David Brownell 提交于
      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: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      1d6432fe
    • D
      [PATCH] spi: ads7846 driver · ffa458c1
      David Brownell 提交于
      This is a driver for the ADS7846 touchscreen sensor, derived from
      the corgi_ts and omap_ts drivers.  Key differences from those two:
      
        - Uses the new SPI framework (minimalist version)
        - <linux/spi/ads7846.h> abstracts board-specific touchscreen info
        - Sysfs attributes for the temperature and voltage sensors
        - Uses fewer ARM-specific IRQ primitives
      
      The temperature and voltage sensors show up in sysfs like this:
      
        $ pwd
        /sys/devices/platform/omap-uwire/spi2.0
        $ ls
        bus@          input:event0@ power/        temp1         vbatt
        driver@       modalias      temp0         vaux
        $ cat modalias
        ads7846
        $ cat temp0
        991
        $ cat temp1
        1177
        $
      
      So far only basic testing has been done.  There's a fair amount of hardware
      that uses this sensor, and which also runs Linux, which should eventually
      be able to use this driver.
      
      One portability note may be of special interest.  It turns out that not all
      SPI controllers are happy issuing requests that do things like "write 8 bit
      command, read 12 bit response".  Most of them seem happy to handle various
      word sizes, so the issue isn't "12 bit response" but rather "different rx
      and tx write sizes", despite that being a common MicroWire convention.  So
      this version of the driver no longer reads 12 bit native-endian words; it
      reads 16-bit big-endian responses, then byteswaps them and shifts the
      results to discard the noise.
      Signed-off-by: NDavid Brownell <david-b@pacbell.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      ffa458c1
    • D
      [PATCH] spi: simple SPI framework · 8ae12a0d
      David Brownell 提交于
      This is the core of a small SPI framework, implementing the model of a
      queue of messages which complete asynchronously (with thin synchronous
      wrappers on top).
      
        - It's still less than 2KB of ".text" (ARM).  If there's got to be a
          mid-layer for something so simple, that's the right size budget.  :)
      
        - The guts use board-specific SPI device tables to build the driver
          model tree.  (Hardware probing is rarely an option.)
      
        - This version of Kconfig includes no drivers.  At this writing there
          are two known master controller drivers (PXA/SSP, OMAP MicroWire)
          and three protocol drivers (CS8415a, ADS7846, DataFlash) with LKML
          mentions of other drivers in development.
      
        - No userspace API.  There are several implementations to compare.
          Implement them like any other driver, and bind them with sysfs.
      
      The changes from last version posted to LKML (on 11-Nov-2005) are minor,
      and include:
      
        - One bugfix (removes a FIXME), with the visible effect of making device
          names be "spiB.C" where B is the bus number and C is the chipselect.
      
        - The "caller provides DMA mappings" mechanism now has kerneldoc, for
          DMA drivers that want to be fancy.
      
        - Hey, the framework init can be subsys_init.  Even though board init
          logic fires earlier, at arch_init ... since the framework init is
          for driver support, and the board init support uses static init.
      
        - Various additional spec/doc clarifications based on discussions
          with other folk.  It adds a brief "thank you" at the end, for folk
          who've helped nudge this framework into existence.
      
      As I've said before, I think that "protocol tweaking" is the main support
      that this driver framework will need to evolve.
      
      From: Mark Underwood <basicmark@yahoo.com>
      
        Update the SPI framework to remove a potential priority inversion case by
        reverting to kmalloc if the pre-allocated DMA-safe buffer isn't available.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      8ae12a0d
    • P
      [PATCH] Increase AT_VECTOR_SIZE · 67daf5f1
      Paul Mackerras 提交于
      On PowerPC, we want to be able to provide an AT_PLATFORM aux table
      entry to userspace, so that glibc can choose optimized libraries for
      the processor we're running on.  Unfortunately that would be the 21st
      aux table entry on powerpc, meaning that the aux table including the
      terminating null entry would overflow the mm->saved_auxv[] array,
      leading to userland programs segfaulting.
      
      This increases the size of the mm->saved_auxv array to be large enough
      to accommodate an AT_PLATFORM entry on powerpc.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      67daf5f1
    • E
      [PATCH] Fix oops in ufs_fill_super at mount time · 8a430d74
      Evgeniy 提交于
      There's a lack of parenthesis in fs/ufs/utils.h, so instead of the 512th
      byte of buffer, the usb2 pointer will point to the nth structure of type
      ufs_super_block_second.
      
      This can cause a mount-time oops if you're unlucky (especially with
      DEBUG_PAGEALLOC, which is how Alexey Dobriyan saw this problem)
      Signed-off-by: NEvgeniy Dushistov <dushistov@mail.ru>
      Acked-by: NAlexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      8a430d74
  2. 13 1月, 2006 31 次提交