Commit Graph

417 Commits (a44cdd2c1a527a08069d9635a9e8e1a2e9473e98)

Author SHA1 Message Date
Bryan Wu a44cdd2c1a leds: convert Freescale MC13783 LED driver to devm_kzalloc() and cleanup error exit path
Cc: Philippe Retornaz <philippe.retornaz@epfl.ch>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:39 +08:00
Bryan Wu bcbf01624f leds: convert ADP5520 LED driver to devm_kzalloc() and cleanup error exit path
Cc: Michael Hennerich <hennerich@blackfin.uclinux.org>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:39 +08:00
Bryan Wu 73759f6ab3 leds: convert PCA955x LED driver to devm_kzalloc() and cleanup error exit path
Cc: Nate Case <ncase@xes-inc.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:39 +08:00
Bryan Wu 234699a8f3 leds: convert Sun Fire LED driver to devm_kzalloc() and cleanup error exit path
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:39 +08:00
Bryan Wu 0f4630c90b leds: convert PCA9532 LED driver to devm_kzalloc()
Cc: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:39 +08:00
Bryan Wu 0a8d9d4a61 leds: convert LT3593 LED driver to devm_kzalloc()
Cc: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:38 +08:00
Bryan Wu bfe4c04193 leds: convert Renesas TPU LED driver to devm_kzalloc() and cleanup error exit path
Cc: Magnus Damm <damm@opensource.se>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:38 +08:00
Bryan Wu 94ca4bccac leds: convert LP5523 LED driver to devm_kzalloc() and cleanup error exit path
Cc: Mathias Nyman <mathias.nyman@nokia.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:38 +08:00
Bryan Wu 983ce8840c leds: convert PCA9633 LED driver to devm_kzalloc()
Cc: Peter Meerwald <p.meerwald@bct-electronic.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:38 +08:00
Bryan Wu ac63ff50ad leds: convert BD2802 RGB LED driver to devm_kzalloc() and cleanup error exit path
Cc: Kim Kyuwon <q1.kim@samsung.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:38 +08:00
Bryan Wu e430dc003f leds: convert LP5521 LED driver to devm_kzalloc() and cleanup error exit path
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:37 +08:00
Bryan Wu bad1c898e8 leds: convert DA9030/DA9034 LED driver to devm_kzalloc() and cleanup error exit path
Cc: Eric Miao <eric.miao@canonical.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:37 +08:00
Bryan Wu 9813d74fa5 leds: convert LP3944 LED driver to devm_kzalloc()
Cc: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:37 +08:00
Bryan Wu 4aad381f0d leds: convert Atmel PWM LED driver to devm_kzalloc()
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:37 +08:00
Bryan Wu 60a0aadbf8 leds: convert HTC ASIC3 LED driver to devm_kzalloc() and cleanup error exit path
Cc: Paul Parsons <lost.distance@yahoo.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:37 +08:00
Bryan Wu 8095c385aa leds: convert Big Networks LED driver to devm_kzalloc()
Cc: Simon Guinot <sguinot@lacie.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:37 +08:00
Sachin Kamat 198b861131 leds: Use devm_kzalloc in leds-gpio.c file
devm_kzalloc() makes cleanup simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:36 +08:00
Sachin Kamat 7f13bbf799 leds: Use devm_kzalloc in leds-max8997.c file
devm_kzalloc() makes code cleanup simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:36 +08:00
Sachin Kamat d41589658e leds: Use devm_kzalloc in leds-regulator.c file
devm_kzalloc() makes cleanup simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:36 +08:00
Sachin Kamat 0b7da746cc leds: Use devm_kzalloc in leds-pwm.c file
devm_kzalloc() makes cleanup simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:36 +08:00
Sachin Kamat 7fafefb86e leds: Use module_platform_driver() in leds-max8997.c file
module_platform_driver() makes the code simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:36 +08:00
Peter Meerwald 2e9117672d leds: convert tca6507 driver to module_i2c_driver()
Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
Cc: NeilBrown <neilb@suse.de>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:36 +08:00
Sylwester Nawrocki 7d84f66f22 leds: Convert S3C24XX LED driver to gpiolib API
The s3c2410_gpio* calls are obsolete and have been scheduled for
removal since several kernel releases. Remove them and use common
gpiolib API instead.
This patch also adds gpio_request/gpio_free call for API corectness.

It is a prerequisite for removal of the S3C24XX SoC specific
arch/arm/plat-samsung/include/gpio-fns.h header.

Tested on Micro2440-SDK.

