30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

17 Mar, 2010

7 commits

  • If we were to dynamically register/unregister leds and have udev or other
    daemons handle the leds class uevents, we would be notified of the adding of a
    new LED and if the daemon immediately tries to open one of the attributes of
    the led device, it would fail with a "no such file or directory" error since
    this the attributes are not yet created. Fix this by switching attributes to be
    class-wide, such that the driver core will register these attributes with
    device_add_attrs and then emit the kobject_uevent ADD signal.

    Signed-off-by: Fainelli
    Signed-off-by: Richard Purdie

    Florian Fainelli
     
  • The driver wrongly sets default state for LEDs that don't specify
    default-state property.

    Currently the driver handles default state this way:

    memset(&led, 0, sizeof(led));
    for_each_child_of_node(np, child) {
    state = of_get_property(child, "default-state", NULL);
    if (state) {
    if (!strcmp(state, "keep"))
    led.default_state = LEDS_GPIO_DEFSTATE_KEEP;
    ...
    }
    ret = create_gpio_led(&led, ...);
    }

    Which means that all LEDs that do not specify default-state will inherit
    the last value of the default-state property, which is wrong.

    This patch fixes the issue by moving LED's template initialization into
    the loop body.

    Signed-off-by: Anton Vorontsov
    Signed-off-by: Andrew Morton
    Signed-off-by: Richard Purdie

    Anton Vorontsov
     
  • This patch adds an LED driver to support the Dell Activity LED on the
    Dell Latitude 2100 netbook and future products to come. The Activity LED
    is visible externally in the lid so classroom instructors can observe it
    from a distance. The driver uses the sysfs led_class and provides a
    standard LED interface.

    Signed-off by: Bob Rodgers
    Signed-off-by: Louis Davis
    Signed-off-by: Jim Dailey , Developers
    Acked-by: Matthew Garrett
    Acked-by: Dmitry Torokhov
    Signed-off-by: Richard Purdie

    Bob Rodgers
     
  • Remove the need for "depends on LEDS_CLASS" by wrapping the affected
    config options in an if/endif block. Similar for "depends on LEDS_TRIGGERS".

    LEDS_COBALT_RAQ still has a "depends on LEDS_CLASS=y" since it cannot
    be selected to build as a module.

    Signed-off-by: H Hartley Sweeten
    Signed-off-by: Richard Purdie

    H Hartley Sweeten
     
  • As each led device gets registered a kernel message gets printed. In
    an embedded system with a number of leds this can produce a lot
    of output that just looks like noise.

    Change the message type to KERN_DEBUG since it might be useful
    in the dmesg output "after" booting.

    Signed-off-by: H Hartley Sweeten
    Signed-off-by: Richard Purdie

    H Hartley Sweeten
     
  • The id_table field of the struct pci_driver is constant in
    so it is worth to make pci_device_id also constant.

    The semantic match that finds this kind of pattern is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @r@
    disable decl_init,const_decl_init;
    identifier I1, I2, x;
    @@
    struct I1 {
    ...
    const struct I2 *x;
    ...
    };
    @s@
    identifier r.I1, y;
    identifier r.x, E;
    @@
    struct I1 y = {
    .x = E,
    };
    @c@
    identifier r.I2;
    identifier s.E;
    @@
    const struct I2 E[] = ... ;
    @depends on !c@
    identifier r.I2;
    identifier s.E;
    @@
    + const
    struct I2 E[] = ...;
    //

    Signed-off-by: Márton Németh
    Signed-off-by: Richard Purdie

    Márton Németh
     
  • The ALIX2 LED driver and the CS5535 GPIO drivers share the same I/O
    range which causes a conflict if they're both enabled. Fix this for now
    by adding Kconfig dependencies. While at it, also drop the EXPERIMENTAL
    flag, as the code has been around for awhile already.

    Note that this is a hack. At some point, a real platform support for
    this board should be added which handles the LEDs via the leds-gpio
    driver.

    Signed-off-by: Daniel Mack
    Signed-off-by: Richard Purdie

    Daniel Mack
     

08 Mar, 2010

1 commit


17 Dec, 2009

6 commits


16 Dec, 2009

