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
Kirill Smelkov
linux
Commits
b7802c5c
Commit
b7802c5c
authored
Sep 09, 2009
by
Dmitry Torokhov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Input: psmouse - use boolean type
Signed-off-by:
Dmitry Torokhov
<
dtor@mail.ru
>
parent
f8113416
Changes
20
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
133 additions
and
125 deletions
+133
-125
drivers/input/mouse/alps.c
drivers/input/mouse/alps.c
+12
-8
drivers/input/mouse/alps.h
drivers/input/mouse/alps.h
+2
-2
drivers/input/mouse/elantech.c
drivers/input/mouse/elantech.c
+1
-1
drivers/input/mouse/elantech.h
drivers/input/mouse/elantech.h
+2
-2
drivers/input/mouse/hgpk.c
drivers/input/mouse/hgpk.c
+4
-4
drivers/input/mouse/hgpk.h
drivers/input/mouse/hgpk.h
+3
-3
drivers/input/mouse/lifebook.c
drivers/input/mouse/lifebook.c
+4
-4
drivers/input/mouse/lifebook.h
drivers/input/mouse/lifebook.h
+2
-2
drivers/input/mouse/logips2pp.c
drivers/input/mouse/logips2pp.c
+20
-21
drivers/input/mouse/logips2pp.h
drivers/input/mouse/logips2pp.h
+2
-2
drivers/input/mouse/psmouse-base.c
drivers/input/mouse/psmouse-base.c
+46
-41
drivers/input/mouse/psmouse.h
drivers/input/mouse/psmouse.h
+7
-7
drivers/input/mouse/sentelic.c
drivers/input/mouse/sentelic.c
+1
-1
drivers/input/mouse/sentelic.h
drivers/input/mouse/sentelic.h
+2
-2
drivers/input/mouse/synaptics.c
drivers/input/mouse/synaptics.c
+17
-17
drivers/input/mouse/synaptics.h
drivers/input/mouse/synaptics.h
+1
-1
drivers/input/mouse/touchkit_ps2.c
drivers/input/mouse/touchkit_ps2.c
+2
-2
drivers/input/mouse/touchkit_ps2.h
drivers/input/mouse/touchkit_ps2.h
+2
-2
drivers/input/mouse/trackpoint.c
drivers/input/mouse/trackpoint.c
+1
-1
drivers/input/mouse/trackpoint.h
drivers/input/mouse/trackpoint.h
+2
-2
No files found.
drivers/input/mouse/alps.c
View file @
b7802c5c
...
@@ -279,7 +279,7 @@ static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int
...
@@ -279,7 +279,7 @@ static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int
* subsequent commands. It looks like glidepad is behind stickpointer,
* subsequent commands. It looks like glidepad is behind stickpointer,
* I'd thought it would be other way around...
* I'd thought it would be other way around...
*/
*/
static
int
alps_passthrough_mode
(
struct
psmouse
*
psmouse
,
int
enable
)
static
int
alps_passthrough_mode
(
struct
psmouse
*
psmouse
,
bool
enable
)
{
{
struct
ps2dev
*
ps2dev
=
&
psmouse
->
ps2dev
;
struct
ps2dev
*
ps2dev
=
&
psmouse
->
ps2dev
;
int
cmd
=
enable
?
PSMOUSE_CMD_SETSCALE21
:
PSMOUSE_CMD_SETSCALE11
;
int
cmd
=
enable
?
PSMOUSE_CMD_SETSCALE21
:
PSMOUSE_CMD_SETSCALE11
;
...
@@ -367,16 +367,16 @@ static int alps_poll(struct psmouse *psmouse)
...
@@ -367,16 +367,16 @@ static int alps_poll(struct psmouse *psmouse)
{
{
struct
alps_data
*
priv
=
psmouse
->
private
;
struct
alps_data
*
priv
=
psmouse
->
private
;
unsigned
char
buf
[
6
];
unsigned
char
buf
[
6
];
int
poll_failed
;
bool
poll_failed
;
if
(
priv
->
i
->
flags
&
ALPS_PASS
)
if
(
priv
->
i
->
flags
&
ALPS_PASS
)
alps_passthrough_mode
(
psmouse
,
1
);
alps_passthrough_mode
(
psmouse
,
true
);
poll_failed
=
ps2_command
(
&
psmouse
->
ps2dev
,
buf
,
poll_failed
=
ps2_command
(
&
psmouse
->
ps2dev
,
buf
,
PSMOUSE_CMD_POLL
|
(
psmouse
->
pktsize
<<
8
))
<
0
;
PSMOUSE_CMD_POLL
|
(
psmouse
->
pktsize
<<
8
))
<
0
;
if
(
priv
->
i
->
flags
&
ALPS_PASS
)
if
(
priv
->
i
->
flags
&
ALPS_PASS
)
alps_passthrough_mode
(
psmouse
,
0
);
alps_passthrough_mode
(
psmouse
,
false
);
if
(
poll_failed
||
(
buf
[
0
]
&
priv
->
i
->
mask0
)
!=
priv
->
i
->
byte0
)
if
(
poll_failed
||
(
buf
[
0
]
&
priv
->
i
->
mask0
)
!=
priv
->
i
->
byte0
)
return
-
1
;
return
-
1
;
...
@@ -401,10 +401,12 @@ static int alps_hw_init(struct psmouse *psmouse, int *version)
...
@@ -401,10 +401,12 @@ static int alps_hw_init(struct psmouse *psmouse, int *version)
if
(
!
priv
->
i
)
if
(
!
priv
->
i
)
return
-
1
;
return
-
1
;
if
((
priv
->
i
->
flags
&
ALPS_PASS
)
&&
alps_passthrough_mode
(
psmouse
,
1
))
if
((
priv
->
i
->
flags
&
ALPS_PASS
)
&&
alps_passthrough_mode
(
psmouse
,
true
))
{
return
-
1
;
return
-
1
;
}
if
(
alps_tap_mode
(
psmouse
,
1
))
{
if
(
alps_tap_mode
(
psmouse
,
true
))
{
printk
(
KERN_WARNING
"alps.c: Failed to enable hardware tapping
\n
"
);
printk
(
KERN_WARNING
"alps.c: Failed to enable hardware tapping
\n
"
);
return
-
1
;
return
-
1
;
}
}
...
@@ -414,8 +416,10 @@ static int alps_hw_init(struct psmouse *psmouse, int *version)
...
@@ -414,8 +416,10 @@ static int alps_hw_init(struct psmouse *psmouse, int *version)
return
-
1
;
return
-
1
;
}
}
if
((
priv
->
i
->
flags
&
ALPS_PASS
)
&&
alps_passthrough_mode
(
psmouse
,
0
))
if
((
priv
->
i
->
flags
&
ALPS_PASS
)
&&
alps_passthrough_mode
(
psmouse
,
false
))
{
return
-
1
;
return
-
1
;
}
/* ALPS needs stream mode, otherwise it won't report any data */
/* ALPS needs stream mode, otherwise it won't report any data */
if
(
ps2_command
(
&
psmouse
->
ps2dev
,
NULL
,
PSMOUSE_CMD_SETSTREAM
))
{
if
(
ps2_command
(
&
psmouse
->
ps2dev
,
NULL
,
PSMOUSE_CMD_SETSTREAM
))
{
...
@@ -519,7 +523,7 @@ int alps_init(struct psmouse *psmouse)
...
@@ -519,7 +523,7 @@ int alps_init(struct psmouse *psmouse)
return
-
1
;
return
-
1
;
}
}
int
alps_detect
(
struct
psmouse
*
psmouse
,
int
set_properties
)
int
alps_detect
(
struct
psmouse
*
psmouse
,
bool
set_properties
)
{
{
int
version
;
int
version
;
const
struct
alps_model_info
*
model
;
const
struct
alps_model_info
*
model
;
...
...
drivers/input/mouse/alps.h
View file @
b7802c5c
...
@@ -26,10 +26,10 @@ struct alps_data {
...
@@ -26,10 +26,10 @@ struct alps_data {
};
};
#ifdef CONFIG_MOUSE_PS2_ALPS
#ifdef CONFIG_MOUSE_PS2_ALPS
int
alps_detect
(
struct
psmouse
*
psmouse
,
int
set_properties
);
int
alps_detect
(
struct
psmouse
*
psmouse
,
bool
set_properties
);
int
alps_init
(
struct
psmouse
*
psmouse
);
int
alps_init
(
struct
psmouse
*
psmouse
);
#else
#else
inline
int
alps_detect
(
struct
psmouse
*
psmouse
,
int
set_properties
)
inline
int
alps_detect
(
struct
psmouse
*
psmouse
,
bool
set_properties
)
{
{
return
-
ENOSYS
;
return
-
ENOSYS
;
}
}
...
...
drivers/input/mouse/elantech.c
View file @
b7802c5c
...
@@ -553,7 +553,7 @@ static struct attribute_group elantech_attr_group = {
...
@@ -553,7 +553,7 @@ static struct attribute_group elantech_attr_group = {
/*
/*
* Use magic knock to detect Elantech touchpad
* Use magic knock to detect Elantech touchpad
*/
*/
int
elantech_detect
(
struct
psmouse
*
psmouse
,
int
set_properties
)
int
elantech_detect
(
struct
psmouse
*
psmouse
,
bool
set_properties
)
{
{
struct
ps2dev
*
ps2dev
=
&
psmouse
->
ps2dev
;
struct
ps2dev
*
ps2dev
=
&
psmouse
->
ps2dev
;
unsigned
char
param
[
3
];
unsigned
char
param
[
3
];
...
...
drivers/input/mouse/elantech.h
View file @
b7802c5c
...
@@ -109,10 +109,10 @@ struct elantech_data {
...
@@ -109,10 +109,10 @@ struct elantech_data {
};
};
#ifdef CONFIG_MOUSE_PS2_ELANTECH
#ifdef CONFIG_MOUSE_PS2_ELANTECH
int
elantech_detect
(
struct
psmouse
*
psmouse
,
int
set_properties
);
int
elantech_detect
(
struct
psmouse
*
psmouse
,
bool
set_properties
);
int
elantech_init
(
struct
psmouse
*
psmouse
);
int
elantech_init
(
struct
psmouse
*
psmouse
);
#else
#else
static
inline
int
elantech_detect
(
struct
psmouse
*
psmouse
,
int
set_properties
)
static
inline
int
elantech_detect
(
struct
psmouse
*
psmouse
,
bool
set_properties
)
{
{
return
-
ENOSYS
;
return
-
ENOSYS
;
}
}
...
...
drivers/input/mouse/hgpk.c
View file @
b7802c5c
...
@@ -367,7 +367,7 @@ static ssize_t hgpk_set_powered(struct psmouse *psmouse, void *data,
...
@@ -367,7 +367,7 @@ static ssize_t hgpk_set_powered(struct psmouse *psmouse, void *data,
}
}
__PSMOUSE_DEFINE_ATTR
(
powered
,
S_IWUSR
|
S_IRUGO
,
NULL
,
__PSMOUSE_DEFINE_ATTR
(
powered
,
S_IWUSR
|
S_IRUGO
,
NULL
,
hgpk_show_powered
,
hgpk_set_powered
,
0
);
hgpk_show_powered
,
hgpk_set_powered
,
false
);
static
ssize_t
hgpk_trigger_recal_show
(
struct
psmouse
*
psmouse
,
static
ssize_t
hgpk_trigger_recal_show
(
struct
psmouse
*
psmouse
,
void
*
data
,
char
*
buf
)
void
*
data
,
char
*
buf
)
...
@@ -396,7 +396,7 @@ static ssize_t hgpk_trigger_recal(struct psmouse *psmouse, void *data,
...
@@ -396,7 +396,7 @@ static ssize_t hgpk_trigger_recal(struct psmouse *psmouse, void *data,
}
}
__PSMOUSE_DEFINE_ATTR
(
recalibrate
,
S_IWUSR
|
S_IRUGO
,
NULL
,
__PSMOUSE_DEFINE_ATTR
(
recalibrate
,
S_IWUSR
|
S_IRUGO
,
NULL
,
hgpk_trigger_recal_show
,
hgpk_trigger_recal
,
0
);
hgpk_trigger_recal_show
,
hgpk_trigger_recal
,
false
);
static
void
hgpk_disconnect
(
struct
psmouse
*
psmouse
)
static
void
hgpk_disconnect
(
struct
psmouse
*
psmouse
)
{
{
...
@@ -489,7 +489,7 @@ int hgpk_init(struct psmouse *psmouse)
...
@@ -489,7 +489,7 @@ int hgpk_init(struct psmouse *psmouse)
psmouse
->
private
=
priv
;
psmouse
->
private
=
priv
;
priv
->
psmouse
=
psmouse
;
priv
->
psmouse
=
psmouse
;
priv
->
powered
=
1
;
priv
->
powered
=
true
;
INIT_DELAYED_WORK
(
&
priv
->
recalib_wq
,
hgpk_recalib_work
);
INIT_DELAYED_WORK
(
&
priv
->
recalib_wq
,
hgpk_recalib_work
);
err
=
psmouse_reset
(
psmouse
);
err
=
psmouse_reset
(
psmouse
);
...
@@ -532,7 +532,7 @@ static enum hgpk_model_t hgpk_get_model(struct psmouse *psmouse)
...
@@ -532,7 +532,7 @@ static enum hgpk_model_t hgpk_get_model(struct psmouse *psmouse)
return
param
[
2
];
return
param
[
2
];
}
}
int
hgpk_detect
(
struct
psmouse
*
psmouse
,
int
set_properties
)
int
hgpk_detect
(
struct
psmouse
*
psmouse
,
bool
set_properties
)
{
{
int
version
;
int
version
;
...
...
drivers/input/mouse/hgpk.h
View file @
b7802c5c
...
@@ -15,7 +15,7 @@ enum hgpk_model_t {
...
@@ -15,7 +15,7 @@ enum hgpk_model_t {
struct
hgpk_data
{
struct
hgpk_data
{
struct
psmouse
*
psmouse
;
struct
psmouse
*
psmouse
;
int
powered
;
bool
powered
;
int
count
,
x_tally
,
y_tally
;
/* hardware workaround stuff */
int
count
,
x_tally
,
y_tally
;
/* hardware workaround stuff */
unsigned
long
recalib_window
;
unsigned
long
recalib_window
;
struct
delayed_work
recalib_wq
;
struct
delayed_work
recalib_wq
;
...
@@ -33,10 +33,10 @@ struct hgpk_data {
...
@@ -33,10 +33,10 @@ struct hgpk_data {
dev_notice(&(psmouse)->ps2dev.serio->dev, format, ## arg)
dev_notice(&(psmouse)->ps2dev.serio->dev, format, ## arg)
#ifdef CONFIG_MOUSE_PS2_OLPC
#ifdef CONFIG_MOUSE_PS2_OLPC
int
hgpk_detect
(
struct
psmouse
*
psmouse
,
int
set_properties
);
int
hgpk_detect
(
struct
psmouse
*
psmouse
,
bool
set_properties
);
int
hgpk_init
(
struct
psmouse
*
psmouse
);
int
hgpk_init
(
struct
psmouse
*
psmouse
);
#else
#else
static
inline
int
hgpk_detect
(
struct
psmouse
*
psmouse
,
int
set_properties
)
static
inline
int
hgpk_detect
(
struct
psmouse
*
psmouse
,
bool
set_properties
)
{
{
return
-
ENODEV
;
return
-
ENODEV
;
}
}
...
...
drivers/input/mouse/lifebook.c
View file @
b7802c5c
...
@@ -33,11 +33,11 @@ static int lifebook_set_serio_phys(const struct dmi_system_id *d)
...
@@ -33,11 +33,11 @@ static int lifebook_set_serio_phys(const struct dmi_system_id *d)
return
0
;
return
0
;
}
}
static
unsigned
char
lifebook_use_6byte_proto
;
static
bool
lifebook_use_6byte_proto
;
static
int
lifebook_set_6byte_proto
(
const
struct
dmi_system_id
*
d
)
static
int
lifebook_set_6byte_proto
(
const
struct
dmi_system_id
*
d
)
{
{
lifebook_use_6byte_proto
=
1
;
lifebook_use_6byte_proto
=
true
;
return
0
;
return
0
;
}
}
...
@@ -125,7 +125,7 @@ static psmouse_ret_t lifebook_process_byte(struct psmouse *psmouse)
...
@@ -125,7 +125,7 @@ static psmouse_ret_t lifebook_process_byte(struct psmouse *psmouse)
struct
input_dev
*
dev1
=
psmouse
->
dev
;
struct
input_dev
*
dev1
=
psmouse
->
dev
;
struct
input_dev
*
dev2
=
priv
?
priv
->
dev2
:
NULL
;
struct
input_dev
*
dev2
=
priv
?
priv
->
dev2
:
NULL
;
unsigned
char
*
packet
=
psmouse
->
packet
;
unsigned
char
*
packet
=
psmouse
->
packet
;
int
relative_packet
=
packet
[
0
]
&
0x08
;
bool
relative_packet
=
packet
[
0
]
&
0x08
;
if
(
relative_packet
||
!
lifebook_use_6byte_proto
)
{
if
(
relative_packet
||
!
lifebook_use_6byte_proto
)
{
if
(
psmouse
->
pktcnt
!=
3
)
if
(
psmouse
->
pktcnt
!=
3
)
...
@@ -242,7 +242,7 @@ static void lifebook_disconnect(struct psmouse *psmouse)
...
@@ -242,7 +242,7 @@ static void lifebook_disconnect(struct psmouse *psmouse)
psmouse
->
private
=
NULL
;
psmouse
->
private
=
NULL
;
}
}
int
lifebook_detect
(
struct
psmouse
*
psmouse
,
int
set_properties
)
int
lifebook_detect
(
struct
psmouse
*
psmouse
,
bool
set_properties
)
{
{
if
(
!
dmi_check_system
(
lifebook_dmi_table
))
if
(
!
dmi_check_system
(
lifebook_dmi_table
))
return
-
1
;
return
-
1
;
...
...
drivers/input/mouse/lifebook.h
View file @
b7802c5c
...
@@ -12,10 +12,10 @@
...
@@ -12,10 +12,10 @@
#define _LIFEBOOK_H
#define _LIFEBOOK_H
#ifdef CONFIG_MOUSE_PS2_LIFEBOOK
#ifdef CONFIG_MOUSE_PS2_LIFEBOOK
int
lifebook_detect
(
struct
psmouse
*
psmouse
,
int
set_properties
);
int
lifebook_detect
(
struct
psmouse
*
psmouse
,
bool
set_properties
);
int
lifebook_init
(
struct
psmouse
*
psmouse
);
int
lifebook_init
(
struct
psmouse
*
psmouse
);
#else
#else
inline
int
lifebook_detect
(
struct
psmouse
*
psmouse
,
int
set_properties
)
inline
int
lifebook_detect
(
struct
psmouse
*
psmouse
,
bool
set_properties
)
{
{
return
-
ENOSYS
;
return
-
ENOSYS
;
}
}
...
...
drivers/input/mouse/logips2pp.c
View file @
b7802c5c
...
@@ -130,14 +130,11 @@ static int ps2pp_cmd(struct psmouse *psmouse, unsigned char *param, unsigned cha
...
@@ -130,14 +130,11 @@ static int ps2pp_cmd(struct psmouse *psmouse, unsigned char *param, unsigned cha
* 0 - disabled
* 0 - disabled
*/
*/
static
void
ps2pp_set_smartscroll
(
struct
psmouse
*
psmouse
,
unsigned
int
smartscroll
)
static
void
ps2pp_set_smartscroll
(
struct
psmouse
*
psmouse
,
bool
smartscroll
)
{
{
struct
ps2dev
*
ps2dev
=
&
psmouse
->
ps2dev
;
struct
ps2dev
*
ps2dev
=
&
psmouse
->
ps2dev
;
unsigned
char
param
[
4
];
unsigned
char
param
[
4
];
if
(
smartscroll
>
1
)
smartscroll
=
1
;
ps2pp_cmd
(
psmouse
,
param
,
0x32
);
ps2pp_cmd
(
psmouse
,
param
,
0x32
);
param
[
0
]
=
0
;
param
[
0
]
=
0
;
...
@@ -149,12 +146,14 @@ static void ps2pp_set_smartscroll(struct psmouse *psmouse, unsigned int smartscr
...
@@ -149,12 +146,14 @@ static void ps2pp_set_smartscroll(struct psmouse *psmouse, unsigned int smartscr
ps2_command
(
ps2dev
,
param
,
PSMOUSE_CMD_SETRES
);
ps2_command
(
ps2dev
,
param
,
PSMOUSE_CMD_SETRES
);
}
}
static
ssize_t
ps2pp_attr_show_smartscroll
(
struct
psmouse
*
psmouse
,
void
*
data
,
char
*
buf
)
static
ssize_t
ps2pp_attr_show_smartscroll
(
struct
psmouse
*
psmouse
,
void
*
data
,
char
*
buf
)
{
{
return
sprintf
(
buf
,
"%d
\n
"
,
psmouse
->
smartscroll
?
1
:
0
);
return
sprintf
(
buf
,
"%d
\n
"
,
psmouse
->
smartscroll
);
}
}
static
ssize_t
ps2pp_attr_set_smartscroll
(
struct
psmouse
*
psmouse
,
void
*
data
,
const
char
*
buf
,
size_t
count
)
static
ssize_t
ps2pp_attr_set_smartscroll
(
struct
psmouse
*
psmouse
,
void
*
data
,
const
char
*
buf
,
size_t
count
)
{
{
unsigned
long
value
;
unsigned
long
value
;
...
@@ -261,29 +260,29 @@ static const struct ps2pp_info *get_model_info(unsigned char model)
...
@@ -261,29 +260,29 @@ static const struct ps2pp_info *get_model_info(unsigned char model)
static
void
ps2pp_set_model_properties
(
struct
psmouse
*
psmouse
,
static
void
ps2pp_set_model_properties
(
struct
psmouse
*
psmouse
,
const
struct
ps2pp_info
*
model_info
,
const
struct
ps2pp_info
*
model_info
,
int
using_ps2pp
)
bool
using_ps2pp
)
{
{
struct
input_dev
*
input_dev
=
psmouse
->
dev
;
struct
input_dev
*
input_dev
=
psmouse
->
dev
;
if
(
model_info
->
features
&
PS2PP_SIDE_BTN
)
if
(
model_info
->
features
&
PS2PP_SIDE_BTN
)
set_bit
(
BTN_SIDE
,
input_dev
->
keybit
);
__
set_bit
(
BTN_SIDE
,
input_dev
->
keybit
);
if
(
model_info
->
features
&
PS2PP_EXTRA_BTN
)
if
(
model_info
->
features
&
PS2PP_EXTRA_BTN
)
set_bit
(
BTN_EXTRA
,
input_dev
->
keybit
);
__
set_bit
(
BTN_EXTRA
,
input_dev
->
keybit
);
if
(
model_info
->
features
&
PS2PP_TASK_BTN
)
if
(
model_info
->
features
&
PS2PP_TASK_BTN
)
set_bit
(
BTN_TASK
,
input_dev
->
keybit
);
__
set_bit
(
BTN_TASK
,
input_dev
->
keybit
);
if
(
model_info
->
features
&
PS2PP_NAV_BTN
)
{
if
(
model_info
->
features
&
PS2PP_NAV_BTN
)
{
set_bit
(
BTN_FORWARD
,
input_dev
->
keybit
);
__
set_bit
(
BTN_FORWARD
,
input_dev
->
keybit
);
set_bit
(
BTN_BACK
,
input_dev
->
keybit
);
__
set_bit
(
BTN_BACK
,
input_dev
->
keybit
);
}
}
if
(
model_info
->
features
&
PS2PP_WHEEL
)
if
(
model_info
->
features
&
PS2PP_WHEEL
)
set_bit
(
REL_WHEEL
,
input_dev
->
relbit
);
__
set_bit
(
REL_WHEEL
,
input_dev
->
relbit
);
if
(
model_info
->
features
&
PS2PP_HWHEEL
)
if
(
model_info
->
features
&
PS2PP_HWHEEL
)
set_bit
(
REL_HWHEEL
,
input_dev
->
relbit
);
__
set_bit
(
REL_HWHEEL
,
input_dev
->
relbit
);
switch
(
model_info
->
kind
)
{
switch
(
model_info
->
kind
)
{
case
PS2PP_KIND_WHEEL
:
case
PS2PP_KIND_WHEEL
:
...
@@ -321,13 +320,13 @@ static void ps2pp_set_model_properties(struct psmouse *psmouse,
...
@@ -321,13 +320,13 @@ static void ps2pp_set_model_properties(struct psmouse *psmouse,
* that support it.
* that support it.
*/
*/
int
ps2pp_init
(
struct
psmouse
*
psmouse
,
int
set_properties
)
int
ps2pp_init
(
struct
psmouse
*
psmouse
,
bool
set_properties
)
{
{
struct
ps2dev
*
ps2dev
=
&
psmouse
->
ps2dev
;
struct
ps2dev
*
ps2dev
=
&
psmouse
->
ps2dev
;
unsigned
char
param
[
4
];
unsigned
char
param
[
4
];
unsigned
char
model
,
buttons
;
unsigned
char
model
,
buttons
;
const
struct
ps2pp_info
*
model_info
;
const
struct
ps2pp_info
*
model_info
;
int
use_ps2pp
=
0
;
bool
use_ps2pp
=
false
;
int
error
;
int
error
;
param
[
0
]
=
0
;
param
[
0
]
=
0
;
...
@@ -364,7 +363,7 @@ int ps2pp_init(struct psmouse *psmouse, int set_properties)
...
@@ -364,7 +363,7 @@ int ps2pp_init(struct psmouse *psmouse, int set_properties)
param
[
0
]
=
0
;
param
[
0
]
=
0
;
if
(
!
ps2_command
(
ps2dev
,
param
,
0x13d1
)
&&
if
(
!
ps2_command
(
ps2dev
,
param
,
0x13d1
)
&&
param
[
0
]
==
0x06
&&
param
[
1
]
==
0x00
&&
param
[
2
]
==
0x14
)
{
param
[
0
]
==
0x06
&&
param
[
1
]
==
0x00
&&
param
[
2
]
==
0x14
)
{
use_ps2pp
=
1
;
use_ps2pp
=
true
;
}
}
}
else
{
}
else
{
...
@@ -376,8 +375,8 @@ int ps2pp_init(struct psmouse *psmouse, int set_properties)
...
@@ -376,8 +375,8 @@ int ps2pp_init(struct psmouse *psmouse, int set_properties)
if
((
param
[
0
]
&
0x78
)
==
0x48
&&
if
((
param
[
0
]
&
0x78
)
==
0x48
&&
(
param
[
1
]
&
0xf3
)
==
0xc2
&&
(
param
[
1
]
&
0xf3
)
==
0xc2
&&
(
param
[
2
]
&
0x03
)
==
((
param
[
1
]
>>
2
)
&
3
))
{
(
param
[
2
]
&
0x03
)
==
((
param
[
1
]
>>
2
)
&
3
))
{
ps2pp_set_smartscroll
(
psmouse
,
psmouse
->
smartscroll
);
ps2pp_set_smartscroll
(
psmouse
,
false
);
use_ps2pp
=
1
;
use_ps2pp
=
true
;
}
}
}
}
}
}
...
@@ -406,7 +405,7 @@ int ps2pp_init(struct psmouse *psmouse, int set_properties)
...
@@ -406,7 +405,7 @@ int ps2pp_init(struct psmouse *psmouse, int set_properties)
}
}
if
(
buttons
<
3
)
if
(
buttons
<
3
)
clear_bit
(
BTN_MIDDLE
,
psmouse
->
dev
->
keybit
);
__
clear_bit
(
BTN_MIDDLE
,
psmouse
->
dev
->
keybit
);
if
(
model_info
)
if
(
model_info
)
ps2pp_set_model_properties
(
psmouse
,
model_info
,
use_ps2pp
);
ps2pp_set_model_properties
(
psmouse
,
model_info
,
use_ps2pp
);
...
...
drivers/input/mouse/logips2pp.h
View file @
b7802c5c
...
@@ -12,9 +12,9 @@
...
@@ -12,9 +12,9 @@
#define _LOGIPS2PP_H
#define _LOGIPS2PP_H
#ifdef CONFIG_MOUSE_PS2_LOGIPS2PP
#ifdef CONFIG_MOUSE_PS2_LOGIPS2PP
int
ps2pp_init
(
struct
psmouse
*
psmouse
,
int
set_properties
);
int
ps2pp_init
(
struct
psmouse
*
psmouse
,
bool
set_properties
);
#else
#else
inline
int
ps2pp_init
(
struct
psmouse
*
psmouse
,
int
set_properties
)
inline
int
ps2pp_init
(
struct
psmouse
*
psmouse
,
bool
set_properties
)
{
{
return
-
ENOSYS
;
return
-
ENOSYS
;
}
}
...
...
drivers/input/mouse/psmouse-base.c
View file @
b7802c5c
This diff is collapsed.
Click to expand it.
drivers/input/mouse/psmouse.h
View file @
b7802c5c
...
@@ -47,10 +47,10 @@ struct psmouse {
...
@@ -47,10 +47,10 @@ struct psmouse {
unsigned
char
pktcnt
;
unsigned
char
pktcnt
;
unsigned
char
pktsize
;
unsigned
char
pktsize
;
unsigned
char
type
;
unsigned
char
type
;
unsigned
char
acks_disable_command
;
bool
acks_disable_command
;
unsigned
int
model
;
unsigned
int
model
;
unsigned
long
last
;
unsigned
long
last
;
unsigned
long
out_of_sync
;
unsigned
long
out_of_sync
_cnt
;
unsigned
long
num_resyncs
;
unsigned
long
num_resyncs
;
enum
psmouse_state
state
;
enum
psmouse_state
state
;
char
devname
[
64
];
char
devname
[
64
];
...
@@ -60,7 +60,7 @@ struct psmouse {
...
@@ -60,7 +60,7 @@ struct psmouse {
unsigned
int
resolution
;
unsigned
int
resolution
;
unsigned
int
resetafter
;
unsigned
int
resetafter
;
unsigned
int
resync_time
;
unsigned
int
resync_time
;
unsigned
int
smartscroll
;
/* Logitech only */
bool
smartscroll
;
/* Logitech only */
psmouse_ret_t
(
*
protocol_handler
)(
struct
psmouse
*
psmouse
);
psmouse_ret_t
(
*
protocol_handler
)(
struct
psmouse
*
psmouse
);
void
(
*
set_rate
)(
struct
psmouse
*
psmouse
,
unsigned
int
rate
);
void
(
*
set_rate
)(
struct
psmouse
*
psmouse
,
unsigned
int
rate
);
...
@@ -108,7 +108,7 @@ struct psmouse_attribute {
...
@@ -108,7 +108,7 @@ struct psmouse_attribute {
ssize_t
(
*
show
)(
struct
psmouse
*
psmouse
,
void
*
data
,
char
*
buf
);
ssize_t
(
*
show
)(
struct
psmouse
*
psmouse
,
void
*
data
,
char
*
buf
);
ssize_t
(
*
set
)(
struct
psmouse
*
psmouse
,
void
*
data
,
ssize_t
(
*
set
)(
struct
psmouse
*
psmouse
,
void
*
data
,
const
char
*
buf
,
size_t
count
);
const
char
*
buf
,
size_t
count
);
int
protect
;
bool
protect
;
};
};
#define to_psmouse_attr(a) container_of((a), struct psmouse_attribute, dattr)
#define to_psmouse_attr(a) container_of((a), struct psmouse_attribute, dattr)
...
@@ -139,14 +139,14 @@ static struct psmouse_attribute psmouse_attr_##_name = { \
...
@@ -139,14 +139,14 @@ static struct psmouse_attribute psmouse_attr_##_name = { \
__PSMOUSE_DEFINE_ATTR_VAR(_name, _mode, _data, _show, _set, _protect)
__PSMOUSE_DEFINE_ATTR_VAR(_name, _mode, _data, _show, _set, _protect)
#define PSMOUSE_DEFINE_ATTR(_name, _mode, _data, _show, _set) \
#define PSMOUSE_DEFINE_ATTR(_name, _mode, _data, _show, _set) \
__PSMOUSE_DEFINE_ATTR(_name, _mode, _data, _show, _set,
1
)
__PSMOUSE_DEFINE_ATTR(_name, _mode, _data, _show, _set,
true
)
#define PSMOUSE_DEFINE_RO_ATTR(_name, _mode, _data, _show) \
#define PSMOUSE_DEFINE_RO_ATTR(_name, _mode, _data, _show) \
static ssize_t _show(struct psmouse *, void *, char *); \
static ssize_t _show(struct psmouse *, void *, char *); \
__PSMOUSE_DEFINE_ATTR_VAR(_name, _mode, _data, _show, NULL,
1
)
__PSMOUSE_DEFINE_ATTR_VAR(_name, _mode, _data, _show, NULL,
true
)
#define PSMOUSE_DEFINE_WO_ATTR(_name, _mode, _data, _set) \
#define PSMOUSE_DEFINE_WO_ATTR(_name, _mode, _data, _set) \
static ssize_t _set(struct psmouse *, void *, const char *, size_t); \
static ssize_t _set(struct psmouse *, void *, const char *, size_t); \
__PSMOUSE_DEFINE_ATTR_VAR(_name, _mode, _data, NULL, _set,
1
)
__PSMOUSE_DEFINE_ATTR_VAR(_name, _mode, _data, NULL, _set,
true
)
#endif
/* _PSMOUSE_H */
#endif
/* _PSMOUSE_H */
drivers/input/mouse/sentelic.c
View file @
b7802c5c
...
@@ -756,7 +756,7 @@ static int fsp_activate_protocol(struct psmouse *psmouse)
...
@@ -756,7 +756,7 @@ static int fsp_activate_protocol(struct psmouse *psmouse)
return
0
;
return
0
;
}
}
int
fsp_detect
(
struct
psmouse
*
psmouse
,
int
set_properties
)
int
fsp_detect
(
struct
psmouse
*
psmouse
,
bool
set_properties
)
{
{
int
id
;
int
id
;
...
...
drivers/input/mouse/sentelic.h
View file @
b7802c5c
...
@@ -80,10 +80,10 @@ struct fsp_data {
...
@@ -80,10 +80,10 @@ struct fsp_data {
};
};
#ifdef CONFIG_MOUSE_PS2_SENTELIC
#ifdef CONFIG_MOUSE_PS2_SENTELIC
extern
int
fsp_detect
(
struct
psmouse
*
psmouse
,
int
set_properties
);
extern
int
fsp_detect
(
struct
psmouse
*
psmouse
,
bool
set_properties
);
extern
int
fsp_init
(
struct
psmouse
*
psmouse
);
extern
int
fsp_init
(
struct
psmouse
*
psmouse
);
#else
#else
inline
int
fsp_detect
(
struct
psmouse
*
psmouse
,
int
set_properties
)
inline
int
fsp_detect
(
struct
psmouse
*
psmouse
,
bool
set_properties
)
{
{
return
-
ENOSYS
;
return
-
ENOSYS
;
}
}
...
...
drivers/input/mouse/synaptics.c
View file @
b7802c5c
...
@@ -60,7 +60,7 @@ static int synaptics_mode_cmd(struct psmouse *psmouse, unsigned char mode)
...
@@ -60,7 +60,7 @@ static int synaptics_mode_cmd(struct psmouse *psmouse, unsigned char mode)
return
0
;
return
0
;
}
}
int
synaptics_detect
(
struct
psmouse
*
psmouse
,
int
set_properties
)
int
synaptics_detect
(
struct
psmouse
*
psmouse
,
bool
set_properties
)
{
{
struct
ps2dev
*
ps2dev
=
&
psmouse
->
ps2dev
;
struct
ps2dev
*
ps2dev
=
&
psmouse
->
ps2dev
;
unsigned
char
param
[
4
];
unsigned
char
param
[
4
];
...
@@ -556,38 +556,38 @@ static void set_input_params(struct input_dev *dev, struct synaptics_data *priv)
...
@@ -556,38 +556,38 @@ static void set_input_params(struct input_dev *dev, struct synaptics_data *priv)
{
{
int
i
;
int
i
;
set_bit
(
EV_ABS
,
dev
->
evbit
);
__
set_bit
(
EV_ABS
,
dev
->
evbit
);
input_set_abs_params
(
dev
,
ABS_X
,
XMIN_NOMINAL
,
XMAX_NOMINAL
,
0
,
0
);
input_set_abs_params
(
dev
,
ABS_X
,
XMIN_NOMINAL
,
XMAX_NOMINAL
,
0
,
0
);
input_set_abs_params
(
dev
,
ABS_Y
,
YMIN_NOMINAL
,
YMAX_NOMINAL
,
0
,
0
);
input_set_abs_params
(
dev
,
ABS_Y
,
YMIN_NOMINAL
,
YMAX_NOMINAL
,
0
,
0
);
input_set_abs_params
(
dev
,
ABS_PRESSURE
,
0
,
255
,
0
,
0
);
input_set_abs_params
(
dev
,
ABS_PRESSURE
,
0
,
255
,
0
,
0
);
set_bit
(
ABS_TOOL_WIDTH
,
dev
->
absbit
);
__
set_bit
(
ABS_TOOL_WIDTH
,
dev
->
absbit
);
set_bit
(
EV_KEY
,
dev
->
evbit
);
__
set_bit
(
EV_KEY
,
dev
->
evbit
);
set_bit
(
BTN_TOUCH
,
dev
->
keybit
);
__
set_bit
(
BTN_TOUCH
,
dev
->
keybit
);
set_bit
(
BTN_TOOL_FINGER
,
dev
->
keybit
);
__
set_bit
(
BTN_TOOL_FINGER
,
dev
->
keybit
);
set_bit
(
BTN_LEFT
,
dev
->
keybit
);
__
set_bit
(
BTN_LEFT
,
dev
->
keybit
);
set_bit
(
BTN_RIGHT
,
dev
->
keybit
);
__
set_bit
(
BTN_RIGHT
,
dev
->
keybit
);
if
(
SYN_CAP_MULTIFINGER
(
priv
->
capabilities
))
{
if
(
SYN_CAP_MULTIFINGER
(
priv
->
capabilities
))
{
set_bit
(
BTN_TOOL_DOUBLETAP
,
dev
->
keybit
);
__
set_bit
(
BTN_TOOL_DOUBLETAP
,
dev
->
keybit
);
set_bit
(
BTN_TOOL_TRIPLETAP
,
dev
->
keybit
);
__
set_bit
(
BTN_TOOL_TRIPLETAP
,
dev
->
keybit
);
}
}
if
(
SYN_CAP_MIDDLE_BUTTON
(
priv
->
capabilities
))
if
(
SYN_CAP_MIDDLE_BUTTON
(
priv
->
capabilities
))
set_bit
(
BTN_MIDDLE
,
dev
->
keybit
);
__
set_bit
(
BTN_MIDDLE
,
dev
->
keybit
);
if
(
SYN_CAP_FOUR_BUTTON
(
priv
->
capabilities
)
||
if
(
SYN_CAP_FOUR_BUTTON
(
priv
->
capabilities
)
||
SYN_CAP_MIDDLE_BUTTON
(
priv
->
capabilities
))
{
SYN_CAP_MIDDLE_BUTTON
(
priv
->
capabilities
))
{
set_bit
(
BTN_FORWARD
,
dev
->
keybit
);
__
set_bit
(
BTN_FORWARD
,
dev
->
keybit
);
set_bit
(
BTN_BACK
,
dev
->
keybit
);
__
set_bit
(
BTN_BACK
,
dev
->
keybit
);
}
}
for
(
i
=
0
;
i
<
SYN_CAP_MULTI_BUTTON_NO
(
priv
->
ext_cap
);
i
++
)
for
(
i
=
0
;
i
<
SYN_CAP_MULTI_BUTTON_NO
(
priv
->
ext_cap
);
i
++
)
set_bit
(
BTN_0
+
i
,
dev
->
keybit
);
__
set_bit
(
BTN_0
+
i
,
dev
->
keybit
);
clear_bit
(
EV_REL
,
dev
->
evbit
);
__
clear_bit
(
EV_REL
,
dev
->
evbit
);
clear_bit
(
REL_X
,
dev
->
relbit
);
__
clear_bit
(
REL_X
,
dev
->
relbit
);
clear_bit
(
REL_Y
,
dev
->
relbit
);
__
clear_bit
(
REL_Y
,
dev
->
relbit
);
dev
->
absres
[
ABS_X
]
=
priv
->
x_res
;
dev
->
absres
[
ABS_X
]
=
priv
->
x_res
;
dev
->
absres
[
ABS_Y
]
=
priv
->
y_res
;
dev
->
absres
[
ABS_Y
]
=
priv
->
y_res
;
...
...
drivers/input/mouse/synaptics.h
View file @
b7802c5c
...
@@ -105,7 +105,7 @@ struct synaptics_data {
...
@@ -105,7 +105,7 @@ struct synaptics_data {
int
scroll
;
int
scroll
;
};
};
int
synaptics_detect
(
struct
psmouse
*
psmouse
,
int
set_properties
);
int
synaptics_detect
(
struct
psmouse
*
psmouse
,
bool
set_properties
);
int
synaptics_init
(
struct
psmouse
*
psmouse
);
int
synaptics_init
(
struct
psmouse
*
psmouse
);
void
synaptics_reset
(
struct
psmouse
*
psmouse
);
void
synaptics_reset
(
struct
psmouse
*
psmouse
);
...
...
drivers/input/mouse/touchkit_ps2.c
View file @
b7802c5c
...
@@ -67,7 +67,7 @@ static psmouse_ret_t touchkit_ps2_process_byte(struct psmouse *psmouse)
...
@@ -67,7 +67,7 @@ static psmouse_ret_t touchkit_ps2_process_byte(struct psmouse *psmouse)
return
PSMOUSE_FULL_PACKET
;
return
PSMOUSE_FULL_PACKET
;
}
}
int
touchkit_ps2_detect
(
struct
psmouse
*
psmouse
,
int
set_properties
)
int
touchkit_ps2_detect
(
struct
psmouse
*
psmouse
,
bool
set_properties
)
{
{
struct
input_dev
*
dev
=
psmouse
->
dev
;
struct
input_dev
*
dev
=
psmouse
->
dev
;
unsigned
char
param
[
3
];
unsigned
char
param
[
3
];
...
@@ -86,7 +86,7 @@ int touchkit_ps2_detect(struct psmouse *psmouse, int set_properties)
...
@@ -86,7 +86,7 @@ int touchkit_ps2_detect(struct psmouse *psmouse, int set_properties)
if
(
set_properties
)
{
if
(
set_properties
)
{
dev
->
evbit
[
0
]
=
BIT_MASK
(
EV_KEY
)
|
BIT_MASK
(
EV_ABS
);
dev
->
evbit
[
0
]
=
BIT_MASK
(
EV_KEY
)
|
BIT_MASK
(
EV_ABS
);
set_bit
(
BTN_TOUCH
,
dev
->
keybit
);
__
set_bit
(
BTN_TOUCH
,
dev
->
keybit
);
input_set_abs_params
(
dev
,
ABS_X
,
0
,
TOUCHKIT_MAX_XC
,
0
,
0
);
input_set_abs_params
(
dev
,
ABS_X
,
0
,
TOUCHKIT_MAX_XC
,
0
,
0
);
input_set_abs_params
(
dev
,
ABS_Y
,
0
,
TOUCHKIT_MAX_YC
,
0
,
0
);
input_set_abs_params
(
dev
,
ABS_Y
,
0
,
TOUCHKIT_MAX_YC
,
0
,
0
);
...
...
drivers/input/mouse/touchkit_ps2.h
View file @
b7802c5c
...
@@ -13,10 +13,10 @@
...
@@ -13,10 +13,10 @@
#define _TOUCHKIT_PS2_H
#define _TOUCHKIT_PS2_H
#ifdef CONFIG_MOUSE_PS2_TOUCHKIT
#ifdef CONFIG_MOUSE_PS2_TOUCHKIT
int
touchkit_ps2_detect
(
struct
psmouse
*
psmouse
,
int
set_properties
);
int
touchkit_ps2_detect
(
struct
psmouse
*
psmouse
,
bool
set_properties
);
#else
#else
static
inline
int
touchkit_ps2_detect
(
struct
psmouse
*
psmouse
,
static
inline
int
touchkit_ps2_detect
(
struct
psmouse
*
psmouse
,
int
set_properties
)
bool
set_properties
)
{
{
return
-
ENOSYS
;
return
-
ENOSYS
;
}
}
...
...
drivers/input/mouse/trackpoint.c
View file @
b7802c5c
...
@@ -282,7 +282,7 @@ static int trackpoint_reconnect(struct psmouse *psmouse)
...
@@ -282,7 +282,7 @@ static int trackpoint_reconnect(struct psmouse *psmouse)
return
0
;
return
0
;
}
}
int
trackpoint_detect
(
struct
psmouse
*
psmouse
,
int
set_properties
)
int
trackpoint_detect
(
struct
psmouse
*
psmouse
,
bool
set_properties
)
{
{
struct
trackpoint_data
*
priv
;
struct
trackpoint_data
*
priv
;
struct
ps2dev
*
ps2dev
=
&
psmouse
->
ps2dev
;
struct
ps2dev
*
ps2dev
=
&
psmouse
->
ps2dev
;
...
...
drivers/input/mouse/trackpoint.h
View file @
b7802c5c
...
@@ -143,9 +143,9 @@ struct trackpoint_data
...
@@ -143,9 +143,9 @@ struct trackpoint_data
};
};
#ifdef CONFIG_MOUSE_PS2_TRACKPOINT
#ifdef CONFIG_MOUSE_PS2_TRACKPOINT
int
trackpoint_detect
(
struct
psmouse
*
psmouse
,
int
set_properties
);
int
trackpoint_detect
(
struct
psmouse
*
psmouse
,
bool
set_properties
);
#else
#else
inline
int
trackpoint_detect
(
struct
psmouse
*
psmouse
,
int
set_properties
)
inline
int
trackpoint_detect
(
struct
psmouse
*
psmouse
,
bool
set_properties
)
{
{
return
-
ENOSYS
;
return
-
ENOSYS
;
}
}
...
...
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