25 May, 2010

2 commits

  • This patch adds an SPI master driver for the Cirrus EP93xx SPI controller found
    in EP93xx chips.

    Signed-off-by: Mika Westerberg
    Signed-off-by: H Hartley Sweeten
    Acked-by: H Hartley Sweeten
    Signed-off-by: Grant Likely

    Mika Westerberg
     
  • Fix this warning:

    Documentation/spi/spidev_fdx.c: In function `do_msg':
    Documentation/spi/spidev_fdx.c:61: warning: cast from pointer to integer of different size
    Documentation/spi/spidev_fdx.c:64: warning: cast from pointer to integer of different size

    buf should be unsigned long to match native arch on 32-bit x86 compile.

    Signed-off-by: Prarit Bhargava
    Signed-off-by: Grant Likely

    Prarit Bhargava
     

30 Apr, 2010

1 commit

  • The sample application spidev_test.c is using SPI_IOC_MESSAGE ioctl to do
    an SPI transfer. This ioctl returns the number of bytes successfully
    transmitted or a negative error code upon erroneous completion. The
    application however is returning an error if the result of the ioclt if
    the return value is 1. This makes the application to fail upon 1-byte
    length transfers.

    Signed-off-by: Hector Palacios
    Signed-off-by: Andrew Morton
    Signed-off-by: Grant Likely

    Hector Palacios
     

04 Dec, 2009

1 commit

  • That is "success", "unknown", "through", "performance", "[re|un]mapping"
    , "access", "default", "reasonable", "[con]currently", "temperature"
    , "channel", "[un]used", "application", "example","hierarchy", "therefore"
    , "[over|under]flow", "contiguous", "threshold", "enough" and others.

    Signed-off-by: André Goddard Rosa
    Signed-off-by: Jiri Kosina

    André Goddard Rosa
     

23 Sep, 2009

2 commits


01 Jul, 2009

1 commit

  • Add two new spi_device.mode bits to accomodate more protocol options, and
    pass them through to usermode drivers:

    * SPI_NO_CS ... a second 3-wire variant, where the chipselect
    line is removed instead of a data line; transfers are still
    full duplex.

    This obviously has STRONG protocol implications since the
    chipselect transitions can't be used to synchronize state
    transitions with the SPI master.

    * SPI_READY ... defines open drain signal that's pulled low
    to pause the clock. This defines a 5-wire variant (normal
    4-wire SPI plus READY) and two 4-wire variants (READY plus
    each of the 3-wire flavors).

    Such hardware flow control can be a big win. There are ADC
    converters and flash chips that expose READY signals, but not
    many host controllers support it today.

    The spi_bitbang code should be changed to use SPI_NO_CS instead of its
    current nonportable hack. That's a mode most hardware can easily support
    (unlike SPI_READY).

    Signed-off-by: David Brownell
    Cc: "Paulraj, Sandeep"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     

22 Apr, 2009

1 commit

  • This is a doc-only patch which I hope will reduce the number of
    spi_master controller driver patches starting out with a common
    implementation bug.

    (As in: almost every spi_master driver I see starts out with its
    version of this bug. Sigh.)

    It just re-emphasizes that the setup() method may be called for one
    device while a transfer is active on another ... which means that most
    driver implementations shouldn't touch any registers.

    Signed-off-by: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     

07 Jan, 2009

1 commit

  • This fixes a byteswap bug in the LM70 temperature sensor driver,
    which was previously covered up by a converse bug in the driver
    for the LM70EVAL-LLP board (which is also fixed).

    Other fixes: doc updates, remove an annoying msleep(), and improve
    three-wire protocol handling.

    Signed-off-by: Kaiwan N Billimoria
    [ dbrownell@users.sourceforge.net: doc and whitespace tweaks ]
    Signed-off-by: David Brownell
    Signed-off-by: Jean Delvare

    Kaiwan N Billimoria
     

02 Dec, 2008

1 commit


31 Oct, 2008

1 commit


17 Oct, 2008

1 commit

  • Make the chip info structure data optional by providing reasonable
    defaults. Improve corresponding documentation, and highlight the drawback
    of not providing explicit chipselect control.

    DMA can determine appropriate dma_burst_size and thresholds automatically
    so use DMA even if dma_burst_size is not specified.

    Signed-off-by: Vernon Sauder
    Reviewed-by: Ned Forrester
    Signed-off-by: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vernon Sauder
     

13 Aug, 2008

1 commit

  • Currently source files in the Documentation/ sub-dir can easily bit-rot
    since they are not generally buildable, either because they are hidden in
    text files or because there are no Makefile rules for them. This needs to
    be fixed so that the source files remain usable and good examples of code
    instead of bad examples.

    Add the ability to build source files that are in the Documentation/ dir.
    Add to Kconfig as "BUILD_DOCSRC" config symbol.

    Use "CONFIG_BUILD_DOCSRC=1 make ..." to build objects from the
    Documentation/ sources. Or enable BUILD_DOCSRC in the *config system.
    However, this symbol depends on HEADERS_CHECK since the header files need
    to be installed (for userspace builds).

    Built (using cross-tools) for x86-64, i386, alpha, ia64, sparc32,
    sparc64, powerpc, sh, m68k, & mips.

    Signed-off-by: Randy Dunlap
    Reviewed-by: Sam Ravnborg
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     

07 Aug, 2008

1 commit


28 Apr, 2008

1 commit


09 Apr, 2008

1 commit

  • Update SPI documentation to clarify some areas of recent confusion: clock
    polarity takes effect when chipselect goes active; and zero length buffers are
    OK in certain cases.

    Signed-off-by: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     

20 Oct, 2007

1 commit

  • * Convert files to UTF-8.

    * Also correct some people's names
    (one example is Eißfeldt, which was found in a source file.
    Given that the author used an ß at all in a source file
    indicates that the real name has in fact a 'ß' and not an 'ss',
    which is commonly used as a substitute for 'ß' when limited to
    7bit.)

    * Correct town names (Goettingen -> Göttingen)

    * Update Eberhard Mönkeberg's address (http://lkml.org/lkml/2007/1/8/313)

    Signed-off-by: Jan Engelhardt
    Signed-off-by: Adrian Bunk

    Jan Engelhardt
     

17 Oct, 2007

2 commits


01 Aug, 2007

1 commit

  • This is a simple utility used to test SPI functionality. It could stand
    growing options to support using other test data patterns; this initial
    version only issues full duplex transfers, which rules out 3WIRE or
    Microwire links.

    Signed-off-by: Anton Vorontsov
    Signed-off-by: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Anton Vorontsov
     

18 Jul, 2007

1 commit

  • This adds a driver for the LM70-LLP parport adapter, which is an eval board
    for the LM70 temperature sensor. For those without that board, it may be a
    simpler example of a parport-to-SPI adapter then spi_butterfly.

    Signed-off-by: Kaiwan N Billimoria

    Doc, coding style, and interface updates; build fixes. Minor rename.

    Signed-off-by: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kaiwan N Billimoria
     

24 May, 2007

1 commit


09 May, 2007

2 commits

  • Various documentation updates for the SPI infrastructure, to clarify things
    that may not have been clear, to cope with lack of editing, and fix
    omissions.

    Also, plug SPI into the kernel-api DocBook template, and fix all the
    resulting glitches in document generation.

    Signed-off-by: David Brownell
    Cc: "Randy.Dunlap"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     
  • Add a filesystem API for stack. The initial version of
    this interface is purely synchronous.

    dbrownell@users.sourceforge.net:

    Cleaned up, bugfixed; much simplified; added preliminary documentation.

    Works with mdev given CONFIG_SYSFS_DEPRECATED; and presumably udev.

    Updated SPI_IOC_MESSAGE ioctl to full spi_message semantics, supporting
    groups of one or more transfers (each of which may be full duplex if
    desired).

    This is marked as EXPERIMENTAL with an explicit disclaimer that the API
    (notably the ioctls) is subject to change.

    Signed-off-by: Andrea Paterniani
    Signed-off-by: David Brownell
    Cc: Arnd Bergmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrea Paterniani
     

22 Apr, 2007

1 commit

  • This patch removes the unnecessary bit number from CKENnn_XXXX
    definitions for PXA, so that

    CKEN0_PWM0 --> CKEN_PWM0
    CKEN1_PWM1 --> CKEN_PWM1
    ...
    CKEN24_CAMERA --> CKEN_CAMERA

    The reasons for the change of these defitions are:

    1. they do not scale - they are currently valid for pxa2xx, but
    definitely not valid for pxa3xx, e.g., pxa3xx has bit 3 for camera
    instead of bit 24

    2. they are unnecessary - the peripheral name within the definition
    has already announced its usage, we don't need those bit numbers
    to know which peripheral we are going to enable/disable clock for

    3. they are inconvenient - think about this: a driver programmer
    for pxa has to remember which bit in the CKEN register to turn
    on/off

    Another change in the patch is to make the definitions equal to its
    clock bit index, so that

    #define CKEN_CAMERA (24)

    instead of

    #define CKEN_CAMERA (1 << 24)

    this change, however, will add a run-time bit shift operation in
    pxa_set_cken(), but the benefit of this change is that it scales
    when bit index exceeds 32, e.g., pxa3xx has two registers CKENA
    and CKENB, totally 64 bit for this, suppose CAMERA clock enabling
    bit is CKENB:10, one can simply define CKEN_CAMERA to be (32 + 10)
    and so that pxa_set_cken() need minimum change to adapt to that.

    Signed-off-by: eric miao
    Signed-off-by: Russell King

    Eric Miao
     

13 Feb, 2007

2 commits


11 Dec, 2006

1 commit

  • Stabilize PIO mode transfers against a range of word sizes and FIFO
    thresholds and fixes word size setup/override issues.

    1) 16 and 32 bit DMA/PIO transfers broken due to timing differences.
    2) Potential for bad transfer counts due to transfer size assumptions.
    3) Setup function broken is multiple ways.
    4) Per transfer bit_per_word changes break DMA setup in pump_tranfers.
    5) False positive timeout are not errors.
    6) Changes in pxa2xx_spi_chip not effective in calls to setup.
    7) Timeout scaling wrong for PXA255 NSSP.
    8) Driver leaks memory while busy during unloading.

    Known issues:

    SPI_CS_HIGH and SPI_LSB_FIRST settings in struct spi_device are not handled.

    Testing:

    This patch has been test against the "random length, random bits/word,
    random data (verified on loopback) and stepped baud rate by octaves
    (3.6MHz to 115kHz)" test. It is robust in PIO mode, using any
    combination of tx and rx thresholds, and also in DMA mode (which
    internally computes the thresholds).

    Much thanks to Ned Forrester for exhaustive reviews, fixes and testing.
    The driver is substantially better for his efforts.

    Signed-off-by: Stephen Street
    Signed-off-by: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Street
     

04 Oct, 2006

1 commit


17 May, 2006

2 commits

  • We need to be able to have a "SPI bus 0" matching chip numbering; but
    that number was wrongly used to flag dynamic allocation of a bus number.

    This patch resolves that issue; now negative numbers trigger dynamic alloc.

    It also updates the how-to-write-a-controller-driver overview to mention
    this stuff.

    Signed-off-by: David Brownell
    Signed-off-by: Greg Kroah-Hartman

    David Brownell
     
  • This driver turns a PXA2xx synchronous serial port (SSP) into a SPI master
    controller (see Documentation/spi/spi_summary). The driver has the following
    features:

    - Support for any PXA2xx SSP
    - SSP PIO and SSP DMA data transfers.
    - External and Internal (SSPFRM) chip selects.
    - Per slave device (chip) configuration.
    - Full suspend, freeze, resume support.

    Signed-off-by: Stephen Street
    Signed-off-by: Andrew Morton
    Cc: David Brownell
    Signed-off-by: Greg Kroah-Hartman

    Stephen Street
     

07 Feb, 2006

1 commit

  • This resolves some minor version skew glitches that accumulated for the AVR
    Butterfly adapter driver, which caused among other things the existence of
    a duplicate Kconfig entry. Most of it boils down to comment updates, but in
    one case it removes some now-superfluous code that would be better if not
    copied into other controller-level drivers.

    Signed-off-by: David Brownell

    David Brownell
     

14 Jan, 2006

5 commits

  • This adds a bitbanging parport based adaptor cable for AVR Butterfly, giving
    SPI links to its DataFlash chip and (eventually) firmware running in the card.

    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    David Brownell
     
  • This collects some small SPI patches that seem to be missing from the MM tree:

    - spi_butterfly kbuild hooks got dropped somehow; this restores them
    - quick fix for a (theoretical?) m25p80_write() oops noted by Andrew
    - quick fix for a potential config-specific oops for mtd_dataflash()
    - minor doc tweaks

    Signed-off-by: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    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: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    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: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    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

    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: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    David Brownell