6 commits

  • Signed-off-by: Michael Hennerich
    Signed-off-by: Bryan Wu
    Signed-off-by: Mike Frysinger
    Signed-off-by: Richard Purdie

    Michael Hennerich
     
  • The LT3593 is a step-up DC/DC converter designed to drive up to ten
    white LEDs in series. The current flow can be set with a control pin.

    This driver controls any number of such devices connected on generic
    GPIOs and exports the function as as platform_driver.

    The gpio_led platform data struct definition is reused for this purpose.

    Successfully tested on a PXA embedded board.

    Signed-off-by: Daniel Mack
    Signed-off-by: Richard Purdie

    Daniel Mack
     
  • pci_enable_result is defined using the __must_check macro but
    leds-ss4200 is not checking the return value.

    Signed-off-by: Javier Martinez Canillas
    Signed-off-by: Dave Hansen
    Signed-off-by: Richard Purdie

    Dave Hansen
     
  • This makes the LEDs driver for ALIX2.C boards work with Coreboot by
    looking up the port address in the MSR rather than hard-coding it.

    The BIOS scan also needed some tweaks as the string in Coreboot differs
    from the one in the legacy BIOS.

    Successfully tested with both the legacy tinyBIOS as well as Coreboot
    v3.

    Signed-off-by: Daniel Mack
    Signed-off-by: Richard Purdie

    Daniel Mack
     
  • This code is based on a driver that came in the "Open-source
    and GPL components" download here:

    http://downloadcenter.intel.com/SearchResult.aspx?lang=eng&ProductFamily=Server+Products&ProductLine=Intel%C2%AE+Storage+Systems&ProductProduct=Intel%C2%AE+Entry+Storage+System+SS4200-E&OSVersion=OS+Independent

    It was in a file called nasgpio.c inside of a second zip file
    called SS4200-E_Linux_SIO_Driver-v1.4.zip and is based on this
    updated to use the LED subsystem with the ioctl and hardware
    monitor support removed.

    I don't have any need for brightness
    control, and its code is *completely* separate from the on/off
    controls implemented here. If anyone else wants it, I'd be
    happy to look into adding it, but I don't care enough for now.

    Except for the probe routines, I rewrote most of it. I also
    Note that I don't have any hardware documentation except for
    the original driver.

    Thanks go to Arjan for his help in getting the original source
    for this released and for chasing down some licensing issues.

    Signed-off-by: Dave Hansen
    Signed-off-by: Richard Purdie

    Dave Hansen
     
  • Makes use of skip_spaces() defined in lib/string.c for removing leading
    spaces from strings all over the tree.

    It decreases lib.a code size by 47 bytes and reuses the function tree-wide:
    text data bss dec hex filename
    64688 584 592 65864 10148 (TOTALS-BEFORE)
    64641 584 592 65817 10119 (TOTALS-AFTER)

    Also, while at it, if we see (*str && isspace(*str)), we can be sure to
    remove the first condition (*str) as the second one (isspace(*str)) also
    evaluates to 0 whenever *str == 0, making it redundant. In other words,
    "a char equals zero is never a space".

    Julia Lawall tried the semantic patch (http://coccinelle.lip6.fr) below,
    and found occurrences of this pattern on 3 more files:
    drivers/leds/led-class.c
    drivers/leds/ledtrig-timer.c
    drivers/video/output.c

    @@
    expression str;
    @@

    ( // ignore skip_spaces cases
    while (*str && isspace(*str)) { \(str++;\|++str;\) }
    |
    - *str &&
    isspace(*str)
    )

    Signed-off-by: André Goddard Rosa
    Cc: Julia Lawall
    Cc: Martin Schwidefsky
    Cc: Jeff Dike
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: "H. Peter Anvin"
    Cc: Richard Purdie
    Cc: Neil Brown
    Cc: Kyle McMartin
    Cc: Henrique de Moraes Holschuh
    Cc: David Howells
    Cc:
    Cc: Samuel Ortiz
    Cc: Patrick McHardy
    Cc: Takashi Iwai
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    André Goddard Rosa
     

13 Dec, 2009

1 commit

  • * 'ixp4xx' of git://git.kernel.org/pub/scm/linux/kernel/git/chris/linux-2.6:
    IXP4xx: GTWX5715 platform only has two PCI IRQ lines, not four.
    IXP4xx: Introduce IXP4XX_GPIO_IRQ(n) macro and convert IXP4xx platform files.
    IXP4xx: move Gemtek GTWX5715 platform macros to the platform code.
    IXP4xx: Remove unused Motorola PrPMC1100 platform macros.
    IXP4xx: move FSG platform macros to the platform code.
    IXP4xx: move DSM G600 platform macros to the platform code.
    IXP4xx: move NAS100D platform macros to the platform code.
    IXP4xx: move NSLU2 platform macros to the platform code.
    IXP4xx: move Coyote platform macros to the platform code.
    IXP4xx: move AVILA platform macros to the platform code.
    IXP4xx: move IXDP425 platform macros to the platform code.
    IXP4xx: Extend PCI MMIO indirect address space to 1 GB.
    IXP4xx: Fix compilation failure with CONFIG_IXP4XX_INDIRECT_PCI.
    IXP4xx: Drop "__ixp4xx_" prefix from in/out/ioread/iowrite functions for clarity.
    IXP4xx: Rename indirect MMIO primitives from __ixp4xx_* to __indirect_*.
    IXP4xx: Ensure index is positive in irq_to_gpio() and npe_request().
    ARM: fix insl() and outsl() endianness on IXP4xx architecture.
    IXP4xx: Fix normally-disabled debugging text in drivers/net/arm/ixp4xx_eth.c.
    IXP4xx: change the timer base frequency to 66.666000 MHz.

    Linus Torvalds
     

09 Dec, 2009

1 commit

  • * 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6: (149 commits)
    arm: omap: Add omap3_defconfig
    AM35xx: Defconfig for AM3517 EVM board
    AM35xx: Add support for AM3517 EVM board
    omap: 3630sdp: defconfig creation
    omap: 3630sdp: introduce 3630 sdp board support
    omap3: Add defconfig for IGEP v2 board
    omap3: Add minimal IGEP v2 support
    omap3: Add CompuLab CM-T35 defconfig
    omap3: Add CompuLab CM-T35 board support
    omap3: rx51: Add wl1251 wlan driver support
    omap3: rx51: Add SDRAM init
    omap1: Add default kernel configuration for Herald
    omap1: Add board support and LCD for HTC Herald
    omap: zoom2: update defconfig for LL_DEBUG_NONE
    omap: zoom3: defconfig creation
    omap3: zoom: Introduce zoom3 board support
    omap3: zoom: Drop i2c-1 speed to 2400
    omap3: zoom: rename zoom2 name to generic zoom
    omap3: zoom: split board file for software reuse
    omap3evm: MIgrate to smsc911x ethernet driver
    ...

    Fix trivial conflict (two unrelated config options added next to each
    other) in arch/arm/mach-omap2/Makefile

    Linus Torvalds
     

05 Dec, 2009

1 commit


28 Nov, 2009

1 commit


23 Nov, 2009

1 commit


16 Nov, 2009

1 commit


21 Oct, 2009

1 commit

  • Move the remaining headers under plat-omap/include/mach
    to plat-omap/include/plat. Also search and replace the
    files using these headers to include using the right path.

    This was done with:

    #!/bin/bash
    mach_dir_old="arch/arm/plat-omap/include/mach"
    plat_dir_new="arch/arm/plat-omap/include/plat"
    headers=$(cd $mach_dir_old && ls *.h)
    omap_dirs="arch/arm/*omap*/ \
    drivers/video/omap \
    sound/soc/omap"
    other_files="drivers/leds/leds-ams-delta.c \
    drivers/mfd/menelaus.c \
    drivers/mfd/twl4030-core.c \
    drivers/mtd/nand/ams-delta.c"

    for header in $headers; do
    old="#include

    Tony Lindgren
     

05 Oct, 2009

1 commit


27 Sep, 2009

1 commit

  • * 'for-linus' of git://git.o-hand.com/linux-rpurdie-leds:
    leds: move leds-clevo-mail's probe function to .devinit.text
    leds: Fix indentation in LEDS_LP3944 Kconfig entry
    leds: Fix LED names
    leds: Fix leds-pca9532 whitespace issues
    leds: fix coding style in worker thread code for ledtrig-gpio.
    leds: gpio-leds: fix typographics fault
    leds: Add WM831x status LED driver

    Linus Torvalds
     

24 Sep, 2009

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
    Input: add driver for Atmel AT42QT2160 Sensor Chip
    Input: max7359 - use threaded IRQs
    Input: add driver for Maxim MAX7359 key switch controller
    Input: add driver for ADP5588 QWERTY I2C Keypad
    Input: add touchscreen driver for MELFAS MCS-5000 controller
    Input: add driver for OpenCores Keyboard Controller
    Input: dm355evm_keys - remove dm355evm_keys_hardirq
    Input: synaptics_i2c - switch to using __cancel_delayed_work()
    Input: ad7879 - add support for AD7889
    Input: atkbd - rely on input core to restore state on resume
    Input: add generic suspend and resume for input devices
    Input: libps2 - additional locking for i8042 ports

    Linus Torvalds
     

23 Sep, 2009

1 commit

  • This makes it consistent with other buses (platform, i2c, vio, ...). I'm
    not sure why we use the prefixes, but there must be a reason.

    This was easy enough to do it, and I did it.

    Signed-off-by: Anton Vorontsov
    Cc: David Brownell
    Cc: David Woodhouse
    Cc: Grant Likely
    Cc: Jean Delvare
    Cc: Ben Dooks
    Cc: Benjamin Herrenschmidt
    Cc: Dmitry Torokhov
    Cc: Samuel Ortiz
    Cc: "John W. Linville"
    Acked-by: Mike Frysinger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Anton Vorontsov
     

18 Sep, 2009

1 commit

  • The serio ports on i8042 are not completely isolated; while we provide
    enough locking to ensure proper serialization when accessing control
    and data registers AUX and KBD ports can still have an effect on each
    other on PS/2 protocol level. The most prominent effect is that
    issuing a command for the device connected to one port may cause
    abort of the command currently executing by the device connected to
    another port.

    Since i8042 nor serio subsystem are not aware of the details of the
    PS/2 protocol (length of the commands and their replies and so on) the
    locking should be done on libps2 level by adding special handling when
    we see that we are dealing with serio port on i8042.

    Signed-off-by: Dmitry Torokhov

    Dmitry Torokhov
     

07 Sep, 2009

7 commits