19 Oct, 2007

1 commit

  • Found these while looking at printk uses.

    Add missing newlines to dev_ uses
    Add missing KERN_ prefixes to multiline dev_s
    Fixed a wierd->weird spelling typo
    Added a newline to a printk

    Signed-off-by: Joe Perches
    Cc: "Luck, Tony"
    Cc: Jens Axboe
    Cc: Mark M. Hoffman
    Cc: Roland Dreier
    Cc: Tilman Schmidt
    Cc: David Woodhouse
    Cc: Jeff Garzik
    Cc: Stephen Hemminger
    Cc: Greg KH
    Cc: Jeremy Fitzhardinge
    Cc: Geert Uytterhoeven
    Cc: Alessandro Zummo
    Cc: David Brownell
    Cc: James Smart
    Cc: Andrew Vasquez
    Cc: "Antonino A. Daplas"
    Cc: Evgeniy Polyakov
    Cc: Russell King
    Cc: Jaroslav Kysela
    Cc: Takashi Iwai
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     

17 Oct, 2007

5 commits

  • Make the SPI framework and drivers stop using class_device. Update docs
    accordingly ... highlighting just which sysfs paths should be
    "safe"/stable.

    Signed-off-by: Tony Jones
    Signed-off-by: David Brownell
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tony Jones
     
  • Currently, all QE SPI controllers are almost the same comparing to
    MPC83xx's, thus let's use that driver for them.

    Tested to work on MPC85xx in loopback mode.

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

    Anton Vorontsov
     
  • Shrink the runtime footprint of various SPI drivers:

    - Move the probe() routine into the init section where practical,
    using platform_driver_probe() to make that safe. This often saves
    around 1KB. Using platform_driver_probe() can also be a correctness
    fix, if the probe routine is already marked __init but the driver
    struct keeps a dangling pointer to it after init section removal.

    - Likewise move remove() routines into the exit sections.

    These changes would be inappropriate iff the platform devices were
    actually hotpluggable (e.g. they're found on optional addon cards,
    or in an FPGA that's dynamically reprogrammed). In these cases,
    that's not the situation; it's an SOC controller and the only device
    is initialized before these drivers.

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

    David Brownell
     
  • Remove unused variable & write space

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

    Kyungmin Park
     
  • This patch cleans up duplicate includes in
    drivers/spi/

    Signed-off-by: Jesper Juhl
    Acked-by: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jesper Juhl
     

13 Oct, 2007

1 commit

  • This changes the uevent buffer functions to use a struct instead of a
    long list of parameters. It does no longer require the caller to do the
    proper buffer termination and size accounting, which is currently wrong
    in some places. It fixes a known bug where parts of the uevent
    environment are overwritten because of wrong index calculations.

    Many thanks to Mathieu Desnoyers for finding bugs and improving the
    error handling.

    Signed-off-by: Kay Sievers
    Cc: Mathieu Desnoyers
    Cc: Cornelia Huck
    Signed-off-by: Greg Kroah-Hartman

    Kay Sievers
     

12 Sep, 2007

1 commit

  • When the spi_mpc83xx driver receives a tx_buf pointer which is NULL, it
    only writes one zero filled word to the transmit register. If the driver
    expects to receive more than one word it will wait forever for a second
    receive interrupt. With this patch the controller will shift out zeroes
    until all words have been received.

    Signed-off-by: Jan Andersson
    Tested-by: Anton Vorontsov
    Signed-off-by: David Brownell
    Acked-by: Kumar Gala
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Andersson
     

31 Aug, 2007

3 commits

  • Fix cut 'n paste bug in Atmel SPI driver.

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

    Andrew Victor
     
  • Correct the name of the spi_txx9 driver (and their in-tree user)
    instead of MODULE_ALIAS workaround. This would be preferable in the
    long term.

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

    Atsushi Nemoto
     
  • Update various SPI drivers so they properly support

    - coldplug through "modprobe $(cat /sys/devices/.../modalias)"

    - hotplug through "modprobe $(MODALIAS)"

    The basic rule for platform, SPI, and (new style) I2C drivers is just
    to make sure that modprobing the driver name works. In this case, all
    the relevant drivers are platform drivers, and this patch either

    (a) Changes the driver name, if no in-tree code would break;
    this is simpler and thus preferable in the long term.

    (b) Adds MODULE_ALIAS directives, when in-tree platforms declare
    devices using the current driver name; less desirable.

    Most systems will link SPI controller drivers statically, but
    there's no point in being needlessly broken.

    Signed-off-by: David Brownell
    Cc: Jean Delvare
    Acked-by: Andrei Konovalov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     

12 Aug, 2007

3 commits

  • Git rid of "warning: passing arg 2 of `access_ok' makes pointer from integer
    without a cast" reported on SH ... most architectures use macros in that
    test, SH uses inlined functions.

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

    David Brownell
     
  • Long ago I've noticed (but didn't pay much attention) that
    spi_mpc83xx using PM calculations that differs from what
    specs describe. I.e.

    u8 pm = mpc83xx_spi->spibrg / (spi->max_speed_hz * 4);

    While specs says: "The SPI baud rate generator clock source (either
    system clock or system clock divided by 16, depending on DIV16 bit) is
    divided by 4 * ([PM] + 1), a range from 4 to 64.".

    Thus " - 1" is missing in the spi_mpc83xx's formula.

    Why nobody noticed that bug? Probably because sysclk usually less then
    user expects, e.g. you expect 200 MHz, but real clock is 198 MHz,
    and integer rounding helps when this formula is used.

    Suppose it's SPI in QE, SYSCLK at 198 MHz, thus SPIBRG at 99MHz, 25 MHz
    requested.

    PM = (99MHz / ( 25 MHz * 4 )), PM == 0, output SPICLK will be 24.75 MHz

    At lower frequencies this bug is more noticeable, though.

    And this bug shows itself in all its beauty if SYSCLK is equal or a bit
    more than you expect (200 MHz SYSCLK, 100 MHz SPIBRG):
    PM = (100MHz / ( 25 MHz * 4 )), PM == 1, output SPICLK will be 12.625 MHz!

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

    Anton Vorontsov
     
  • For MPC8349E input to the SPI Baud Rate Generator is SYSCLK, but it's
    SYSCLK/2 for MPC8323E (SPI in QE). Fix this, and remove confusion by
    renaming the mpc83xx_spi->sysclk member as mpc83xx_spi->spibrg.

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

    Anton Vorontsov
     

