Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
3dd6b990
Commit
3dd6b990
authored
Jun 30, 2011
by
Bryan Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ARM: mach-ebsa110: retire custom LED code
Signed-off-by:
Bryan Wu
<
bryan.wu@canonical.com
>
parent
8ee8ef29
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
34 deletions
+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
No files found.
arch/arm/mach-ebsa110/Makefile
View file @
3dd6b990
...
@@ -4,9 +4,7 @@
...
@@ -4,9 +4,7 @@
# Object file lists.
# Object file lists.
obj-y
:=
core.o io.o
obj-y
:=
core.o io.o
leds.o
obj-m
:=
obj-m
:=
obj-n
:=
obj-n
:=
obj-
:=
obj-
:=
obj-$(CONFIG_LEDS)
+=
leds.o
arch/arm/mach-ebsa110/leds.c
View file @
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
* License terms: GNU General Public License (GPL) version 2
*
* Author: Bryan Wu <bryan.wu@canonical.com>
* 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
*/
*/
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/spinlock.h>
#include <linux/init.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 <asm/mach-types.h>
#include "core.h"
#include "core.h"
static
spinlock_t
leds_lock
;
#if defined(CONFIG_NEW_LEDS) && defined(CONFIG_LEDS_CLASS)
static
void
ebsa110_led_set
(
struct
led_classdev
*
cdev
,
static
void
ebsa110_leds_event
(
led_event_t
ledevt
)
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
)
{
__raw_writeb
(
reg
,
SOFT_BASE
);
case
led_timer
:
}
*
(
volatile
unsigned
char
*
)
SOFT_BASE
^=
128
;
break
;
default:
static
enum
led_brightness
ebsa110_led_get
(
struct
led_classdev
*
cdev
)
break
;
{
}
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
;
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment