22 May, 2007

1 commit


17 May, 2007

1 commit


11 May, 2007

1 commit


10 May, 2007

2 commits


09 May, 2007

5 commits

  • Here is a driver for the Alchemy au1550 PSC (Programmable Serial
    Controller) in SPI master mode.

    It supports dma transfers using the Alchemy descriptor based dma controller
    for 4-8 bits per word SPI transfers. For 9-24 bits per word transfers, pio
    irq based mode is used to avoid setup of dma channels from scratch on each
    number of bits per word change.

    Tested with au1550; this may also work on other MIPS Alchemy cpus, like
    au1200/au1210/au1250. Used extensively with SD card connected via SPI;
    this handles 8.1MHz SPI clock transfers using dma without any problem (the
    highest SPI clock freq possible with au1550 running on 324MHz).

    The driver supports sharing of SPI bus by multiple devices. All features
    of Alchemy SPI mode are supported (all SPI modes, msb/lsb first, bits per
    word in 4-24 range).

    As the SPI clock of the controller depends on main input clock that shall
    be configured externally, platform data structure for au1550 SPI controller
    driver contains mainclk_hz attribute to define the input clock rate. From
    this value, dividers of the controller for SPI clock are set up for
    required frequency.

    Signed-off-by: Jan Nikitenko

    Whitespace and section fixups. Remove partial workaround for platform
    setup bug in dma_mask setup; it couldn't work with multiple controllers.

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

    Jan Nikitenko
     
  • 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
     
  • Simplify the spi_butterfly driver by removing incomplete/unused support for
    the second SPI bus, implemented by the USI controller. This should make
    this a clearer example of how to write a parport bitbang driver.

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

    David Brownell
     
  • Update some of the layered parport_driver code to use parport->dev:

    - i2c-parport (parent of i2c_adapter)
    - spi_butterfly (parent of spi_master, allowing cruft removal)
    - lp (creating class_device)
    - ppdev (parent of parportN device)
    - tipar (creating class_device)

    There are still drivers that should be updated, like some of the input
    drivers; but they won't be any worse off than they are today.

    Signed-off-by: David Brownell
    Cc: Greg KH
    Cc: Jean Delvare
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     

08 May, 2007

2 commits

  • Commit a836f5856ae46ccb2464ea76031ea05ae967b832 removes the shutdown
    member of the bitbang structure, breaking the build of spi_s3c24xx.c.

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

    Arnaud Patard
     
  • This patch implements the driver necessary use the Analog Devices Blackfin
    processor's SPI Port.

    Signed-off-by: Bryan Wu
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Wu, Bryan
     

18 Apr, 2007

1 commit

  • It turns out that the last patch to change set_cs to be kept in the
    controller's structure instead of the platform data was an incomplete
    change, and did not change the references to platfrom data in the setup
    xfer code. (This can prevent an oops.)

    Reported-by:
    Signed-off-by: Ben Dooks
    Signed-off-by: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ben Dooks
     

28 Mar, 2007

1 commit

  • WARNING: drivers/built-in.o - Section mismatch: reference to .init.text:spi_register_master from .text between 'spi_bitbang_start' (at offset 0x84e11a) and 'bitbang_work'
    WARNING: drivers/built-in.o - Section mismatch: reference to .init.text:spi_alloc_master from .text between 'butterfly_attach' (at offset 0x84e681) and 'at25_remove'
    WARNING: drivers/built-in.o - Section mismatch: reference to .init.text:spi_new_device from .text between 'butterfly_attach' (at offset 0x84e7e4) and 'at25_remove'

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

    Adrian Bunk
     

17 Mar, 2007

