diff options
author | Andres Salomon <dilinger@queued.net> | 2008-09-16 12:30:33 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2008-09-21 18:28:36 -0400 |
commit | 8bf020ee9650899a45295d0c3a0744d4d1bf2801 (patch) | |
tree | 8662aec5256de22eb43438facce3976f776a3559 | |
parent | a48cf5f3e5aef5ecb667f954ae1ae2a9b875465f (diff) |
Input: psmouse - add psmouse_queue_work() for ps/2 extension to make use of
psmouse_queue_work is passed a delayed_work struct, and queues up the work
with kpsmouse_wq. Since we're dealing with delayed_work stuff, this
also switches resync_work to a delayed_work struct as well, and makes
use of psmouse_queue_work when doing a resync within psmouse-base.
Signed-off-by: Andres Salomon <dilinger@debian.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-rw-r--r-- | drivers/input/mouse/psmouse-base.c | 14 | ||||
-rw-r--r-- | drivers/input/mouse/psmouse.h | 4 |
2 files changed, 13 insertions, 5 deletions
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index 291da6285b18..3c76f6f9c835 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c | |||
@@ -201,6 +201,12 @@ static psmouse_ret_t psmouse_process_byte(struct psmouse *psmouse) | |||
201 | return PSMOUSE_FULL_PACKET; | 201 | return PSMOUSE_FULL_PACKET; |
202 | } | 202 | } |
203 | 203 | ||
204 | void psmouse_queue_work(struct psmouse *psmouse, struct delayed_work *work, | ||
205 | unsigned long delay) | ||
206 | { | ||
207 | queue_delayed_work(kpsmoused_wq, work, delay); | ||
208 | } | ||
209 | |||
204 | /* | 210 | /* |
205 | * __psmouse_set_state() sets new psmouse state and resets all flags. | 211 | * __psmouse_set_state() sets new psmouse state and resets all flags. |
206 | */ | 212 | */ |
@@ -305,7 +311,7 @@ static irqreturn_t psmouse_interrupt(struct serio *serio, | |||
305 | psmouse->name, psmouse->phys, psmouse->pktcnt); | 311 | psmouse->name, psmouse->phys, psmouse->pktcnt); |
306 | psmouse->badbyte = psmouse->packet[0]; | 312 | psmouse->badbyte = psmouse->packet[0]; |
307 | __psmouse_set_state(psmouse, PSMOUSE_RESYNCING); | 313 | __psmouse_set_state(psmouse, PSMOUSE_RESYNCING); |
308 | queue_work(kpsmoused_wq, &psmouse->resync_work); | 314 | psmouse_queue_work(psmouse, &psmouse->resync_work, 0); |
309 | goto out; | 315 | goto out; |
310 | } | 316 | } |
311 | 317 | ||
@@ -342,7 +348,7 @@ static irqreturn_t psmouse_interrupt(struct serio *serio, | |||
342 | time_after(jiffies, psmouse->last + psmouse->resync_time * HZ)) { | 348 | time_after(jiffies, psmouse->last + psmouse->resync_time * HZ)) { |
343 | psmouse->badbyte = psmouse->packet[0]; | 349 | psmouse->badbyte = psmouse->packet[0]; |
344 | __psmouse_set_state(psmouse, PSMOUSE_RESYNCING); | 350 | __psmouse_set_state(psmouse, PSMOUSE_RESYNCING); |
345 | queue_work(kpsmoused_wq, &psmouse->resync_work); | 351 | psmouse_queue_work(psmouse, &psmouse->resync_work, 0); |
346 | goto out; | 352 | goto out; |
347 | } | 353 | } |
348 | 354 | ||
@@ -935,7 +941,7 @@ static int psmouse_poll(struct psmouse *psmouse) | |||
935 | static void psmouse_resync(struct work_struct *work) | 941 | static void psmouse_resync(struct work_struct *work) |
936 | { | 942 | { |
937 | struct psmouse *parent = NULL, *psmouse = | 943 | struct psmouse *parent = NULL, *psmouse = |
938 | container_of(work, struct psmouse, resync_work); | 944 | container_of(work, struct psmouse, resync_work.work); |
939 | struct serio *serio = psmouse->ps2dev.serio; | 945 | struct serio *serio = psmouse->ps2dev.serio; |
940 | psmouse_ret_t rc = PSMOUSE_GOOD_DATA; | 946 | psmouse_ret_t rc = PSMOUSE_GOOD_DATA; |
941 | int failed = 0, enabled = 0; | 947 | int failed = 0, enabled = 0; |
@@ -1194,7 +1200,7 @@ static int psmouse_connect(struct serio *serio, struct serio_driver *drv) | |||
1194 | goto err_free; | 1200 | goto err_free; |
1195 | 1201 | ||
1196 | ps2_init(&psmouse->ps2dev, serio); | 1202 | ps2_init(&psmouse->ps2dev, serio); |
1197 | INIT_WORK(&psmouse->resync_work, psmouse_resync); | 1203 | INIT_DELAYED_WORK(&psmouse->resync_work, psmouse_resync); |
1198 | psmouse->dev = input_dev; | 1204 | psmouse->dev = input_dev; |
1199 | snprintf(psmouse->phys, sizeof(psmouse->phys), "%s/input0", serio->phys); | 1205 | snprintf(psmouse->phys, sizeof(psmouse->phys), "%s/input0", serio->phys); |
1200 | 1206 | ||
diff --git a/drivers/input/mouse/psmouse.h b/drivers/input/mouse/psmouse.h index ed40415f0067..48e0112fb264 100644 --- a/drivers/input/mouse/psmouse.h +++ b/drivers/input/mouse/psmouse.h | |||
@@ -39,7 +39,7 @@ struct psmouse { | |||
39 | void *private; | 39 | void *private; |
40 | struct input_dev *dev; | 40 | struct input_dev *dev; |
41 | struct ps2dev ps2dev; | 41 | struct ps2dev ps2dev; |
42 | struct work_struct resync_work; | 42 | struct delayed_work resync_work; |
43 | char *vendor; | 43 | char *vendor; |
44 | char *name; | 44 | char *name; |
45 | unsigned char packet[8]; | 45 | unsigned char packet[8]; |
@@ -92,6 +92,8 @@ enum psmouse_type { | |||
92 | PSMOUSE_AUTO /* This one should always be last */ | 92 | PSMOUSE_AUTO /* This one should always be last */ |
93 | }; | 93 | }; |
94 | 94 | ||
95 | void psmouse_queue_work(struct psmouse *psmouse, struct delayed_work *work, | ||
96 | unsigned long delay); | ||
95 | int psmouse_sliced_command(struct psmouse *psmouse, unsigned char command); | 97 | int psmouse_sliced_command(struct psmouse *psmouse, unsigned char command); |
96 | int psmouse_reset(struct psmouse *psmouse); | 98 | int psmouse_reset(struct psmouse *psmouse); |
97 | void psmouse_set_state(struct psmouse *psmouse, enum psmouse_state new_state); | 99 | void psmouse_set_state(struct psmouse *psmouse, enum psmouse_state new_state); |