Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
3dd6b990
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
161
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
3dd6b990
编写于
6月 30, 2011
作者:
B
Bryan Wu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ARM: mach-ebsa110: retire custom LED code
Signed-off-by:
N
Bryan Wu
<
bryan.wu@canonical.com
>
上级
8ee8ef29
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
51 addition
and
34 deletion
+51
-34
arch/arm/mach-ebsa110/Makefile
arch/arm/mach-ebsa110/Makefile
+1
-3
arch/arm/mach-ebsa110/leds.c
arch/arm/mach-ebsa110/leds.c
+50
-31
未找到文件。
arch/arm/mach-ebsa110/Makefile
浏览文件 @
3dd6b990
...
...
@@ -4,9 +4,7 @@
# Object file lists.
obj-y
:=
core.o io.o
obj-y
:=
core.o io.o
leds.o
obj-m
:=
obj-n
:=
obj-
:=
obj-$(CONFIG_LEDS)
+=
leds.o
arch/arm/mach-ebsa110/leds.c
浏览文件 @
3dd6b990
/*
* linux/arch/arm/mach-ebsa110/leds.c
* Driver for the LED found on the EBSA110 machine
* Based on Versatile and RealView machine LED code
*
* 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.
*
* EBSA-110 LED control routines. We use the led as follows:
*
* - Red - toggles state every 50 timer interrupts
* License terms: GNU General Public License (GPL) version 2
* Author: Bryan Wu <bryan.wu@canonical.com>
*/
#include <linux/module.h>
#include <linux/spinlock.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/slab.h>
#include <linux/leds.h>
#include <mach/hardware.h>
#include <asm/leds.h>
#include <asm/mach-types.h>
#include "core.h"
static
spinlock_t
leds_lock
;
static
void
ebsa110_leds_event
(
led_event_t
ledevt
)
#if defined(CONFIG_NEW_LEDS) && defined(CONFIG_LEDS_CLASS)
static
void
ebsa110_led_set
(
struct
led_classdev
*
cdev
,
enum
led_brightness
b
)
{
u
nsigned
long
flags
;
u
8
reg
=
__raw_readb
(
SOFT_BASE
)
;
spin_lock_irqsave
(
&
leds_lock
,
flags
);
if
(
b
!=
LED_OFF
)
reg
|=
0x80
;
else
reg
&=
~
0x80
;
switch
(
ledevt
)
{
case
led_timer
:
*
(
volatile
unsigned
char
*
)
SOFT_BASE
^=
128
;
break
;
__raw_writeb
(
reg
,
SOFT_BASE
);
}
default:
break
;
}
static
enum
led_brightness
ebsa110_led_get
(
struct
led_classdev
*
cdev
)
{
u8
reg
=
__raw_readb
(
SOFT_BASE
);
spin_unlock_irqrestore
(
&
leds_lock
,
flags
)
;
return
(
reg
&
0x80
)
?
LED_FULL
:
LED_OFF
;
}
static
int
__init
leds_init
(
void
)
static
int
__init
ebsa110_
leds_init
(
void
)
{
if
(
machine_is_ebsa110
())
leds_event
=
ebsa110_leds_event
;
struct
led_classdev
*
cdev
;
int
ret
;
if
(
!
machine_is_ebsa110
())
return
-
ENODEV
;
cdev
=
kzalloc
(
sizeof
(
*
cdev
),
GFP_KERNEL
);
if
(
!
cdev
)
return
-
ENOMEM
;
cdev
->
name
=
"ebsa110:0"
;
cdev
->
brightness_set
=
ebsa110_led_set
;
cdev
->
brightness_get
=
ebsa110_led_get
;
cdev
->
default_trigger
=
"heartbeat"
;
ret
=
led_classdev_register
(
NULL
,
cdev
);
if
(
ret
<
0
)
{
kfree
(
cdev
);
return
ret
;
}
return
0
;
}
__initcall
(
leds_init
);
/*
* Since we may have triggers on any subsystem, defer registration
* until after subsystem_init.
*/
fs_initcall
(
ebsa110_leds_init
);
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录