1
2
3
4
5
6
7
8
9
10
11
12#include <linux/of.h>
13#include <linux/input.h>
14#include <linux/input/touchscreen.h>
15
16
17
18
19
20
21
22
23
24void touchscreen_parse_of_params(struct input_dev *dev)
25{
26 struct device_node *np = dev->dev.parent->of_node;
27 struct input_absinfo *absinfo;
28
29 input_alloc_absinfo(dev);
30 if (!dev->absinfo)
31 return;
32
33 absinfo = &dev->absinfo[ABS_X];
34 of_property_read_u32(np, "touchscreen-size-x", &absinfo->maximum);
35 of_property_read_u32(np, "touchscreen-fuzz-x", &absinfo->fuzz);
36
37 absinfo = &dev->absinfo[ABS_Y];
38 of_property_read_u32(np, "touchscreen-size-y", &absinfo->maximum);
39 of_property_read_u32(np, "touchscreen-fuzz-y", &absinfo->fuzz);
40
41 absinfo = &dev->absinfo[ABS_PRESSURE];
42 of_property_read_u32(np, "touchscreen-max-pressure", &absinfo->maximum);
43 of_property_read_u32(np, "touchscreen-fuzz-pressure", &absinfo->fuzz);
44}
45EXPORT_SYMBOL(touchscreen_parse_of_params);
46