Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
07f4f047
Commit
07f4f047
authored
Feb 09, 2006
by
Juha Yrjola
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CBUS: Convert Retu power button driver to use input_allocate_device()
parent
45d102b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
drivers/cbus/retu-pwrbutton.c
drivers/cbus/retu-pwrbutton.c
+11
-7
No files found.
drivers/cbus/retu-pwrbutton.c
View file @
07f4f047
...
...
@@ -41,7 +41,7 @@
#define PWRBTN_PRESSED 1
static
int
pwrbtn_state
;
static
struct
input_dev
pwrbtn_dev
;
static
struct
input_dev
*
pwrbtn_dev
;
static
struct
timer_list
pwrbtn_timer
;
static
void
retubutton_timer_func
(
unsigned
long
arg
)
...
...
@@ -54,7 +54,7 @@ static void retubutton_timer_func(unsigned long arg)
state
=
PWRBTN_PRESSED
;
if
(
pwrbtn_state
!=
state
)
{
input_report_key
(
&
pwrbtn_dev
,
KEY_POWER
,
state
);
input_report_key
(
pwrbtn_dev
,
KEY_POWER
,
state
);
pwrbtn_state
=
state
;
}
}
...
...
@@ -89,11 +89,15 @@ static int __init retubutton_init(void)
return
-
EBUSY
;
}
pwrbtn_dev
.
evbit
[
0
]
=
BIT
(
EV_KEY
);
pwrbtn_dev
.
keybit
[
LONG
(
KEY_POWER
)]
=
BIT
(
KEY_POWER
);
pwrbtn_dev
.
name
=
"retu-pwrbutton"
;
pwrbtn_dev
=
input_allocate_device
();
if
(
!
pwrbtn_dev
)
return
-
ENOMEM
;
pwrbtn_dev
->
evbit
[
0
]
=
BIT
(
EV_KEY
);
pwrbtn_dev
->
keybit
[
LONG
(
KEY_POWER
)]
=
BIT
(
KEY_POWER
);
pwrbtn_dev
->
name
=
"retu-pwrbutton"
;
input_register_device
(
&
pwrbtn_dev
);
input_register_device
(
pwrbtn_dev
);
return
0
;
}
...
...
@@ -105,7 +109,7 @@ static void __exit retubutton_exit(void)
{
retu_free_irq
(
RETU_INT_PWR
);
del_timer_sync
(
&
pwrbtn_timer
);
input_unregister_device
(
&
pwrbtn_dev
);
input_unregister_device
(
pwrbtn_dev
);
}
module_init
(
retubutton_init
);
...
...
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