Lines Matching refs:tw
48 struct tw { struct
60 struct tw *tw = serio_get_drvdata(serio); in tw_interrupt() argument
61 struct input_dev *dev = tw->dev; in tw_interrupt()
64 tw->touched = 1; in tw_interrupt()
65 tw->data[tw->idx++] = data; in tw_interrupt()
67 if (tw->idx == TW_LENGTH && tw->data[1] == tw->data[2]) { in tw_interrupt()
68 input_report_abs(dev, ABS_X, tw->data[0]); in tw_interrupt()
69 input_report_abs(dev, ABS_Y, tw->data[1]); in tw_interrupt()
72 tw->idx = 0; in tw_interrupt()
74 } else if (tw->touched) { /* untouch */ in tw_interrupt()
77 tw->idx = 0; in tw_interrupt()
78 tw->touched = 0; in tw_interrupt()
90 struct tw *tw = serio_get_drvdata(serio); in tw_disconnect() local
92 input_get_device(tw->dev); in tw_disconnect()
93 input_unregister_device(tw->dev); in tw_disconnect()
96 input_put_device(tw->dev); in tw_disconnect()
97 kfree(tw); in tw_disconnect()
108 struct tw *tw; in tw_connect() local
112 tw = kzalloc(sizeof(struct tw), GFP_KERNEL); in tw_connect()
114 if (!tw || !input_dev) { in tw_connect()
119 tw->serio = serio; in tw_connect()
120 tw->dev = input_dev; in tw_connect()
121 snprintf(tw->phys, sizeof(tw->phys), "%s/input0", serio->phys); in tw_connect()
124 input_dev->phys = tw->phys; in tw_connect()
132 input_set_abs_params(tw->dev, ABS_X, TW_MIN_XC, TW_MAX_XC, 0, 0); in tw_connect()
133 input_set_abs_params(tw->dev, ABS_Y, TW_MIN_YC, TW_MAX_YC, 0, 0); in tw_connect()
135 serio_set_drvdata(serio, tw); in tw_connect()
141 err = input_register_device(tw->dev); in tw_connect()
150 kfree(tw); in tw_connect()