Cc: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:36 +08:00
Sylwester Nawrocki 7e97b58133 leds: Convert S3C24XX LED driver to devm_kzalloc()
Use the device managed resource API for simplifying
the error/driver remove paths.

Cc: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:36 +08:00
Devendra Naga 317dfb148d leds-mc13783: set platform data to NULL at mc13783_led_remove
the platform_set_drvdata (pdev, NULL) to be set at the remove of the
driver, as we have set the platform data to led at probe.

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:35 +08:00
Devendra Naga b523cfe61b leds-88pm860x: use devm_kzalloc function
Using devm_kzalloc will remove all the error checks and the frees are automatically done at the driver unload side.

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:35 +08:00
Dan Carpenter 5391dd0a9d leds-lp5523: BUG() in error handling in probe()
Inside the error handling in lp5523_init_led(), there is a place that
calls to led_classdev_unregister().  When we unregister the LED drivers,
it tries to set the brightness to OFF.  In this driver setting the
brightness is done through a work queue and the work queue hasn't been
initialized yet.

The result is that we trigger a WARN_ON() in the __queue_work().

The fix is to move the INIT_WORK() in front of the call to
lp5523_init_led().

Matt Renzelmann found this using a bug finding tool.

Reported-by: Matt Renzelmann <mjr@cs.wisc.edu>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:35 +08:00
G.Shark Jeong 32abb4788d leds: Add LED driver for lm3556 chip
LM3556 :
The LM3556 is a 4 MHz fixed-frequency synchronous boost
converter plus 1.5A constant current driver for a high-current white LED.
Datasheet: www.national.com/ds/LM/LM3556.pdf

Tested on OMAP4430

(bryan.wu@canonical.com: use module_i2c_driver() rather than
lm3556_init/lm3556_exit for code simplicity; fixed some typo
pointed out by Rob Landley)

Signed-off-by: G.Shark Jeong <gshark.jeong@gmail.com>
Reviewed-by: Axel Lin <axel.lin@gmail.com>
Reviewed-by: Kim, Milo <Milo.Kim@ti.com>
Acked-by: Rob Landley <rob@landley.net>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:35 +08:00
Devendra Naga 1522d02e27 leds: [trivial]Remove unnecesary return
the ret is got the status returned by the
led_classdev_register, returning ret if the
led_classdev_register fails and returning 0
if the led_classdev_register success, can be done
by doing just "return ret" at the end.

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:35 +08:00
Bryan Wu 20c0e6b878 leds: fix sparse warnings due to missing static
drivers/leds/led-core.c:56:6: sparse: symbol 'led_blink_setup' was not declared. Should it be static?
drivers/leds/led-triggers.c:233:6: sparse: symbol 'led_trigger_blink_setup' was not declared. Should it be static?

Reported-by: Fengguang Wu <wfg@linux.intel.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:35 +08:00
Jesper Dangaard Brouer dff67758c1 leds: correct trivial type in drivers/leds/Kconfig
Correct "hadrware" to "hardware", for LEDS_TRIGGER_TRANSIENT.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:35 +08:00
Fabio Baltieri a0193cbee0 leds: use led_set_brightness in led_trigger_event
Fix led_trigger_event() to use led_set_brightness() instead of
__led_set_brightness(), so that any pending blink timer is stopped before
setting the new brightness value.  Without this fix LED status may be
overridden by a pending timer.

This allows a trigger to use a mix of led_trigger_event(),
led_trigger_blink() and led_trigger_blink_oneshot() without races.

(applied over: leds: Rename led_brightness_set() to led_set_brightness())

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
Cc: Shuah Khan <shuahkhan@gmail.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:34 +08:00
Shuah Khan 19cd67e2d5 leds: Rename led_brightness_set() to led_set_brightness()
Rename leds external interface led_brightness_set() to led_set_brightness().
This is the second phase of the change to reduce confusion between the
leds internal and external interfaces that set brightness. With this change,
now the external interface is led_set_brightness(). The first phase renamed
the internal interface led_set_brightness() to __led_set_brightness().
There are no changes to the interface implementations.

Signed-off-by: Shuah Khan <shuahkhan@gmail.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:34 +08:00
Shuah Khan 0da3e65ba8 leds: Rename led_set_brightness() to __led_set_brightness()
Rename leds internal interface led_set_brightness() to __led_set_brightness()
to reduce confusion between led_set_brightness() and the external interface
led_brightness_set(). led_brightness_set() cancels the timer and then calls
led_set_brightness().

