diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-10-27 06:46:20 +0200 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-10-27 06:46:20 +0200 |
commit | 6ad390a25a9d1d8606b9b826878f0a30639dc2b3 (patch) | |
tree | 05aff14f02776bc0d59a1f777cb92df6f4456ba9 /drivers/input/touchscreen/wacom_w8001.c | |
parent | Input: wacom - revert "Cintiq 21UX2 does not have menu strips" (diff) | |
parent | Input: adp5589-keys - add support for the ADP5585 derivatives (diff) | |
download | linux-6ad390a25a9d1d8606b9b826878f0a30639dc2b3.tar.xz linux-6ad390a25a9d1d8606b9b826878f0a30639dc2b3.zip |
Merge branch 'next' into for-linus
Diffstat (limited to 'drivers/input/touchscreen/wacom_w8001.c')
-rw-r--r-- | drivers/input/touchscreen/wacom_w8001.c | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/drivers/input/touchscreen/wacom_w8001.c b/drivers/input/touchscreen/wacom_w8001.c index 9941d39df43d..1569a3934ab2 100644 --- a/drivers/input/touchscreen/wacom_w8001.c +++ b/drivers/input/touchscreen/wacom_w8001.c @@ -367,6 +367,20 @@ static int w8001_command(struct w8001 *w8001, unsigned char command, return rc; } +static int w8001_open(struct input_dev *dev) +{ + struct w8001 *w8001 = input_get_drvdata(dev); + + return w8001_command(w8001, W8001_CMD_START, false); +} + +static void w8001_close(struct input_dev *dev) +{ + struct w8001 *w8001 = input_get_drvdata(dev); + + w8001_command(w8001, W8001_CMD_STOP, false); +} + static int w8001_setup(struct w8001 *w8001) { struct input_dev *dev = w8001->dev; @@ -476,7 +490,7 @@ static int w8001_setup(struct w8001 *w8001) strlcat(w8001->name, " Touchscreen", sizeof(w8001->name)); - return w8001_command(w8001, W8001_CMD_START, false); + return 0; } /* @@ -487,12 +501,12 @@ static void w8001_disconnect(struct serio *serio) { struct w8001 *w8001 = serio_get_drvdata(serio); - input_get_device(w8001->dev); - input_unregister_device(w8001->dev); serio_close(serio); - serio_set_drvdata(serio, NULL); - input_put_device(w8001->dev); + + input_unregister_device(w8001->dev); kfree(w8001); + + serio_set_drvdata(serio, NULL); } /* @@ -536,6 +550,11 @@ static int w8001_connect(struct serio *serio, struct serio_driver *drv) input_dev->id.version = 0x0100; input_dev->dev.parent = &serio->dev; + input_dev->open = w8001_open; + input_dev->close = w8001_close; + + input_set_drvdata(input_dev, w8001); + err = input_register_device(w8001->dev); if (err) goto fail3; |