Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci-2.6.23
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-2.6.23
Commits
22a397e2
Commit
22a397e2
authored
Nov 20, 2005
by
Dmitry Torokhov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Input: wistron - convert to dynamic input_dev allocation
Signed-off-by:
Dmitry Torokhov
<
dtor@mail.ru
>
parent
84b256a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
16 deletions
+37
-16
drivers/input/misc/wistron_btns.c
drivers/input/misc/wistron_btns.c
+37
-16
No files found.
drivers/input/misc/wistron_btns.c
View file @
22a397e2
...
@@ -149,7 +149,7 @@ err:
...
@@ -149,7 +149,7 @@ err:
return
-
ENOMEM
;
return
-
ENOMEM
;
}
}
static
void
__exit
unmap_bios
(
void
)
static
inline
void
unmap_bios
(
void
)
{
{
iounmap
(
bios_code_map_base
);
iounmap
(
bios_code_map_base
);
iounmap
(
bios_data_map_base
);
iounmap
(
bios_data_map_base
);
...
@@ -180,7 +180,7 @@ static void __init bios_attach(void)
...
@@ -180,7 +180,7 @@ static void __init bios_attach(void)
call_bios
(
&
regs
);
call_bios
(
&
regs
);
}
}
static
void
__exit
bios_detach
(
void
)
static
void
bios_detach
(
void
)
{
{
struct
regs
regs
;
struct
regs
regs
;
...
@@ -342,31 +342,43 @@ static int __init select_keymap(void)
...
@@ -342,31 +342,43 @@ static int __init select_keymap(void)
/* Input layer interface */
/* Input layer interface */
static
struct
input_dev
input_dev
=
{
static
struct
input_dev
*
input_dev
;
.
name
=
"Wistron laptop buttons"
,
};
static
void
__init
setup_input_dev
(
void
)
static
int
__init
setup_input_dev
(
void
)
{
{
const
struct
key_entry
*
key
;
const
struct
key_entry
*
key
;
int
error
;
input_dev
=
input_allocate_device
();
if
(
!
input_dev
)
return
-
ENOMEM
;
input_dev
->
name
=
"Wistron laptop buttons"
;
input_dev
->
phys
=
"wistron/input0"
;
input_dev
->
id
.
bustype
=
BUS_HOST
;
for
(
key
=
keymap
;
key
->
type
!=
KE_END
;
key
++
)
{
for
(
key
=
keymap
;
key
->
type
!=
KE_END
;
key
++
)
{
if
(
key
->
type
==
KE_KEY
)
{
if
(
key
->
type
==
KE_KEY
)
{
input_dev
.
evbit
[
LONG
(
EV_KEY
)]
=
BIT
(
EV_KEY
);
input_dev
->
evbit
[
LONG
(
EV_KEY
)]
=
BIT
(
EV_KEY
);
input_dev
.
keybit
[
LONG
(
key
->
keycode
)]
set_bit
(
key
->
keycode
,
input_dev
->
keybit
);
|=
BIT
(
key
->
keycode
);
}
}
}
}
input_register_device
(
&
input_dev
);
error
=
input_register_device
(
input_dev
);
if
(
error
)
{
input_free_device
(
input_dev
);
return
error
;
}
return
0
;
}
}
static
void
report_key
(
unsigned
keycode
)
static
void
report_key
(
unsigned
keycode
)
{
{
input_report_key
(
&
input_dev
,
keycode
,
1
);
input_report_key
(
input_dev
,
keycode
,
1
);
input_sync
(
&
input_dev
);
input_sync
(
input_dev
);
input_report_key
(
&
input_dev
,
keycode
,
0
);
input_report_key
(
input_dev
,
keycode
,
0
);
input_sync
(
&
input_dev
);
input_sync
(
input_dev
);
}
}
/* Driver core */
/* Driver core */
...
@@ -437,11 +449,14 @@ static int __init wb_module_init(void)
...
@@ -437,11 +449,14 @@ static int __init wb_module_init(void)
err
=
select_keymap
();
err
=
select_keymap
();
if
(
err
)
if
(
err
)
return
err
;
return
err
;
err
=
map_bios
();
err
=
map_bios
();
if
(
err
)
if
(
err
)
return
err
;
return
err
;
bios_attach
();
bios_attach
();
cmos_address
=
bios_get_cmos_address
();
cmos_address
=
bios_get_cmos_address
();
if
(
have_wifi
)
{
if
(
have_wifi
)
{
u16
wifi
=
bios_get_default_setting
(
WIFI
);
u16
wifi
=
bios_get_default_setting
(
WIFI
);
if
(
wifi
&
1
)
if
(
wifi
&
1
)
...
@@ -452,6 +467,7 @@ static int __init wb_module_init(void)
...
@@ -452,6 +467,7 @@ static int __init wb_module_init(void)
if
(
have_wifi
)
if
(
have_wifi
)
bios_set_state
(
WIFI
,
wifi_enabled
);
bios_set_state
(
WIFI
,
wifi_enabled
);
}
}
if
(
have_bluetooth
)
{
if
(
have_bluetooth
)
{
u16
bt
=
bios_get_default_setting
(
BLUETOOTH
);
u16
bt
=
bios_get_default_setting
(
BLUETOOTH
);
if
(
bt
&
1
)
if
(
bt
&
1
)
...
@@ -463,7 +479,12 @@ static int __init wb_module_init(void)
...
@@ -463,7 +479,12 @@ static int __init wb_module_init(void)
bios_set_state
(
BLUETOOTH
,
bluetooth_enabled
);
bios_set_state
(
BLUETOOTH
,
bluetooth_enabled
);
}
}
setup_input_dev
();
err
=
setup_input_dev
();
if
(
err
)
{
bios_detach
();
unmap_bios
();
return
err
;
}
poll_bios
(
1
);
/* Flush stale event queue and arm timer */
poll_bios
(
1
);
/* Flush stale event queue and arm timer */
...
@@ -473,7 +494,7 @@ static int __init wb_module_init(void)
...
@@ -473,7 +494,7 @@ static int __init wb_module_init(void)
static
void
__exit
wb_module_exit
(
void
)
static
void
__exit
wb_module_exit
(
void
)
{
{
del_timer_sync
(
&
poll_timer
);
del_timer_sync
(
&
poll_timer
);
input_unregister_device
(
&
input_dev
);
input_unregister_device
(
input_dev
);
bios_detach
();
bios_detach
();
unmap_bios
();
unmap_bios
();
}
}
...
...
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