Signed-off-by: Shuah Khan <shuahkhan@gmail.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:34 +08:00
Fabio Baltieri 5e417281cd leds: add oneshot trigger
Add oneshot trigger to blink a led with configurale parameters via
sysfs.

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
Cc: Shuah Khan <shuahkhan@gmail.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:34 +08:00
Fabio Baltieri 437864828d leds: fix led_brightness_set when soft-blinking
Move led_stop_software_blink() code into led_brightness_set() to ensure
software blink timer is stopped and cleared when changing trigger.

Also use led_set_brightness() instead of calling
led_cdev->brightness_set() directly to keep led_cdev->brightness
consistent with current LED status.

This ensure proper cleaning when changing triggers, as without this fix
a LED may be turned off while leaving it's led_cdev->brightness = 1,
leading to an erratic software-blink behaviour.

The problem was easy to reproduce by changing the trigger from "timer"
to "oneshot".

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:34 +08:00
Fabio Baltieri 3740e49c66 ledtrig-ide-disk: use generic one-shot blink api
Convert ledtrig-ide-disk code to use the generic API for one-shot LED
blinking.

This patch changes slightly the behaviour of the trigger, as while the
original version kept the LED on under heavy activity, the new one keeps
a constant on-off blink at 1 / (2 * BLINK_DELAY) Hz.

(bryan.wu@canonical.com: remove 2 useless included header files)

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:34 +08:00
Fabio Baltieri 5bb629c504 leds: add oneshot blink functions
Add two new functions, led_blink_set_oneshot and
led_trigger_blink_oneshot, to be used by triggers for one-shot blink of
led devices.

This is implemented extending the existing software-blink code, and uses
the same timer and handler function.

The behavior of the code is to do a blink-on, blink-off sequence when
the function is called, ignoring other calls until the sequence is
completed so that the leds keep blinking at constant rate if the
functions are called repeatedly.

This is meant to be used by drivers which needs to trigger on sporadic
event, but doesn't have clear busy/idle trigger points.

After the blink sequence the led remains off. This behavior can be
inverted setting the "invert" argument, which blink the led off, than on
and leave the led on after the sequence.

(bryan.wu@canonical.com: rebase to commit 'leds: don't disable blinking
when writing the same value to delay_on or delay_off')

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
Acked-by: Shuah Khan <shuahkhan@gmail.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:34 +08:00
Bryan Wu eb202621f8 led-triggers: rename *trigger to *trig for unified naming scheme
No functional change.

Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-24 07:52:33 +08:00
Alexander Holler fb31fbeb64 leds: heartbeat: fix bug on panic
With commit 49dca5aebf I introduced
a bug (visible if CONFIG_PROVE_RCU is enabled) which occures when a panic
has happened:

[ 1526.520230] ===============================
[ 1526.520230] [ INFO: suspicious RCU usage. ]
[ 1526.520230] 3.5.0-rc1+ #12 Not tainted
[ 1526.520230] -------------------------------
[ 1526.520230] /c/kernel-tests/mm/include/linux/rcupdate.h:436 Illegal context switch in RCU read-side critical section!
[ 1526.520230]
[ 1526.520230] other info that might help us debug this:
[ 1526.520230]
[ 1526.520230]
[ 1526.520230] rcu_scheduler_active = 1, debug_locks = 0
[ 1526.520230] 3 locks held by net.agent/3279:
[ 1526.520230]  #0:  (&mm->mmap_sem){++++++}, at: [<ffffffff82f85962>] do_page_fault+0x193/0x390
[ 1526.520230]  #1:  (panic_lock){+.+...}, at: [<ffffffff82ed2830>] panic+0x37/0x1d3
[ 1526.520230]  #2:  (rcu_read_lock){.+.+..}, at: [<ffffffff810b9b28>] rcu_lock_acquire+0x0/0x29
[ 1526.520230]
[ 1526.520230] stack backtrace:
[ 1526.520230] Pid: 3279, comm: net.agent Not tainted 3.5.0-rc1+ #12
[ 1526.520230] Call Trace:
[ 1526.520230]  [<ffffffff810e1570>] lockdep_rcu_suspicious+0x109/0x112
[ 1526.520230]  [<ffffffff810bfe3a>] rcu_preempt_sleep_check+0x45/0x47
[ 1526.520230]  [<ffffffff810bfe5a>] __might_sleep+0x1e/0x19a
[ 1526.520230]  [<ffffffff82f8010e>] down_write+0x26/0x81
[ 1526.520230]  [<ffffffff8276a966>] led_trigger_unregister+0x1f/0x9c
[ 1526.520230]  [<ffffffff8276def5>] heartbeat_reboot_notifier+0x15/0x19
[ 1526.520230]  [<ffffffff82f85bf5>] notifier_call_chain+0x96/0xcd
[ 1526.520230]  [<ffffffff82f85cba>] __atomic_notifier_call_chain+0x8e/0xff
[ 1526.520230]  [<ffffffff81094b7c>] ? kmsg_dump+0x37/0x1eb
[ 1526.520230]  [<ffffffff82f85d3f>] atomic_notifier_call_chain+0x14/0x16
[ 1526.520230]  [<ffffffff82ed28e1>] panic+0xe8/0x1d3
[ 1526.520230]  [<ffffffff811473e2>] out_of_memory+0x15d/0x1d3

So in case of a panic, now just turn of the LED. Other approaches like
scheduling a work to unregister the trigger aren't working because there
isn't much which still runs after a panic occured (except timers).

Signed-off-by: Alexander Holler <holler@ahsoftware.de>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-07-04 15:55:19 +08:00
Axel Lin 9473c4c167 leds: Make LEDS_ASIC3 and LEDS_RENESAS_TPU depend on LEDS_CLASS=y
Otherwise, I got below build error when CONFIG_LEDS_CLASS=m.

  LD      init/built-in.o
drivers/built-in.o: In function `asic3_led_probe':
clkdev.c:(.devinit.text+0x4680): undefined reference to `led_classdev_register'
drivers/built-in.o: In function `r_tpu_probe':
clkdev.c:(.devinit.text+0x4838): undefined reference to `led_classdev_register'
drivers/built-in.o: In function `asic3_led_remove':
clkdev.c:(.devexit.text+0x564): undefined reference to `led_classdev_unregister'
drivers/built-in.o: In function `r_tpu_remove':
clkdev.c:(.devexit.text+0x5a0): undefined reference to `led_classdev_unregister'
make: *** [vmlinux] Error 1

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-06-12 10:56:25 +08:00
Jeffrin Jose 9cd5ec5e54 leds: fixed a coding style issue.
Fixed a coding style issue relating to trailing
white space error found by checkpatch.pl tool in drivers/leds/led-class.c

Signed-off-by: Jeffrin Jose <ahiliation@yahoo.co.in>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-06-12 10:56:24 +08:00
Rafal Prylowski 3fbd8716da leds: don't disable blinking when writing the same value to delay_on or delay_off
Function led_set_software_blink() assumes that blink timer is still running,
but commit 488bc35bf4 introduced disabling
of blink timer before each call to led_set_software_blink().

Correct led_software_blink():
1) remove protection against reprogramming blink timer to the same values,
   because it only disables blinking now,