01 Aug, 2007

7 commits

  • This updates some error reporting paths in SPI device setup:

    - Move validation logic for SPI chipselects to spi_new_device(),
    which is where it should always have been.

    - In spi_new_device(), emit error messages if the device can't
    be created. This is LOTS better than a silent failure; though
    eventually, the calling convention should probably change to
    use the conventions.

    - Includes one previously-missing check: SPI masters must always
    have at least one chipselect, even for dedicated busses which
    always keep it selected!

    It also adds a FIXME (IDR for dynamic ID allocation) so the issue doesn't live
    purely in my mailbox.

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

    David Brownell
     
  • This exposes the hardware loopback mode to drivers, primarily for testing.

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

    Anton Vorontsov
     
  • The spidev driver doesn't currently expose all SPI communications modes to
    userspace. This passes them all through to the driver.

    Two of them are potentially troublesome, in the sense that they could cause
    hardware conflicts on shared busses. It might be appropriate to add some
    privilege checks for for those modes.

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

    Anton Vorontsov
     
  • spi_mpc83xx should use other shifts when running in QE+LSB mode.

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

    Anton Vorontsov
     
  • This controller supports LSB-first transfers; let drivers use them.

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

    Anton Vorontsov
     
  • Magic-numbers-R-Evil

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

    Anton Vorontsov
     
  • Documentation clearly states, that mode should not be changed till
    SPMODE_ENABLE bit set. I've seen hangs w/o this patch.

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

    Anton Vorontsov
     

27 Jul, 2007

1 commit


22 Jul, 2007

1 commit


18 Jul, 2007

