Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
led-core.c File Reference
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/module.h>
#include <linux/rwsem.h>
#include <linux/leds.h>
#include "leds.h"

Go to the source code of this file.

Functions

 DECLARE_RWSEM (leds_list_lock)
 
 EXPORT_SYMBOL_GPL (leds_list_lock)
 
 LIST_HEAD (leds_list)
 
 EXPORT_SYMBOL_GPL (leds_list)
 
void led_blink_set (struct led_classdev *led_cdev, unsigned long *delay_on, unsigned long *delay_off)
 
 EXPORT_SYMBOL (led_blink_set)
 
void led_blink_set_oneshot (struct led_classdev *led_cdev, unsigned long *delay_on, unsigned long *delay_off, int invert)
 
 EXPORT_SYMBOL (led_blink_set_oneshot)
 
void led_stop_software_blink (struct led_classdev *led_cdev)
 
 EXPORT_SYMBOL_GPL (led_stop_software_blink)
 
void led_set_brightness (struct led_classdev *led_cdev, enum led_brightness brightness)
 
 EXPORT_SYMBOL (led_set_brightness)
 

Function Documentation

DECLARE_RWSEM ( leds_list_lock  )
EXPORT_SYMBOL ( led_blink_set  )
EXPORT_SYMBOL ( led_blink_set_oneshot  )
EXPORT_SYMBOL ( led_set_brightness  )
EXPORT_SYMBOL_GPL ( leds_list_lock  )
EXPORT_SYMBOL_GPL ( leds_list  )
EXPORT_SYMBOL_GPL ( led_stop_software_blink  )
void led_blink_set ( struct led_classdev led_cdev,
unsigned long delay_on,
unsigned long delay_off 
)

led_blink_set - set blinking with software fallback : the LED to start blinking : the time it should be on (in ms) : the time it should ble off (in ms)

This function makes the LED blink, attempting to use the hardware acceleration if possible, but falling back to software blinking if there is no hardware blinking or if the LED refuses the passed values.

Note that if software blinking is active, simply calling led_cdev->brightness_set() will not stop the blinking, use led_classdev_brightness_set() instead.

Definition at line 72 of file led-core.c.

void led_blink_set_oneshot ( struct led_classdev led_cdev,
unsigned long delay_on,
unsigned long delay_off,
int  invert 
)

led_blink_set_oneshot - do a oneshot software blink : the LED to start blinking : the time it should be on (in ms) : the time it should ble off (in ms) : blink off, then on, leaving the led on

This function makes the LED blink one time for delay_on + delay_off time, ignoring the request if another one-shot blink is already in progress.

If invert is set, led blinks for delay_off first, then for delay_on and leave the led on after the on-off cycle.

Definition at line 85 of file led-core.c.

void led_set_brightness ( struct led_classdev led_cdev,
enum led_brightness  brightness 
)

led_set_brightness - set LED brightness : the LED to set : the brightness to set it to

Set an LED's brightness, and, if necessary, cancel the software blink timer that implements blinking when the hardware doesn't.

Definition at line 114 of file led-core.c.

void led_stop_software_blink ( struct led_classdev led_cdev)

Definition at line 106 of file led-core.c.

LIST_HEAD ( leds_list  )