Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 115067
b: refs/heads/master
c: 8bf020e
h: refs/heads/master
i:
  115065: 185708a
  115063: c2fe2fd
v: v3
  • Loading branch information
Andres Salomon authored and Dmitry Torokhov committed Sep 21, 2008
1 parent 596a030 commit 4be073d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a48cf5f3e5aef5ecb667f954ae1ae2a9b875465f
refs/heads/master: 8bf020ee9650899a45295d0c3a0744d4d1bf2801
14 changes: 10 additions & 4 deletions trunk/drivers/input/mouse/psmouse-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,12 @@ static psmouse_ret_t psmouse_process_byte(struct psmouse *psmouse)
return PSMOUSE_FULL_PACKET;
}

void psmouse_queue_work(struct psmouse *psmouse, struct delayed_work *work,
unsigned long delay)
{
queue_delayed_work(kpsmoused_wq, work, delay);
}

/*
* __psmouse_set_state() sets new psmouse state and resets all flags.
*/
Expand Down Expand Up @@ -305,7 +311,7 @@ static irqreturn_t psmouse_interrupt(struct serio *serio,
psmouse->name, psmouse->phys, psmouse->pktcnt);
psmouse->badbyte = psmouse->packet[0];
__psmouse_set_state(psmouse, PSMOUSE_RESYNCING);
queue_work(kpsmoused_wq, &psmouse->resync_work);
psmouse_queue_work(psmouse, &psmouse->resync_work, 0);
goto out;
}

Expand Down Expand Up @@ -342,7 +348,7 @@ static irqreturn_t psmouse_interrupt(struct serio *serio,
time_after(jiffies, psmouse->last + psmouse->resync_time * HZ)) {
psmouse->badbyte = psmouse->packet[0];
__psmouse_set_state(psmouse, PSMOUSE_RESYNCING);
queue_work(kpsmoused_wq, &psmouse->resync_work);
psmouse_queue_work(psmouse, &psmouse->resync_work, 0);
goto out;
}

Expand Down Expand Up @@ -935,7 +941,7 @@ static int psmouse_poll(struct psmouse *psmouse)
static void psmouse_resync(struct work_struct *work)
{
struct psmouse *parent = NULL, *psmouse =
container_of(work, struct psmouse, resync_work);
container_of(work, struct psmouse, resync_work.work);
struct serio *serio = psmouse->ps2dev.serio;
psmouse_ret_t rc = PSMOUSE_GOOD_DATA;
int failed = 0, enabled = 0;
Expand Down Expand Up @@ -1194,7 +1200,7 @@ static int psmouse_connect(struct serio *serio, struct serio_driver *drv)
goto err_free;

ps2_init(&psmouse->ps2dev, serio);
INIT_WORK(&psmouse->resync_work, psmouse_resync);
INIT_DELAYED_WORK(&psmouse->resync_work, psmouse_resync);
psmouse->dev = input_dev;
snprintf(psmouse->phys, sizeof(psmouse->phys), "%s/input0", serio->phys);

Expand Down
4 changes: 3 additions & 1 deletion trunk/drivers/input/mouse/psmouse.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct psmouse {
void *private;
struct input_dev *dev;
struct ps2dev ps2dev;
struct work_struct resync_work;
struct delayed_work resync_work;
char *vendor;
char *name;
unsigned char packet[8];
Expand Down Expand Up @@ -92,6 +92,8 @@ enum psmouse_type {
PSMOUSE_AUTO /* This one should always be last */
};

void psmouse_queue_work(struct psmouse *psmouse, struct delayed_work *work,
unsigned long delay);
int psmouse_sliced_command(struct psmouse *psmouse, unsigned char command);
int psmouse_reset(struct psmouse *psmouse);
void psmouse_set_state(struct psmouse *psmouse, enum psmouse_state new_state);
Expand Down

0 comments on commit 4be073d

Please sign in to comment.