aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/misc/twl4030-vibra.c
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2013-01-11 12:05:47 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2013-01-21 20:31:08 -0500
commit4a31ba37b7ed39c9c7178da6e6df7bce63ffc56f (patch)
tree561e152ccf124b1584873689bf256c78083f9d15 /drivers/input/misc/twl4030-vibra.c
parentc3ead16e7094076607d7c7c47aee280209d829f7 (diff)
Input: twl4030-vibra - Use system workqueue
It is time to switch to system wq instead creating a queue for the driver. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/misc/twl4030-vibra.c')
-rw-r--r--drivers/input/misc/twl4030-vibra.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/drivers/input/misc/twl4030-vibra.c b/drivers/input/misc/twl4030-vibra.c
index e2e2a261e02a..68a5f33152a8 100644
--- a/drivers/input/misc/twl4030-vibra.c
+++ b/drivers/input/misc/twl4030-vibra.c
@@ -43,7 +43,6 @@ struct vibra_info {
43 struct device *dev; 43 struct device *dev;
44 struct input_dev *input_dev; 44 struct input_dev *input_dev;
45 45
46 struct workqueue_struct *workqueue;
47 struct work_struct play_work; 46 struct work_struct play_work;
48 47
49 bool enabled; 48 bool enabled;
@@ -143,19 +142,7 @@ static int vibra_play(struct input_dev *input, void *data,
143 if (!info->speed) 142 if (!info->speed)
144 info->speed = effect->u.rumble.weak_magnitude >> 9; 143 info->speed = effect->u.rumble.weak_magnitude >> 9;
145 info->direction = effect->direction < EFFECT_DIR_180_DEG ? 0 : 1; 144 info->direction = effect->direction < EFFECT_DIR_180_DEG ? 0 : 1;
146 queue_work(info->workqueue, &info->play_work); 145 schedule_work(&info->play_work);
147 return 0;
148}
149
150static int twl4030_vibra_open(struct input_dev *input)
151{
152 struct vibra_info *info = input_get_drvdata(input);
153
154 info->workqueue = create_singlethread_workqueue("vibra");
155 if (info->workqueue == NULL) {
156 dev_err(&input->dev, "couldn't create workqueue\n");
157 return -ENOMEM;
158 }
159 return 0; 146 return 0;
160} 147}
161 148
@@ -164,9 +151,6 @@ static void twl4030_vibra_close(struct input_dev *input)
164 struct vibra_info *info = input_get_drvdata(input); 151 struct vibra_info *info = input_get_drvdata(input);
165 152
166 cancel_work_sync(&info->play_work); 153 cancel_work_sync(&info->play_work);
167 INIT_WORK(&info->play_work, vibra_play_work); /* cleanup */
168 destroy_workqueue(info->workqueue);
169 info->workqueue = NULL;
170 154
171 if (info->enabled) 155 if (info->enabled)
172 vibra_disable(info); 156 vibra_disable(info);
@@ -238,7 +222,6 @@ static int twl4030_vibra_probe(struct platform_device *pdev)
238 info->input_dev->name = "twl4030:vibrator"; 222 info->input_dev->name = "twl4030:vibrator";
239 info->input_dev->id.version = 1; 223 info->input_dev->id.version = 1;
240 info->input_dev->dev.parent = pdev->dev.parent; 224 info->input_dev->dev.parent = pdev->dev.parent;
241 info->input_dev->open = twl4030_vibra_open;
242 info->input_dev->close = twl4030_vibra_close; 225 info->input_dev->close = twl4030_vibra_close;
243 __set_bit(FF_RUMBLE, info->input_dev->ffbit); 226 __set_bit(FF_RUMBLE, info->input_dev->ffbit);
244 227