4 commits

  • The set_cs field of struct s3c24xx_spi is declared as returning a int but
    the value returned but set_cs is never fixed. Moreover, the default
    function for set_cs and the set_cs defintion in the platform data are
    returning void.

    I'm proposing to change the prototype to void (*set_cs)(...). By doing
    this, I'm also fixing 2 build warnings:

    drivers/spi/spi_s3c24xx.c: In function 's3c24xx_spi_probe':
    drivers/spi/spi_s3c24xx.c:330: warning: assignment from incompatible pointer type
    drivers/spi/spi_s3c24xx.c:335: warning: assignment from incompatible pointer type

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

    Arnaud Patard (Rtp
     
  • Prevents a potential oops with CONFIG_SPI_DEBUG given flakey hardware or
    incorrect configuration.

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

    Atsushi Nemoto
     
  • It's been pointed out that output GPIOs should have an initial value, to
    avoid signal glitching ... among other things, it can be some time before
    a driver is ready. This patch corrects that oversight, fixing

    - documentation
    - platforms supporting the GPIO interface
    - users of that call (just one for now, others are pending)

    There's only one user of this call for now since most platforms are still
    using non-generic GPIO setup code, which in most cases already couples the
    initial value with its "set output mode" request.

    Note that most platforms are clear about the hardware letting the output
    value be set before the pin direction is changed, but the s3c241x docs are
    vague on that topic ... so those chips might not avoid the glitches.

    Signed-off-by: David Brownell
    Acked-by: Andrew Victor
    Acked-by: Milan Svoboda
    Acked-by: Haavard Skinnemoen
    Cc: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     
  • Fix a bug in the cleanup of an spi_bitbang bus.

    The workqueue associated with the bus was destroyed before the call to
    spi_unregister_master. That meant that spi devices on that bus would be
    unable to do IO in their remove method. The shutdown flag should have been
    able to prevent a segfault, but was never getting set. By waiting to
    destroy the workqueue until after the master is unregistered, devices are
    able to do IO in their remove methods. An added benefit is that neither
    the shutdown flag nor a wait for the queue of messages to empty is needed.

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

    Chris Lesiak
     

21 Feb, 2007

2 commits


15 Feb, 2007

1 commit

  • Driver for the Atmel on-chip SPI master controller.

    Tested primarily on AVR32/AT32AP7000/ATSTK1000 using mtd_dataflash and the
    jffs2 filesystem. Should also work fine on various AT91 ARM-based chips
    like AT91SAM926x and AT91RM9200.

    Hardware documentation can be found in the AT32AP7000 data sheet, or its
    AT91 siblings, which can be downloaded from

    http://www.atmel.com/dyn/products/datasheets.asp?family_id=682

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

    Haavard Skinnemoen
     

13 Feb, 2007

6 commits

  • This is adds a simple SPI EEPROM driver, providing access to the EEPROM
    through sysfs much like the I2C "eeprom" driver ... except this driver
    supports write access, and multiple EEPROM sizes.

    From: "Tuppa, Walter"

    Since I have EEPROMs on SPI with different address sizing, I made some
    changes to your at25.c to support them. Works perfectly. (Also includes a
    small bugfix for the "what size address" test.)

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

    David Brownell
     
  • I'd like to assign NULL to kfree()d members of a structure. I can't do
    that without ugly casting (see the PXA patch) when the structure pointed to
    is const-qualified. I don't really see a reason why the cleanup method
    isn't allowed to alter the object it should clean up. :-)

    No, I didn't test the PXA patch, but I verified that the NULL-assignment
    doesn't stop me from doing rmmod/insmodding my own spi_bitbang-based
    driver.

    Signed-off-by: Hans-Peter Nilsson
    Signed-off-by: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hans-Peter Nilsson
     
  • A small bug-fix for spi_bitbang: it must always call the setup_transfer
    function via the overridable pointer, not assume that its
    spi_bitbang_setup_transfer is sufficient. Otherwise, if all options in the
    transfers are default (0), the overrided function will never be called.

    Granted, the function replacing it must call spi_bitbang_setup_transfer,
    but it might also have other important things to do, even if the second
    argument (the spi_transfer) is NULL. Tested together with the other
    patches on the spi_crisv32_sser and spi_crisv32_gpio drivers (not yet in
    the kernel, will IIUC be submitted as part of the usual
    arch-maintainer-pushes).

    Signed-off-by: Hans-Peter Nilsson
    Signed-off-by: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hans-Peter Nilsson
     
  • Add the SPI controller driver for Freescale i.MX(S/L/1).
    Main features summary:

    > Per chip setup via board specific code and/or protocol driver.
    > Per transfer setup.
    > PIO transfers.
    > DMA transfers.
    > Managing of NULL tx / rx buffer for rd only / wr only transfers.

    This patch replace patch-2.6.20-rc4-spi_imx with the following changes:
    > Few cosmetic changes.
    > Function map_dma_buffers now return 0 for success and -1 for failure.
    > Solved a bug inside spi_imx_probe function (wrong error path).
    > Solved a bug inside setup function (bad undo setup for max_speed_hz).
    > For read-only transfers, always write zero bytes.

    This is almost the same as the 'BIS' version sent by Andrea, except for
    updating the 'DUMMY' byte so that read-only transfers shift out zeroes.
    That part of the API changed recently, since some half duplex peripheral
    chips require that semantic.

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

    Andrea Paterniani
     
  • This adds a SPI driver for the Microwire controller on OMAP1 chips. This
    driver has been used in the Linux-OMAP tree for some time now, including
    with some of those displays using standardized 9-bit commands followed by
    data with 8-bit words.

    Microwire only supports half duplex transfers, but that's all that most SPI
    protocols need. When full duplex, or higher speeds, are needed there are
    several other controllers that can be used on OMAP.

    [akpm@osdl.org: cleanups]
    Signed-off-by: David Brownell
    Signed-off-by: Imre Deak
    Signed-off-by: Juha Yrjola
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     
  • Minor Kconfig cleanup ... put the SPI_S3C24XX entry in the
    correct location (alphabetical order).

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

    David Brownell
     

08 Feb, 2007

2 commits


27 Jan, 2007

3 commits

  • If a SPI master device exists, udev (udevtrigger) causes kernel crash, due
    to wrong kobj pointer in kobject_uevent_env(). This problem was not in
    2.6.19.

    The backtrace (on MIPS) was:
    [] kobject_uevent_env+0x54c/0x5e8
    [] store_uevent+0x1c/0x3c (in drivers/class.c)
    [] subsys_attr_store+0x2c/0x50
    [] flush_write_buffer+0x38/0x5c
    [] sysfs_write_file+0xd0/0x190
    [] vfs_write+0xc4/0x1a0
    [] sys_write+0x54/0xa0
    [] stack_done+0x20/0x3c

    flush_write_buffer() passes kobject of spi_master_class.subsys to
    subsys_addr_store(), then subsys_addr_store() passes a pointer to a struct
    subsystem to store_uevent() which expects a pointer to a struct
    class_device. The problem seems subsys_attr_store() called instead of
    class_device_attr_store().

    This mismatch was caused by commit
    3bd0f6943520e459659d10f3282285e43d3990f1, which overrides kset of master
    class. This made spi_master_class.subsys.kset.ktype NULL so
    subsys_sysfs_ops is used instead of class_dev_sysfs_ops.

    The commit was to fix spi_busnum_to_master(). Here is a patch fixes
    this function in other way, just searching children list of
    class_device.

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

    Atsushi Nemoto
     
  • Currently the spi mode can be set to the wrong mode if you are switching
    from any mode other than mode 0. This is because the mode is set using a
    bitwise or on uncleared bits. The following patch clears the mode bits
    before setting the new mode. I've also modified it to use the appropriate
    defines from pxa-regs.h for readability.

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

    Justin Clacherty
     
  • It turns out that the spi chipselect was not being passed to the set_cs
    routine if one was specified in the platform data.

    As part of the fix, change to using a set_cs field in the controller state,
    and put a default gpio routine in if the data passed does not specify it.

    Also remove the //#define DEBUG

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

    Ben Dooks
     

31 Dec, 2006

2 commits

  • Russel King recently reminded us that one shouldn't use asm/arch/hardware.h
    but one should use asm/hardware.h. Unfortunately, the spi_s3c24xx_gpio
    driver is using the wrong header. This patch is fixing that.

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

    Arnaud Patard (Rtp
     
  • Some issues were recently turned up with the current specification of what
    it means for spi_transfer.tx_buf to be null, as part of transfers which are
    (from the SPI protocol driver perspective) pure reads.

    Specifically, that it seems better to change the TX behaviour there from
    "undefined" to "will shift zeroes". This lets protocol drivers (like the
    ads7846 driver) depend on that behavior. It's what most controller drivers
    in the tree are already doing (with one exception and one case of driver
    wanting-to-oops), it's what Microwire hardware will necessarily be doing,
    and it removes an issue whereby certain security audits would need to
    define such a value anyway as part of removing covert channels.

    This patch changes the specification to require shifting zeroes, and
    updates all currently merged SPI controller drivers to do so.

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

    David Brownell
     

23 Dec, 2006

1 commit


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
     

08 Dec, 2006

4 commits