diff options
author | Andres Salomon <dilinger@queued.net> | 2012-02-24 03:51:37 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-02-24 03:55:28 -0500 |
commit | bd26f3d6fbb84f101f3e78f0591415d1c407976a (patch) | |
tree | 9f0c6a675c41ce63462ce8385e5accd8265ad596 /drivers/input/mouse/psmouse-base.c | |
parent | 023cea0ecfa2df034096c3f4afa796a0b2d1188a (diff) |
Input: psmouse - allow drivers to use psmouse_{de,}activate
Other drivers duplicate this code; no sense in having it be private
to psmouse-base.
Signed-off-by: Andres Salomon <dilinger@queued.net>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/mouse/psmouse-base.c')
-rw-r--r-- | drivers/input/mouse/psmouse-base.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index de7e8bc17b1f..ee91bd39bb08 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c | |||
@@ -1092,28 +1092,33 @@ static void psmouse_initialize(struct psmouse *psmouse) | |||
1092 | * psmouse_activate() enables the mouse so that we get motion reports from it. | 1092 | * psmouse_activate() enables the mouse so that we get motion reports from it. |
1093 | */ | 1093 | */ |
1094 | 1094 | ||
1095 | static void psmouse_activate(struct psmouse *psmouse) | 1095 | int psmouse_activate(struct psmouse *psmouse) |
1096 | { | 1096 | { |
1097 | if (ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_ENABLE)) | 1097 | if (ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_ENABLE)) { |
1098 | psmouse_warn(psmouse, "Failed to enable mouse on %s\n", | 1098 | psmouse_warn(psmouse, "Failed to enable mouse on %s\n", |
1099 | psmouse->ps2dev.serio->phys); | 1099 | psmouse->ps2dev.serio->phys); |
1100 | return -1; | ||
1101 | } | ||
1100 | 1102 | ||
1101 | psmouse_set_state(psmouse, PSMOUSE_ACTIVATED); | 1103 | psmouse_set_state(psmouse, PSMOUSE_ACTIVATED); |
1104 | return 0; | ||
1102 | } | 1105 | } |
1103 | 1106 | ||
1104 | |||
1105 | /* | 1107 | /* |
1106 | * psmouse_deactivate() puts the mouse into poll mode so that we don't get motion | 1108 | * psmouse_deactivate() puts the mouse into poll mode so that we don't get motion |
1107 | * reports from it unless we explicitly request it. | 1109 | * reports from it unless we explicitly request it. |
1108 | */ | 1110 | */ |
1109 | 1111 | ||
1110 | static void psmouse_deactivate(struct psmouse *psmouse) | 1112 | int psmouse_deactivate(struct psmouse *psmouse) |
1111 | { | 1113 | { |
1112 | if (ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_DISABLE)) | 1114 | if (ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_DISABLE)) { |
1113 | psmouse_warn(psmouse, "Failed to deactivate mouse on %s\n", | 1115 | psmouse_warn(psmouse, "Failed to deactivate mouse on %s\n", |
1114 | psmouse->ps2dev.serio->phys); | 1116 | psmouse->ps2dev.serio->phys); |
1117 | return -1; | ||
1118 | } | ||
1115 | 1119 | ||
1116 | psmouse_set_state(psmouse, PSMOUSE_CMD_MODE); | 1120 | psmouse_set_state(psmouse, PSMOUSE_CMD_MODE); |
1121 | return 0; | ||
1117 | } | 1122 | } |
1118 | 1123 | ||
1119 | 1124 | ||