28 May, 2010

40 commits

  • Use memdup_user when user data is immediately copied into the
    allocated region.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    expression from,to,size,flag;
    position p;
    identifier l1,l2;
    @@

    - to = \(kmalloc@p\|kzalloc@p\)(size,flag);
    + to = memdup_user(from,size);
    if (
    - to==NULL
    + IS_ERR(to)
    || ...) {

    }
    - if (copy_from_user(to, from, size) != 0) {
    -
    - }
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Julia Lawall
     
  • The current backlight code is stubbed out, so the new props changes added
    some warnings:
    drivers/video/bf54x-lq043fb.c: In function 'bfin_bf54x_probe':
    drivers/video/bf54x-lq043fb.c:666: warning: label 'out9' defined but not used
    drivers/video/bf54x-lq043fb.c:504: warning: unused variable 'props'

    Fix em !

    Signed-off-by: Mike Frysinger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Frysinger
     
  • The current backlight code is stubbed out, so the new props changes added
    some warnings about unused label/prop.

    Signed-off-by: Mike Frysinger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Frysinger
     
  • Use memdup_user when user data is immediately copied into the
    allocated region.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    expression from,to,size,flag;
    position p;
    identifier l1,l2;
    @@

    - to = \(kmalloc@p\|kzalloc@p\)(size,flag);
    + to = memdup_user(from,size);
    if (
    - to==NULL
    + IS_ERR(to)
    || ...) {

    }
    - if (copy_from_user(to, from, size) != 0) {
    -
    - }
    //

    Signed-off-by: Julia Lawall
    Cc: Joseph Chan
    Cc: Scott Fang
    Cc: Florian Tobias Schandinat
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Julia Lawall
     
  • Add support for S3 Trio3D/1X (86C360) and S3 Trio3D/2X (86C362 and 86C368)
    cards to s3fb driver. Tested with 86C362 AGP and 86C368 PCI&AGP.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Ondrej Zary
    Acked-by: Ondrej Zajicek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ondrej Zary
     
  • This eliminates the following build warning:

    drivers/gpio/it8761e_gpio.c: In function `it8761e_gpio_exit':
    drivers/gpio/it8761e_gpio.c:220: warning: ignoring return value of `gpiochip_remove', declared with attribute warn_unused_result

    Signed-off-by: Daniel Mack
    Cc: Denis Turischev
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Daniel Mack
     
  • Intel Penwell chip has two 96 pins GPIO blocks, which are very similiar as
    Intel Langwell chip GPIO block, except for pin number difference. This
    patch expends the original Langwell GPIO driver to support Penwell's.

    Signed-off-by: Alek Du
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alek Du
     
  • A few architectures, like OMAP, allow you to set a debouncing time for the
    gpio before generating the IRQ. Teach gpiolib about that.

    Mark said:
    : This would be generally useful for embedded systems, especially where
    : the interrupt concerned is a wake source. It allows drivers to avoid
    : spurious interrupts from noisy sources so if the hardware supports it
    : the driver can avoid having to explicitly wait for the signal to become
    : stable and software has to cope with fewer events. We've lived without
    : it for quite some time, though.

    David said:
    : I looked at adding debounce support to the generic GPIO calls (and thus
    : gpiolib) some time back, but decided against it. I forget why at this
    : time (check list archives) but it wasn't because of lack of utility in
    : certain contexts.
    :
    : One thing to watch out for is just how variable the hardware capabilities
    : are. Atmel GPIOs have something like a fixed number of 32K clock cycles
    : for debounce, twl4030 had something odd, OMAPs were more like the Atmel
    : chips but with a different clock. In some cases debouncing had to be
    : ganged, not per-GPIO. And so forth.

    Signed-off-by: Felipe Balbi
    Cc: Tony Lindgren
    Cc: David Brownell
    Reviewed-by: Mark Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Felipe Balbi
     
  • The current message, 'not registered' is confusing as it implies it was
    not registered with something, whereas printing 'failed to register'
    implies it was the gpiochip_add() call that did not work correctly.

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

    Ben Dooks
     
  • Fix a bug I noticed while hacking on the max732x driver for interrupt
    support. According to the datasheets, open-drain pins have to be
    configured as output-high (which in that case is actually high impedance)
    to be used as input.

    Signed-off-by: Marc Zyngier
    Acked-by: Eric Miao
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Marc Zyngier
     
  • Setup both client_group_a and client_group_b if nr_port > 8 (not including
    nr_port==8).

    Signed-off-by: Axel Lin
    Cc: Eric Miao
    Cc: Ben Dooks
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Axel Lin
     
  • The valid offset value is 0..PL061_GPIO_NR-1, this patch corrects the
    offset value range checking.

    Signed-off-by: Axel Lin
    Acked-by: Baruch Siach
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Axel Lin
     
  • Signed-off-by: Uwe Kleine-König
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Uwe Kleine-König
     
  • gpiolib doesn't need to modify the names and I assume most initializers
    use string constants that shouldn't be modified anyhow.

    [akpm@linux-foundation.org: fix drivers/gpio/cs5535-gpio.c]
    Signed-off-by: Uwe Kleine-König
    Cc: Kevin Wells
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Uwe Kleine-König
     
  • Most of the GPIO expanders supported by the max732x driver have interrupt
    generation capability by reporting changes on input pins through an INT#
    pin. This patch implements the irq_chip functionnality (edge detection
    only).

    Signed-off-by: Marc Zyngier
    Cc: Eric Miao
    Cc: Jebediah Huang
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Marc Zyngier
     
  • Add a driver for the RTC on the AB8500 power management chip. This is a
    client of the AB8500 MFD driver.

    Signed-off-by: Virupax Sadashivpetimath
    Signed-off-by: Rabin Vincent
    Acked-by: Linus Walleij
    Acked-by: Srinidhi Kasagar
    Cc: Alessandro Zummo
    Cc: Samuel Ortiz
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Virupax Sadashivpetimath
     
  • Use memdup_user when user data is immediately copied into the
    allocated region.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    expression from,to,size,flag;
    position p;
    identifier l1,l2;
    @@

    - to = \(kmalloc@p\|kzalloc@p\)(size,flag);
    + to = memdup_user(from,size);
    if (
    - to==NULL
    + IS_ERR(to)
    || ...) {

    }
    - if (copy_from_user(to, from, size) != 0) {
    -
    - }
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Julia Lawall
     
  • Use memdup_user when user data is immediately copied into the
    allocated region.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    expression from,to,size,flag;
    position p;
    identifier l1,l2;
    @@

    - to = \(kmalloc@p\|kzalloc@p\)(size,flag);
    + to = memdup_user(from,size);
    if (
    - to==NULL
    + IS_ERR(to)
    || ...) {

    }
    - if (copy_from_user(to, from, size) != 0) {
    -
    - }
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Julia Lawall
     
  • Use ERR_CAST(x) rather than ERR_PTR(PTR_ERR(x)). The former makes more
    clear what is the purpose of the operation, which otherwise looks like a
    no-op.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    type T;
    T x;
    identifier f;
    @@

    T f (...) { }

    @@
    expression x;
    @@

    - ERR_PTR(PTR_ERR(x))
    + ERR_CAST(x)
    //

    Signed-off-by: Julia Lawall
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Julia Lawall
     
  • Add a glue layer to support the sdhci driver on the ST SPEAr platform.

    Signed-off-by: Viresh Kumar
    Cc:
    Cc: Linus Walleij
    Cc: Russell King
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Viresh KUMAR
     
  • SDIO specification allows RAW (Read after Write) operation using
    IO_RW_DIRECT command (CMD52) by setting the RAW bit. This operation is
    similar to ordinary read/write commands, except that both write and read
    are performed using single command/response pair. The Linux SDIO layer
    already supports this internaly, only external function is missing for
    drivers to make use, which is added by this patch.

    This type of command is required to implement proper power save mode
    support in wl1251 wifi driver.

    Android has similar patch for G1 in it's tree for the same reason:

    http://android.git.kernel.org/?p=kernel/common.git;a=commitdiff;h=74a47786f6ecbe6c1cf9fb15efe6a968451deb52

    Signed-off-by: Grazvydas Ignotas
    Acked-by: Kalle Valo
    Cc: Dmitry Shmidt
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Grazvydas Ignotas
     
  • Even though many mmc host drivers pass a pm_message_t argument to
    mmc_suspend_host() that argument isn't used the by MMC core. As host
    drivers are converted to dev_pm_ops they'll have to construct
    pm_message_t's (as they won't be passed by the PM subsystem any more) just
    to appease the mmc suspend interface.

    We might as well just delete the unused paramter.

    Signed-off-by: Matt Fleming
    Acked-by: Anton Vorontsov
    Acked-by: Michal Miroslaw ZZ
    Acked-by: Sascha Sommer
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matt Fleming
     
  • Convert PM operations to use dev_pm_ops. This will facilitate the runtime
    PM coversion which will add to dev_pm_ops hooks.

    Note that dev_pm_ops version of the suspend hook no longer takes a 'state'
    argument. However, the MMC core function mmc_suspend_host() still takes a
    'state' argument, but it is unused, so a dummy state variable was created
    to pass to the MMC core.

    In the future, the MMC core should be converted to drop this state
    argument and the rest of the MMC drivers could be easily converted to
    dev_pm_ops as well.

    Signed-off-by: Kevin Hilman
    Cc: Madhusudhan Chikkature
    Cc: Adrian Hunter
    Cc: Matt Fleming
    Cc: Tony Lindgren
    Cc: Denis Karpov
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kevin Hilman
     
  • The following changes were needed:
    - do not use in_interrupt() because it will not work
    with threaded interrupts

    In addition, the following improvements were made:
    - ensure DMA is unmapped only after the final DMA interrupt
    - ensure a request is completed only after the final DMA interrupt
    - disable controller interrupts when a request is not in progress
    - remove the spin-lock protecting the start of a new request from
    an unexpected interrupt because the locking was complicated and
    a 'req_in_progress' flag suffices (since the spin-lock only defers
    the unexpected interrupts anyway)
    - instead use the spin-lock to protect the MMC interrupt handler
    from the DMA interrupt handler
    - remove the semaphore preventing DMA from being started while
    the previous DMA is still in progress - the other changes make that
    impossible, so it is now a BUG_ON condition
    - ensure the controller interrupt status is clear before exiting
    the interrrupt handler

    In general, these changes make the code safer but do not fix any specific
    bugs so backporting is not necessary.

    Signed-off-by: Adrian Hunter
    Tested-by: Venkatraman S
    Acked-by: Madhusudhan Chikkature
    Acked-by: Tony Lindgren
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Hunter
     
  • Wifi over SDIO doesn't work correctly without multiblock, so enable this.
    This patch depends on the following patches:

    Signed-off-by: Maurus Cuelenaere
    Cc: Thomas Abraham
    Cc: Ben Dooks
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Maurus Cuelenaere
     
  • Enable the ADMA feature in the 6410 SDHCI controller driver.

    Signed-off-by: Maurus Cuelenaere
    Signed-off-by: Thomas Abraham
    Acked-by: Ben Dooks
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Thomas Abraham
     
  • The s3c6410 sdhci controller does not support the 'End' attribute and NOP
    attribute in the same 8-Byte ADMA descriptor. This patch adds a new quirk
    to identify sdhci host contollers with such behaviour. In addition to
    this, for controllers using the new quirk, the last entry in the ADMA
    descritor table is marked with the 'End' attribute (instead of using a NOP
    descriptor with 'End' attribute).

    Signed-off-by: Maurus Cuelenaere
    Signed-off-by: Thomas Abraham
    Acked-by: Ben Dooks
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Thomas Abraham
     
  • Unfortunately some architectures #define their read{b,w,l} and
    write{b,w,l} I/O accessors which makes the SDHCI I/O accessor functions of
    the same names subject to preprocessing. This leads to the following
    compiler error,

    In file included from drivers/mmc/host/sdhci.c:26:
    drivers/mmc/host/sdhci.h:318:35: error: macro "writel" passed 3 arguments, but takes just 2

    Rename the SDHCI I/O functions so that CONFIG_MMC_SDHCI_IO_ACCESSORS can
    be enabled for architectures that implement their read{b,w,l} and
    write{b,w,l} functions with macros.

    Signed-off-by: Matt Fleming
    Cc: Zhangfei Gao
    Acked-by: Anton Vorontsov
    Acked-by: Wolfram Sang
    Acked-by: Ben Dooks
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matt Fleming
     
  • Signed-off-by: Zhangfei Gao
    Reviewed-by: Matt Fleming
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Zhangfei Gao
     
  • Atmel-mci support for SDIO interrupts. This adds the enable_sdio_irq()
    function and the configuration of sdio irq mask per slot. With this irq
    mask information, we keep the idea of multiple slot per sd/mmc host (not
    only A and B). MMC_CAP_SDIO_IRQ is added according to slot configuration.

    A new little function is added to run mmc_signal_sdio_irq() during
    interrupt handling routine.

    Signed-off-by: Anders Grahn
    Signed-off-by: Nicolas Ferre
    Cc: Haavard Skinnemoen
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Anders Grahn
     
  • MMCIF is the MMC Host Interface in SuperH.

    Signed-off-by: Yusuke Goda
    Cc: Ben Hutchings
    Cc: Paul Mundt
    Cc: Magnus Damm
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yusuke Goda
     
  • Enable high speed support for atmel-mci driver. This support is dependent
    of the revision of the IP and, of course, the capacity of the SD card
    used.

    Signed-off-by: Nicolas Ferre
    Reviewed-by: Haavard Skinnemoen
    Cc: Maciej Sosnowski
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nicolas Ferre
     
  • The clearing of mrq via a memset at the top of the for loop in
    mmc_wait_for_app_cmd() is not required as mrq is not used and there is
    another clearing of mrq just below. We remove the first memset since if
    the initial tests in the for loop fail the memset is not required.

    Signed-off-by: Mark Asselstine
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mark Asselstine
     
  • Improve the suspend and resume callbacks in DaVinci MMC host controller
    driver. Modify the reset status of the contorller and clock during
    suspend and resume. Also migrate the power management callbacks from
    platform driver to dev_pm_ops structure.

    Tested on DA850/OMAP-L138 EVM.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Chaithrika U S
    Acked-by: Kevin Hilman
    Cc: Vipin Bhandari
    Cc: Sudhakar Rajashekhara
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chaithrika U S
     
  • Add a helper function which will aid in changing the reset
    status of the controller.

    Signed-off-by: Chaithrika U S
    Signed-off-by: Kevin Hilman
    Cc: Vipin Bhandari
    Cc: Sudhakar Rajashekhara
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chaithrika U S
     
  • Some hosts have an extended SDHCI iomem size, so the driver should
    only print errors if the iomem size is less than 0x100.

    Signed-off-by: Anton Vorontsov
    Acked-by: Richard Röjfors
    Cc: David Vrabel
    Cc: Pierre Ossman
    Cc: Ben Dooks
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Anton Vorontsov
     
  • This includes platform ops, quirks and (de)initialization callbacks.

    Signed-off-by: Anton Vorontsov
    Cc: Richard Röjfors
    Cc: David Vrabel
    Cc: Pierre Ossman
    Cc: Ben Dooks
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Anton Vorontsov
     
  • Some hosts (e.g. as found in CNS3xxx SOCs) report wrong value in
    CLOCK_BASE capability field, and currently there is no way to force the
    SDHCI core to use the platform-provided base clock value.

    This patch implements CAP_CLOCK_BASE_BROKEN quirk. When enabled, the
    SDHCI core will always use base clock frequency provided by the platform.

    Signed-off-by: Anton Vorontsov
    Cc: Richard Röjfors
    Cc: David Vrabel
    Cc: Pierre Ossman
    Cc: Ben Dooks
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Anton Vorontsov
     
  • The omap850 and omap730 use 16-bit registers instead of 32-bit, requiring
    a modification of the register addresses in the mmc-omap driver. To
    resolve this, a bit shift is performed on base register addresses, either
    by 1 or 2 bits depending on the CPU in use. This yields the correct
    registers for each CPU.

    Signed-off-by: Marek Belisko
    Signed-off-by: Cory Maccarrone
    Signed-off-by: Tony Lindgren
    Cc: Ladislav Michl
    Cc: Ben Dooks
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Marek BElisko
     
  • On some platforms like DM355, the number of EDMA parameter slots available
    for EDMA_SLOT_ANY usage are few. In such cases, if MMC/SD uses 16 slots
    for each instance of MMC controller, then the number of slots available
    for other modules will be very few.

    By passing the number of EDMA slots to be used in MMC driver from platform
    data, EDMA slots available for other purposes can be controlled.

    Most of the platforms will not use this platform data variable. But on
    DM355, as the number of EDMA resources available is limited, the number of
    scatter- gather segments used inside the MMC driver can be 8 (passed as
    platform data) instead of 16. On DM355, when the number of scatter-gather
    segments was reduced to 8, I saw a performance difference of about
    0.25-0.4 Mbytes/sec during write. Read performance variations were
    negligible.

    Signed-off-by: Sudhakar Rajashekhara
    Acked-by: Kevin Hilman
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sudhakar Rajashekhara