30 May, 2012

40 commits

  • As long as there is no other non-const variable marked __initdata in the
    same compilation unit it doesn't hurt. If there were one however
    compilation would fail with

    error: $variablename causes a section type conflict

    because a section containing const variables is marked read only and so
    cannot contain non-const variables.

    Signed-off-by: Uwe Kleine-König
    Cc: Alexey Dobriyan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Uwe Kleine-König
     
  • We were bitten by this at one point and added an additional sanity test
    for DEBUG_LIST. You can't validly add a list_head to a list where either
    prev or next is the same as the thing you're adding.

    Signed-off-by: Chris Metcalf
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chris Metcalf
     
  • Add sub-driver for the LEDs on National Semiconductor / TI LM3533 lighting
    power chips.

    The chip provides 256 brightness levels, hardware accelerated blinking as
    well as ambient-light-sensor and pwm input control.

    Signed-off-by: Johan Hovold
    Cc: Richard Purdie
    Cc: Rob Landley
    Cc: Samuel Ortiz
    Cc: Jonathan Cameron
    Cc: Greg Kroah-Hartman
    Cc: Florian Tobias Schandinat
    Cc: Arnd Bergmann
    Cc: Mark Brown
    Cc: Bryan Wu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Johan Hovold
     
  • When issuing the following command:

    for I in 0 1 2 3 4 5 6 7; do
    echo 0 > /sys/class/leds/pca955x\:${I}/brightness;
    done

    It is possible that all the pca955x_read_ls calls are done sequentially
    before any pca955x_write_ls call is done. This updates the LS only to
    the last LED update in its set.

    Fix this by using a global lock for the pca995x device during
    pca955x_led_work. Also used a struct for shared data betreen all LEDs.

    [akpm@linux-foundation.org: revert unintentional rename of pca955x_ledsel()]
    Signed-off-by: Alexander Stein
    Cc: Richard Purdie
    Cc: Bryan Wu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Stein
     
  • The leds timer trigger does not currently have an interface to activate a
    one shot timer. The current support allows for setting two timers, one
    for specifying how long a state to be on, and the second for how long the
    state to be off. The delay_on value specifies the time period an LED
    should stay in on state, followed by a delay_off value that specifies how
    long the LED should stay in off state. The on and off cycle repeats until
    the trigger gets deactivated. There is no provision for one time
    activation to implement features that require an on or off state to be
    held just once and then stay in the original state forever.

    Without one shot timer interface, user space can still use timer trigger
    to set a timer to hold a state, however when user space application
    crashes or goes away without deactivating the timer, the hardware will be
    left in that state permanently.

    As a specific example of this use-case, let's look at vibrate feature on
    phones. Vibrate function on phones is implemented using PWM pins on SoC
    or PMIC. There is a need to activate one shot timer to control the
    vibrate feature, to prevent user space crashes leaving the phone in
    vibrate mode permanently causing the battery to drain.

    This trigger exports three properties, activate, state, and duration When
    transient trigger is activated these properties are set to default values.

    - duration allows setting timer value in msecs. The initial value is 0.
    - activate allows activating and deactivating the timer specified by
    duration as needed. The initial and default value is 0. This will allow
    duration to be set after trigger activation.
    - state allows user to specify a transient state to be held for the specified
    duration.

    Signed-off-by: Shuah Khan
    Cc: Jonas Bonn
    Cc: Richard Purdie
    Cc: NeilBrown
    Cc: Bryan Wu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Shuah Khan
     
  • A halted kernel should not show a heartbeat.

    [akpm@linux-foundation.org: checkpatch fixes]
    Signed-off-by: Alexander Holler
    Cc: Shuah Khan
    Cc: Richard Purdie
    Cc: Bryan Wu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Holler
     
  • For better code readability, ALS code is moved to new a function -
    lm3530_als_configure()

    Signed-off-by: Milo(Woogyom) Kim
    Acked-by: Linus Walleij
    Cc: Shreshtha Kumar SAHU
    Cc: Richard Purdie
    Cc: Bryan Wu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kim, Milo
     
  • max brightness is 127, so the range of brt_val should be from 0 to 127

    Signed-off-by: Milo(Woogyom) Kim
    Acked-by: Linus Walleij
    Cc: Shreshtha Kumar SAHU
    Cc: Richard Purdie
    Cc: Bryan Wu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kim, Milo
     
  • Change existing timer trigger to use the new ->activated flag to set
    activate successful status in activate routine and check it in deactivate
    routine to do cleanup.

    Signed-off-by: Shuah Khan
    Cc: Richard Purdie
    Cc: Bryan Wu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Shuah Khan
     
  • Change existing triggers backlight, gpio, and heartbeat to use the new
    ->activated flag to set activate successful status in their activate
    routines and check it in their deactivate routines to do cleanup.

    Signed-off-by: Shuah Khan
    Cc: Richard Purdie
    Cc: Bryan Wu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Shuah Khan
     
  • Add a new field to led_classdev to save activattion state after activate
    routine is successful. This saved state is used in deactivate routine to
    do cleanup such as removing device files, and free memory allocated during
    activation. Currently trigger_data not being null is used for this
    purpose.

    Existing triggers will need changes to use this new field.

    Signed-off-by: Shuah Khan
    Cc: Richard Purdie
    Cc: Bryan Wu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Shuah Khan
     
  • The advantage of kcalloc is that will prevent integer overflows which
    could result from the multiplication of number of elements and size and it
    is also a bit nicer to read.

    The semantic patch that makes this change is available
    in https://lkml.org/lkml/2011/11/25/107

    Signed-off-by: Thomas Meyer
    Cc: Bryan Wu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Thomas Meyer
     
  • led-class.c and ledtrig-timer.c still use simple_strtoul(). Change them
    to use kstrtoul() instead of obsolete simple_strtoul().

    Also fix the existing int ret declaration to be ssize_t to match the
    return type for _store functions in ledtrig-timer.c.

    Signed-off-by: Shuah Khan
    Cc: Joe Perches
    Cc: Richard Purdie
    Cc: Bryan Wu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Shuah Khan
     
  • LED Driver for Dialog Semiconductor DA9052/53 PMICs.

    [akpm@linux-foundation.org: make led_reg static]
    Signed-off-by: David Dajun Chen
    Signed-off-by: Ashish Jangam
    Reviewed-by: Lars-Peter Clausen
    Cc: Richard Purdie
    Cc: Bryan Wu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Dajun Chen
     
  • Gcc 4.6.2 complains that:

    drivers/leds/leds-lp5521.c: In function `lp5521_load_program':
    drivers/leds/leds-lp5521.c:214:21: warning: `mode' may be used uninitialized in this function [-Wuninitialized]
    drivers/leds/leds-lp5521.c: In function `lp5521_probe':
    drivers/leds/leds-lp5521.c:788:5: warning: `buf' may be used uninitialized in this function [-Wuninitialized]
    drivers/leds/leds-lp5521.c:740:6: warning: `ret' may be used uninitialized in this function [-Wuninitialized]

    These are real problems if lp5521_read() returns an error. When that
    happens we should handle it, instead of ignoring it or doing a bitwise
    OR with all the other error codes and continuing.

    Signed-off-by: Dan Carpenter
    Cc: Milo
    Cc: Richard Purdie
    Cc: Bryan Wu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dan Carpenter
     
  • The devm_ functions allocate memory that is released when a driver
    detaches. This patch uses devm_kzalloc of these functions.

    Signed-off-by: Jingoo Han
    Cc: Dmitry Baryshkov
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jingoo Han
     
  • The devm_ functions allocate memory that is released when a driver
    detaches. This patch uses devm_kzalloc of these functions.

    Signed-off-by: Jingoo Han
    Cc: Dmitry Baryshkov
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jingoo Han
     
  • The devm_ functions allocate memory that is released when a driver
    detaches. This patch uses devm_kzalloc of these functions.

    Signed-off-by: Jingoo Han
    Cc: Eric Miao
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jingoo Han
     
  • The devm_ functions allocate memory that is released when a driver
    detaches. This patch uses devm_kzalloc of these functions.

    Signed-off-by: Jingoo Han
    Cc: InKi Dae
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jingoo Han
     
  • The devm_ functions allocate memory that is released when a driver
    detaches. This patch uses devm_kzalloc of these functions.

    Signed-off-by: Jingoo Han
    Cc: Haavard Skinnemoen
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jingoo Han
     
  • The devm_ functions allocate memory that is released when a driver
    detaches. This patch uses devm_kzalloc of these functions.

    Signed-off-by: Jingoo Han
    Acked-by: Marek Vasut
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jingoo Han
     
  • The devm_ functions allocate memory that is released when a driver
    detaches. This patch uses devm_kzalloc of these functions.

    Signed-off-by: Jingoo Han
    Cc: Donghwa Lee
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jingoo Han
     
  • The devm_ functions allocate memory that is released when a driver
    detaches. This patch uses devm_kzalloc of these functions.

    Signed-off-by: Jingoo Han
    Cc: Alberto Panizzo
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jingoo Han
     
  • The devm_ functions allocate memory that is released when a driver
    detaches. This patch uses devm_kzalloc of these functions.

    Signed-off-by: Jingoo Han
    Cc: Ben Dooks
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jingoo Han
     
  • The devm_ functions allocate memory that is released when a driver
    detaches. This patch uses devm_kzalloc of these functions.

    Signed-off-by: Jingoo Han
    Cc: Eric Miao
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jingoo Han
     
  • The devm_ functions allocate memory that is released when a driver
    detaches. This patch uses devm_kzalloc of these functions.

    Signed-off-by: Jingoo Han
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jingoo Han
     
  • The devm_ functions allocate memory that is released when a driver
    detaches. This patch uses devm_kzalloc of these functions.

    Signed-off-by: Jingoo Han
    Acked-by: Michael Hennerich
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jingoo Han
     
  • The devm_ functions allocate memory that is released when a driver
    detaches. This patch uses devm_kzalloc of these functions.

    Signed-off-by: Jingoo Han
    Acked-by: Michael Hennerich
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jingoo Han
     
  • In all these files, the .power field was never correctly initialized.

    Signed-off-by: Corentin Chary
    Cc: Jingoo Han
    Cc: Dave Airlie
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Corentin Chary
     
  • This driver uses pr_debug(), so provide it with the appropriate prefixing.

    Signed-off-by: Jingoo Han
    Cc: Alberto Panizzo
    Cc: Richard Purdie
    Cc: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jingoo Han
     
  • Use pr_err() instead of printk() to allow dynamic debugging. The pr_fmt
    prefix for pr_ macros is used. Also fix checkpatch warnings as below:

    WARNING: printk() should include KERN_ facility level

    [akpm@linux-foundation.org: use KBUILD_MODNAME, per Joe]
    Signed-off-by: Jingoo Han
    Cc: Marcin Juszkiewicz
    Cc: Richard Purdie
    Cc: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jingoo Han
     
  • Use pr_info() instead of printk() to allow dynamic debugging. The pr_fmt
    prefix for pr_ macros is used. Also fix checkpatch warning as below:

    WARNING: Prefer pr_info(... to printk(KERN_INFO, ...

    [akpm@linux-foundation.org: use KBUILD_MODNAME, per Joe]
    Signed-off-by: Jingoo Han
    Cc: Andrzej Zaborowski
    Cc: Richard Purdie
    Cc: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jingoo Han
     
  • Use pr_err()/pr_info() instead of printk() to allow dynamic debugging.
    The pr_fmt prefix for pr_ macros is used. Also fix checkpatch warnings as
    below:

    WARNING: Prefer pr_err(... to printk(KERN_ERR, ...
    WARNING: Prefer pr_info(... to printk(KERN_INFO, ...

    [akpm@linux-foundation.org: use KBUILD_MODNAME, per Joe]
    Signed-off-by: Jingoo Han
    Acked-by: Kristoffer Ericson
    Cc: Richard Purdie
    Cc: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jingoo Han
     
  • Use pr_info() instead of printk() to allow dynamic debugging. The pr_fmt
    prefix for pr_ macros is used. Also fix checkpatch warnings as below:

    WARNING: printk() should include KERN_ facility level

    [akpm@linux-foundation.org: use KBUILD_MODNAME, per Joe]
    Signed-off-by: Jingoo Han
    Cc: Richard Purdie
    Cc: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jingoo Han
     
  • Use pr_err()/pr_info() instead of printk() to allow dynamic debugging.
    The pr_fmt prefix for pr_ macros is used. Also fix checkpatch warnings as
    below:

    WARNING: printk() should include KERN_ facility level
    WARNING: Prefer pr_err(... to printk(KERN_ERR, ...

    [akpm@linux-foundation.org: use KBUILD_MODNAME, per Joe]
    Signed-off-by: Jingoo Han
    Cc: Richard Purdie
    Cc: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jingoo Han
     
  • Use pr_debug()/pr_err() instead of printk() to allow dynamic debugging.
    The pr_fmt prefix for pr_ macros is used. Also fix checkpatch warnings as
    below:

    WARNING: Prefer pr_debug(... to printk(KERN_DEBUG, ...
    WARNING: Prefer pr_err(... to printk(KERN_ERR, ...

    [akpm@linux-foundation.org: use KBUILD_MODNAME, per Joe]
    Signed-off-by: Jingoo Han
    Cc: Matthew Garrett
    Cc: Richard Purdie
    Cc: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jingoo Han
     
  • Use pr_warn() and pr_debug() instead of printk to allow dynamic debugging.
    The pr_fmt prefix for pr_ macros is used. Also fix checkpatch warnings
    as below:

    WARNING: Prefer pr_warn(... to printk(KERN_WARNING, ...

    [akpm@linux-foundation.org: use KBUILD_MODNAME, per Joe]
    Signed-off-by: Jingoo Han
    Cc: Richard Purdie
    Cc: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jingoo Han
     
  • The usage of strict_strtoul() is not preferred. Thus, kstrtoul
    should be used.

    Signed-off-by: Jingoo Han
    Cc: Michael Hennerich
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jingoo Han
     
  • The usage of strict_strtoul() is not preferred. Thus, kstrtoul
    should be used.

    Signed-off-by: Jingoo Han
    Cc: Michael Hennerich
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jingoo Han
     
  • The usage of strict_strtoul() is not preferred. Thus, kstrtoul should be
    used.

    Signed-off-by: Jingoo Han
    Cc: Michael Hennerich
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jingoo Han