13 commits

  • The SPI core/init code uses a semaphore as mutex. Use the mutex API instead
    of the (binary) semaphore.

    Signed-off-by: Matthias Kaehlcke
    Acked-by: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matthias Kaehlcke
     
  • This is a driver for SPI controller built into TXx9 MIPS SoCs.
    This driver is derived from arch/mips/tx4938/toshiba_rbtx4938/spi_txx9.c.

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

    Atsushi Nemoto
     
  • Add OMAP24XX McSPI (Multichannel SPI) controller driver. This driver is
    tested very well under OMAP GIT tree with N800 - Nokia Internet Tablet, and
    some other OMAP2 boards.

    Recent updates included bugfixes, cleanups, speedups, and better
    conformance to the current SPI programming interface. This doesn't yet
    understand the third controller instance on the OMAP 2430.

    [david-b@pacbell.net: more minor cleanups to the omap2_mcspi driver]
    Signed-off-by: Juha Yrjölä
    Signed-off-by: Trilok Soni
    Signed-off-by: David Brownell
    Cc: Tony Lindgren
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Samuel Ortiz
     
  • Quicc Engine enabled mpc83xx CPU's has a somewhat different HW interface to
    the SPI controller. This patch adds a qe_mode knob that sees to that
    needed adaptions are performed.

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

    Joakim Tjernlund
     
  • Simple SPI master driver for Xilinx SPI controller.
    No support for multiple masters.
    Not using level 1 drivers from EDK.

    [akpm@linux-foundation.org: uninlining]
    Signed-off-by: Yuri Frolov
    Signed-off-by: Andrei Konovalov
    Cc: Kumar Gala
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrei Konovalov
     
  • Add support for the Infineon TLE62x0 series of low-side driver chips, such
    as the TLE6220 or TLE6230. These can be viewed as output GPIOs specialized
    for power switching applications. The driver provides a userspace
    interface to those GPIOs, and to the switch status they provide.

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

    Ben Dooks
     
  • Tweak Kconfig for the S3C24XX SPI controller drivers. Both use the bitbang
    framework; only one previously said that. Plus in this case "select" is
    the right way to manage that dependency, since folk will not know up front
    to enable bitbang in order to even see those S3C drivers in order to enable
    them.

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

    David Brownell
     
  • Update chipselect handling for atmel_spi:

    * Teach it how to leave chipselect active between messages; this
    helps various drivers work better.

    * Cope with at91rm0200 errata: nCS0 can't be managed with GPIOs.
    The MR.PCS value is now updated whenever a chipselect changes.
    (This requires SPI pinmux init for that controller to change,
    and also testing on rm9200; doesn't break at91sam9 or avr32.)

    * Fix minor glitches: spi_setup() must leave chipselects inactive,
    as must removal of the spi_device.

    Also tweak diagnostic messaging to be a bit more useful.

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

    David Brownell
     
  • Minor updates to atmel_spi:

    - DMA:
    * Comments to explain the DMA policies
    * Report any mapping errors from spi_transfer()
    * Remove extra loop for DMA mapping

    - Diagnostics: report minimum clock rate, if we need to reject a
    spi_setup() request because that rate is too low.

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

    David Brownell
     
  • The MPC83xx SPI controller clock divider can divide the system clock by not
    more then 1024. The spi_mpc83xx driver does not check this and silently
    writes garbage to the SPI controller registers when asked to run at lower
    frequencies. I've tried to run the SPI on a 266MHz MPC8349E with 100kHz
    for debugging a bus problem and suddenly was confronted with a 2nd problem
    to debug.. ;-)

    The patch adds an additional check which avoids writing garbage to the SPI
    controller registers and warn the user about it. This might help others to
    avoid simmilar problems.

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

    Clifford Wolf
     
  • 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
     
  • Get rid of annoying GCC warning on 32-bit platforms.

    drivers/spi/spidev.c: In function 'spidev_message':
    drivers/spi/spidev.c:184: warning: cast to pointer from integer of different size
    drivers/spi/spidev.c:216: warning: cast to pointer from integer of different size

    The trick is to add an extra cast using "ptrdiff_t" to convert the u64 to
    the correct size integer, and only then casting it into a "void *" pointer.

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

    David Brownell
     
  • Minor SPI controller driver updates: make the setup() methods reject
    spi->mode bits they don't support, by masking aginst the inverse of bits
    they *do* support. This insures against misbehavior later when new mode
    bits get added.

    Most controllers can't support SPI_LSB_FIRST; more handle SPI_CS_HIGH.
    Support for all four SPI clock/transfer modes is routine.

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

    David Brownell
     

12 Jul, 2007

2 commits

  • Well, first of all, I don't want to change so many files either.

    What I do:
    Adding a new parameter "struct bin_attribute *" in the
    .read/.write methods for the sysfs binary attributes.

    In fact, only the four lines change in fs/sysfs/bin.c and
    include/linux/sysfs.h do the real work.
    But I have to update all the files that use binary attributes
    to make them compatible with the new .read and .write methods.
    I'm not sure if I missed any. :(

    Why I do this:
    For a sysfs attribute, we can get a pointer pointing to the
    struct attribute in the .show/.store method,
    while we can't do this for the binary attributes.
    I don't know why this is different, but this does make it not
    so handy to use the binary attributes as the regular ones.
    So I think this patch is reasonable. :)

    Who benefits from it:
    The patch that exposes ACPI tables in sysfs
    requires such an improvement.
    All the table binary attributes share the same .read method.
    Parameter "struct bin_attribute *" is used to get
    the table signature and instance number which are used to
    distinguish different ACPI table binary attributes.

    Without this parameter, we need to offer different .read methods
    for different ACPI table binary attributes.
    This is impossible as there are various ACPI tables on different
    platforms, and we don't know what they are until they are loaded.

    Signed-off-by: Zhang Rui
    Signed-off-by: Greg Kroah-Hartman

    Zhang Rui
     
  • sysfs is now completely out of driver/module lifetime game. After
    deletion, a sysfs node doesn't access anything outside sysfs proper,
    so there's no reason to hold onto the attribute owners. Note that
    often the wrong modules were accounted for as owners leading to
    accessing removed modules.

    This patch kills now unnecessary attribute->owner. Note that with
    this change, userland holding a sysfs node does not prevent the
    backing module from being unloaded.

    For more info regarding lifetime rule cleanup, please read the
    following message.

    http://article.gmane.org/gmane.linux.kernel/510293

    (tweaked by Greg to not delete the field just yet, to make it easier to
    merge things properly.)

    Signed-off-by: Tejun Heo
    Cc: Cornelia Huck
    Cc: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Tejun Heo
     

11 Jun, 2007

2 commits