-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 326999 b: refs/heads/master c: 46ca681 h: refs/heads/master i: 326997: ce30684 326995: a887ec9 326991: e366bbb v: v3
- Loading branch information
Kishon Vijay Abraham I
authored and
Olof Johansson
committed
Sep 5, 2012
1 parent
218f98a
commit 470fcfd
Showing
133 changed files
with
3,479 additions
and
1,827 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: 5ddf8bad8c5ff52aae512215131f0af37176f6ea | ||
refs/heads/master: 46ca6811534e66e7b3967512efe8259021cd5488 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* arch/arm/include/asm/leds.h | ||
* | ||
* Copyright (C) 1998 Russell King | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
* | ||
* Event-driven interface for LEDs on machines | ||
* Added led_start and led_stop- Alex Holden, 28th Dec 1998. | ||
*/ | ||
#ifndef ASM_ARM_LEDS_H | ||
#define ASM_ARM_LEDS_H | ||
|
||
|
||
typedef enum { | ||
led_idle_start, | ||
led_idle_end, | ||
led_timer, | ||
led_start, | ||
led_stop, | ||
led_claim, /* override idle & timer leds */ | ||
led_release, /* restore idle & timer leds */ | ||
led_start_timer_mode, | ||
led_stop_timer_mode, | ||
led_green_on, | ||
led_green_off, | ||
led_amber_on, | ||
led_amber_off, | ||
led_red_on, | ||
led_red_off, | ||
led_blue_on, | ||
led_blue_off, | ||
/* | ||
* I want this between led_timer and led_start, but | ||
* someone has decided to export this to user space | ||
*/ | ||
led_halted | ||
} led_event_t; | ||
|
||
/* Use this routine to handle LEDs */ | ||
|
||
#ifdef CONFIG_LEDS | ||
extern void (*leds_event)(led_event_t); | ||
#else | ||
#define leds_event(e) | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
/* | ||
* LED support code, ripped out of arch/arm/kernel/time.c | ||
* | ||
* Copyright (C) 1994-2001 Russell King | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
*/ | ||
#include <linux/export.h> | ||
#include <linux/init.h> | ||
#include <linux/device.h> | ||
#include <linux/syscore_ops.h> | ||
#include <linux/string.h> | ||
|
||
#include <asm/leds.h> | ||
|
||
static void dummy_leds_event(led_event_t evt) | ||
{ | ||
} | ||
|
||
void (*leds_event)(led_event_t) = dummy_leds_event; | ||
|
||
struct leds_evt_name { | ||
const char name[8]; | ||
int on; | ||
int off; | ||
}; | ||
|
||
static const struct leds_evt_name evt_names[] = { | ||
{ "amber", led_amber_on, led_amber_off }, | ||
{ "blue", led_blue_on, led_blue_off }, | ||
{ "green", led_green_on, led_green_off }, | ||
{ "red", led_red_on, led_red_off }, | ||
}; | ||
|
||
static ssize_t leds_store(struct device *dev, | ||
struct device_attribute *attr, | ||
const char *buf, size_t size) | ||
{ | ||
int ret = -EINVAL, len = strcspn(buf, " "); | ||
|
||
if (len > 0 && buf[len] == '\0') | ||
len--; | ||
|
||
if (strncmp(buf, "claim", len) == 0) { | ||
leds_event(led_claim); | ||
ret = size; | ||
} else if (strncmp(buf, "release", len) == 0) { | ||
leds_event(led_release); | ||
ret = size; | ||
} else { | ||
int i; | ||
|
||
for (i = 0; i < ARRAY_SIZE(evt_names); i++) { | ||
if (strlen(evt_names[i].name) != len || | ||
strncmp(buf, evt_names[i].name, len) != 0) | ||
continue; | ||
if (strncmp(buf+len, " on", 3) == 0) { | ||
leds_event(evt_names[i].on); | ||
ret = size; | ||
} else if (strncmp(buf+len, " off", 4) == 0) { | ||
leds_event(evt_names[i].off); | ||
ret = size; | ||
} | ||
break; | ||
} | ||
} | ||
return ret; | ||
} | ||
|
||
static DEVICE_ATTR(event, 0200, NULL, leds_store); | ||
|
||
static struct bus_type leds_subsys = { | ||
.name = "leds", | ||
.dev_name = "leds", | ||
}; | ||
|
||
static struct device leds_device = { | ||
.id = 0, | ||
.bus = &leds_subsys, | ||
}; | ||
|
||
static int leds_suspend(void) | ||
{ | ||
leds_event(led_stop); | ||
return 0; | ||
} | ||
|
||
static void leds_resume(void) | ||
{ | ||
leds_event(led_start); | ||
} | ||
|
||
static void leds_shutdown(void) | ||
{ | ||
leds_event(led_halted); | ||
} | ||
|
||
static struct syscore_ops leds_syscore_ops = { | ||
.shutdown = leds_shutdown, | ||
.suspend = leds_suspend, | ||
.resume = leds_resume, | ||
}; | ||
|
||
static int __init leds_init(void) | ||
{ | ||
int ret; | ||
ret = subsys_system_register(&leds_subsys, NULL); | ||
if (ret == 0) | ||
ret = device_register(&leds_device); | ||
if (ret == 0) | ||
ret = device_create_file(&leds_device, &dev_attr_event); | ||
if (ret == 0) | ||
register_syscore_ops(&leds_syscore_ops); | ||
return ret; | ||
} | ||
|
||
device_initcall(leds_init); | ||
|
||
EXPORT_SYMBOL(leds_event); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.