2) remove unnecessary call to led_stop_software_blink().

Signed-off-by: Rafal Prylowski <prylowski@metasoft.pl>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-06-12 10:56:24 +08:00
Johan Hovold 401dea7f7a leds: add LM3533 LED driver
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 <jhovold@gmail.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Rob Landley <rob@landley.net>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: Jonathan Cameron <jic23@cam.ac.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Bryan Wu <bryan.wu@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-29 16:22:32 -07:00
Alexander Stein e7e11d8ba8 drivers/leds/leds-pca955x.c: fix race condition while setting brightness on several LEDs
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 <alexander.stein@systec-electronic.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Bryan Wu <bryan.wu@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-29 16:22:32 -07:00
Shuah Khan 44e1e9f8e7 leds: add new transient trigger for one shot timer activation
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 <shuahkhan@gmail.com>
Cc: Jonas Bonn <jonas@southpole.se>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: NeilBrown <neilb@suse.de>
Cc: Bryan Wu <bryan.wu@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-29 16:22:32 -07:00
Alexander Holler 49dca5aebf leds: heartbeat: stop on shutdown
A halted kernel should not show a heartbeat.

[akpm@linux-foundation.org: checkpatch fixes]
Signed-off-by: Alexander Holler <holler@ahsoftware.de>
Cc: Shuah Khan <shuahkhan@gmail.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Bryan Wu <bryan.wu@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-29 16:22:32 -07:00
Kim, Milo 6335f8fa97 drivers/leds/leds-lm3530.c: simplify als configuration on initialization
For better code readability, ALS code is moved to new a function -
lm3530_als_configure()

Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Cc: Shreshtha Kumar SAHU <shreshthakumar.sahu@stericsson.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Bryan Wu <bryan.wu@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-29 16:22:32 -07:00
Shuah Khan 1381187991 leds: change ledtrig-timer to use activated flag
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 <shuahkhan@gmail.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Bryan Wu <bryan.wu@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-29 16:22:31 -07:00
Shuah Khan 03c091e5b7 leds: change existing triggers to use activated flag
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 <shuahkhan@gmail.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Bryan Wu <bryan.wu@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-29 16:22:31 -07:00