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
72341eea
Commit
72341eea
authored
Nov 04, 2007
by
Dmitry Torokhov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Input: atlas_btns - add support for loadable keymaps
Signed-off-by:
Dmitry Torokhov
<
dtor@mail.ru
>
parent
1953ea2d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
16 deletions
+23
-16
drivers/input/misc/atlas_btns.c
drivers/input/misc/atlas_btns.c
+23
-16
No files found.
drivers/input/misc/atlas_btns.c
View file @
72341eea
...
...
@@ -29,9 +29,10 @@
#include <asm/uaccess.h>
#include <acpi/acpi_drivers.h>
#define ACPI_ATLAS_NAME
"Atlas ACPI"
#define ACPI_ATLAS_CLASS
"Atlas"
#define ACPI_ATLAS_NAME "Atlas ACPI"
#define ACPI_ATLAS_CLASS "Atlas"
static
unsigned
short
atlas_keymap
[
16
];
static
struct
input_dev
*
input_dev
;
/* button handling code */
...
...
@@ -50,12 +51,15 @@ static acpi_status acpi_atlas_button_handler(u32 function,
void
*
handler_context
,
void
*
region_context
)
{
acpi_status
status
;
int
keycode
;
if
(
function
==
ACPI_WRITE
)
{
keycode
=
KEY_F1
+
(
address
&
0x0F
);
input_report_key
(
input_dev
,
keycode
,
!
(
address
&
0x10
));
int
code
=
address
&
0x0f
;
int
key_down
=
!
(
address
&
0x10
);
input_event
(
input_dev
,
EV_MSC
,
MSC_SCAN
,
code
);
input_report_key
(
input_dev
,
atlas_keymap
[
code
],
key_down
);
input_sync
(
input_dev
);
status
=
0
;
}
else
{
printk
(
KERN_WARNING
"atlas: shrugged on unexpected function"
...
...
@@ -70,6 +74,7 @@ static acpi_status acpi_atlas_button_handler(u32 function,
static
int
atlas_acpi_button_add
(
struct
acpi_device
*
device
)
{
acpi_status
status
;
int
i
;
int
err
;
input_dev
=
input_allocate_device
();
...
...
@@ -81,17 +86,19 @@ static int atlas_acpi_button_add(struct acpi_device *device)
input_dev
->
name
=
"Atlas ACPI button driver"
;
input_dev
->
phys
=
"ASIM0000/atlas/input0"
;
input_dev
->
id
.
bustype
=
BUS_HOST
;
input_dev
->
evbit
[
BIT_WORD
(
EV_KEY
)]
=
BIT_MASK
(
EV_KEY
);
set_bit
(
KEY_F1
,
input_dev
->
keybit
);
set_bit
(
KEY_F2
,
input_dev
->
keybit
);
set_bit
(
KEY_F3
,
input_dev
->
keybit
);
set_bit
(
KEY_F4
,
input_dev
->
keybit
);
set_bit
(
KEY_F5
,
input_dev
->
keybit
);
set_bit
(
KEY_F6
,
input_dev
->
keybit
);
set_bit
(
KEY_F7
,
input_dev
->
keybit
);
set_bit
(
KEY_F8
,
input_dev
->
keybit
);
set_bit
(
KEY_F9
,
input_dev
->
keybit
);
input_dev
->
keycode
=
atlas_keymap
;
input_dev
->
keycodesize
=
sizeof
(
unsigned
short
);
input_dev
->
keycodemax
=
ARRAY_SIZE
(
atlas_keymap
);
input_set_capability
(
input_dev
,
EV_MSC
,
MSC_SCAN
);
__set_bit
(
EV_KEY
,
input_dev
->
evbit
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
atlas_keymap
);
i
++
)
{
if
(
i
<
9
)
{
atlas_keymap
[
i
]
=
KEY_F1
+
i
;
__set_bit
(
KEY_F1
+
i
,
input_dev
->
keybit
);
}
else
atlas_keymap
[
i
]
=
KEY_RESERVED
;
}
err
=
input_register_device
(
input_dev
);
if
(
err
)
{
...
...
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