diff options
author | Paul Fox <pgf@laptop.org> | 2012-02-24 03:51:37 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-02-24 03:55:33 -0500 |
commit | c35c0e7d425c11f629d9d037df6c37a7ffebcd96 (patch) | |
tree | 7f9c328b6677062e6f273a1bfd43c4031844af28 /drivers/input/mouse | |
parent | bd26f3d6fbb84f101f3e78f0591415d1c407976a (diff) |
Input: psmouse - use psmouse_[de]activate() from sentelic and hgpk drivers
Make use of psmouse_activate() and psmouse_deactivate() from psmouse-base.c
Signed-off-by: Andres Salomon <dilinger@queued.net>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/mouse')
-rw-r--r-- | drivers/input/mouse/hgpk.c | 9 | ||||
-rw-r--r-- | drivers/input/mouse/sentelic.c | 12 |
2 files changed, 6 insertions, 15 deletions
diff --git a/drivers/input/mouse/hgpk.c b/drivers/input/mouse/hgpk.c index 1c5d521de600..575f880727fe 100644 --- a/drivers/input/mouse/hgpk.c +++ b/drivers/input/mouse/hgpk.c | |||
@@ -640,7 +640,6 @@ static int hgpk_reset_device(struct psmouse *psmouse, bool recalibrate) | |||
640 | 640 | ||
641 | static int hgpk_force_recalibrate(struct psmouse *psmouse) | 641 | static int hgpk_force_recalibrate(struct psmouse *psmouse) |
642 | { | 642 | { |
643 | struct ps2dev *ps2dev = &psmouse->ps2dev; | ||
644 | struct hgpk_data *priv = psmouse->private; | 643 | struct hgpk_data *priv = psmouse->private; |
645 | int err; | 644 | int err; |
646 | 645 | ||
@@ -669,12 +668,9 @@ static int hgpk_force_recalibrate(struct psmouse *psmouse) | |||
669 | * we don't have a good way to deal with it. The 2s window stuff | 668 | * we don't have a good way to deal with it. The 2s window stuff |
670 | * (below) is our best option for now. | 669 | * (below) is our best option for now. |
671 | */ | 670 | */ |
672 | 671 | if (psmouse_activate(psmouse)) | |
673 | if (ps2_command(ps2dev, NULL, PSMOUSE_CMD_ENABLE)) | ||
674 | return -1; | 672 | return -1; |
675 | 673 | ||
676 | psmouse_set_state(psmouse, PSMOUSE_ACTIVATED); | ||
677 | |||
678 | if (tpdebug) | 674 | if (tpdebug) |
679 | psmouse_dbg(psmouse, "touchpad reactivated\n"); | 675 | psmouse_dbg(psmouse, "touchpad reactivated\n"); |
680 | 676 | ||
@@ -733,8 +729,7 @@ static int hgpk_toggle_powersave(struct psmouse *psmouse, int enable) | |||
733 | } | 729 | } |
734 | 730 | ||
735 | /* should be all set, enable the touchpad */ | 731 | /* should be all set, enable the touchpad */ |
736 | ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_ENABLE); | 732 | psmouse_activate(psmouse); |
737 | psmouse_set_state(psmouse, PSMOUSE_ACTIVATED); | ||
738 | psmouse_dbg(psmouse, "Touchpad powered up.\n"); | 733 | psmouse_dbg(psmouse, "Touchpad powered up.\n"); |
739 | } else { | 734 | } else { |
740 | psmouse_dbg(psmouse, "Powering off touchpad.\n"); | 735 | psmouse_dbg(psmouse, "Powering off touchpad.\n"); |
diff --git a/drivers/input/mouse/sentelic.c b/drivers/input/mouse/sentelic.c index 5babc47b39aa..bab2d19e17f7 100644 --- a/drivers/input/mouse/sentelic.c +++ b/drivers/input/mouse/sentelic.c | |||
@@ -90,8 +90,7 @@ static int fsp_reg_read(struct psmouse *psmouse, int reg_addr, int *reg_val) | |||
90 | * to do that for writes because sysfs set helper does this for | 90 | * to do that for writes because sysfs set helper does this for |
91 | * us. | 91 | * us. |
92 | */ | 92 | */ |
93 | ps2_command(ps2dev, NULL, PSMOUSE_CMD_DISABLE); | 93 | psmouse_deactivate(psmouse); |
94 | psmouse_set_state(psmouse, PSMOUSE_CMD_MODE); | ||
95 | 94 | ||
96 | ps2_begin_command(ps2dev); | 95 | ps2_begin_command(ps2dev); |
97 | 96 | ||
@@ -128,8 +127,7 @@ static int fsp_reg_read(struct psmouse *psmouse, int reg_addr, int *reg_val) | |||
128 | 127 | ||
129 | out: | 128 | out: |
130 | ps2_end_command(ps2dev); | 129 | ps2_end_command(ps2dev); |
131 | ps2_command(ps2dev, NULL, PSMOUSE_CMD_ENABLE); | 130 | psmouse_activate(psmouse); |
132 | psmouse_set_state(psmouse, PSMOUSE_ACTIVATED); | ||
133 | dev_dbg(&ps2dev->serio->dev, "READ REG: 0x%02x is 0x%02x (rc = %d)\n", | 131 | dev_dbg(&ps2dev->serio->dev, "READ REG: 0x%02x is 0x%02x (rc = %d)\n", |
134 | reg_addr, *reg_val, rc); | 132 | reg_addr, *reg_val, rc); |
135 | return rc; | 133 | return rc; |
@@ -213,8 +211,7 @@ static int fsp_page_reg_read(struct psmouse *psmouse, int *reg_val) | |||
213 | unsigned char param[3]; | 211 | unsigned char param[3]; |
214 | int rc = -1; | 212 | int rc = -1; |
215 | 213 | ||
216 | ps2_command(ps2dev, NULL, PSMOUSE_CMD_DISABLE); | 214 | psmouse_deactivate(psmouse); |
217 | psmouse_set_state(psmouse, PSMOUSE_CMD_MODE); | ||
218 | 215 | ||
219 | ps2_begin_command(ps2dev); | 216 | ps2_begin_command(ps2dev); |
220 | 217 | ||
@@ -239,8 +236,7 @@ static int fsp_page_reg_read(struct psmouse *psmouse, int *reg_val) | |||
239 | 236 | ||
240 | out: | 237 | out: |
241 | ps2_end_command(ps2dev); | 238 | ps2_end_command(ps2dev); |
242 | ps2_command(ps2dev, NULL, PSMOUSE_CMD_ENABLE); | 239 | psmouse_activate(psmouse); |
243 | psmouse_set_state(psmouse, PSMOUSE_ACTIVATED); | ||
244 | dev_dbg(&ps2dev->serio->dev, "READ PAGE REG: 0x%02x (rc = %d)\n", | 240 | dev_dbg(&ps2dev->serio->dev, "READ PAGE REG: 0x%02x (rc = %d)\n", |
245 | *reg_val, rc); | 241 | *reg_val, rc); |
246 | return rc; | 242 | return rc; |