.. | .. |
---|
17 | 17 | #include <linux/workqueue.h> |
---|
18 | 18 | #include <linux/slab.h> |
---|
19 | 19 | #include <linux/input.h> |
---|
20 | | -#include <linux/input-polldev.h> |
---|
21 | 20 | #include <linux/platform_device.h> |
---|
22 | 21 | #include <linux/mfd/tps6507x.h> |
---|
23 | 22 | #include <linux/input/tps6507x-ts.h> |
---|
.. | .. |
---|
40 | 39 | |
---|
41 | 40 | struct tps6507x_ts { |
---|
42 | 41 | struct device *dev; |
---|
43 | | - struct input_polled_dev *poll_dev; |
---|
| 42 | + struct input_dev *input; |
---|
44 | 43 | struct tps6507x_dev *mfd; |
---|
45 | 44 | char phys[32]; |
---|
46 | 45 | struct ts_event tc; |
---|
.. | .. |
---|
148 | 147 | return ret; |
---|
149 | 148 | } |
---|
150 | 149 | |
---|
151 | | -static void tps6507x_ts_poll(struct input_polled_dev *poll_dev) |
---|
| 150 | +static void tps6507x_ts_poll(struct input_dev *input_dev) |
---|
152 | 151 | { |
---|
153 | | - struct tps6507x_ts *tsc = poll_dev->private; |
---|
154 | | - struct input_dev *input_dev = poll_dev->input; |
---|
| 152 | + struct tps6507x_ts *tsc = input_get_drvdata(input_dev); |
---|
155 | 153 | bool pendown; |
---|
156 | 154 | s32 ret; |
---|
157 | 155 | |
---|
.. | .. |
---|
205 | 203 | const struct tps6507x_board *tps_board; |
---|
206 | 204 | const struct touchscreen_init_data *init_data; |
---|
207 | 205 | struct tps6507x_ts *tsc; |
---|
208 | | - struct input_polled_dev *poll_dev; |
---|
209 | 206 | struct input_dev *input_dev; |
---|
210 | 207 | int error; |
---|
211 | 208 | |
---|
.. | .. |
---|
240 | 237 | snprintf(tsc->phys, sizeof(tsc->phys), |
---|
241 | 238 | "%s/input0", dev_name(tsc->dev)); |
---|
242 | 239 | |
---|
243 | | - poll_dev = devm_input_allocate_polled_device(&pdev->dev); |
---|
244 | | - if (!poll_dev) { |
---|
| 240 | + input_dev = devm_input_allocate_device(&pdev->dev); |
---|
| 241 | + if (!input_dev) { |
---|
245 | 242 | dev_err(tsc->dev, "Failed to allocate polled input device.\n"); |
---|
246 | 243 | return -ENOMEM; |
---|
247 | 244 | } |
---|
248 | 245 | |
---|
249 | | - tsc->poll_dev = poll_dev; |
---|
| 246 | + tsc->input = input_dev; |
---|
| 247 | + input_set_drvdata(input_dev, tsc); |
---|
250 | 248 | |
---|
251 | | - poll_dev->private = tsc; |
---|
252 | | - poll_dev->poll = tps6507x_ts_poll; |
---|
253 | | - poll_dev->poll_interval = init_data ? |
---|
254 | | - init_data->poll_period : TSC_DEFAULT_POLL_PERIOD; |
---|
255 | | - |
---|
256 | | - input_dev = poll_dev->input; |
---|
257 | | - input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); |
---|
258 | | - input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); |
---|
259 | | - |
---|
| 249 | + input_set_capability(input_dev, EV_KEY, BTN_TOUCH); |
---|
260 | 250 | input_set_abs_params(input_dev, ABS_X, 0, MAX_10BIT, 0, 0); |
---|
261 | 251 | input_set_abs_params(input_dev, ABS_Y, 0, MAX_10BIT, 0, 0); |
---|
262 | 252 | input_set_abs_params(input_dev, ABS_PRESSURE, 0, MAX_10BIT, 0, 0); |
---|
.. | .. |
---|
275 | 265 | if (error) |
---|
276 | 266 | return error; |
---|
277 | 267 | |
---|
278 | | - error = input_register_polled_device(poll_dev); |
---|
| 268 | + error = input_setup_polling(input_dev, tps6507x_ts_poll); |
---|
| 269 | + if (error) |
---|
| 270 | + return error; |
---|
| 271 | + |
---|
| 272 | + input_set_poll_interval(input_dev, |
---|
| 273 | + init_data ? init_data->poll_period : |
---|
| 274 | + TSC_DEFAULT_POLL_PERIOD); |
---|
| 275 | + |
---|
| 276 | + error = input_register_device(input_dev); |
---|
279 | 277 | if (error) |
---|
280 | 278 | return error; |
---|
281 | 279 | |
---|