Lines Matching refs:mtouch
53 struct mtouch { struct
61 static void mtouch_process_format_tablet(struct mtouch *mtouch) in mtouch_process_format_tablet() argument
63 struct input_dev *dev = mtouch->dev; in mtouch_process_format_tablet()
65 if (MTOUCH_FORMAT_TABLET_LENGTH == ++mtouch->idx) { in mtouch_process_format_tablet()
66 input_report_abs(dev, ABS_X, MTOUCH_GET_XC(mtouch->data)); in mtouch_process_format_tablet()
67 input_report_abs(dev, ABS_Y, MTOUCH_MAX_YC - MTOUCH_GET_YC(mtouch->data)); in mtouch_process_format_tablet()
68 input_report_key(dev, BTN_TOUCH, MTOUCH_GET_TOUCHED(mtouch->data)); in mtouch_process_format_tablet()
71 mtouch->idx = 0; in mtouch_process_format_tablet()
75 static void mtouch_process_response(struct mtouch *mtouch) in mtouch_process_response() argument
77 if (MTOUCH_RESPONSE_END_BYTE == mtouch->data[mtouch->idx++]) { in mtouch_process_response()
79 mtouch->idx = 0; in mtouch_process_response()
80 } else if (MTOUCH_MAX_LENGTH == mtouch->idx) { in mtouch_process_response()
82 mtouch->idx = 0; in mtouch_process_response()
89 struct mtouch *mtouch = serio_get_drvdata(serio); in mtouch_interrupt() local
91 mtouch->data[mtouch->idx] = data; in mtouch_interrupt()
93 if (MTOUCH_FORMAT_TABLET_STATUS_BIT & mtouch->data[0]) in mtouch_interrupt()
94 mtouch_process_format_tablet(mtouch); in mtouch_interrupt()
95 else if (MTOUCH_RESPONSE_BEGIN_BYTE == mtouch->data[0]) in mtouch_interrupt()
96 mtouch_process_response(mtouch); in mtouch_interrupt()
98 printk(KERN_DEBUG "mtouch.c: unknown/unsynchronized data from device, byte %x\n",mtouch->data[0]); in mtouch_interrupt()
109 struct mtouch *mtouch = serio_get_drvdata(serio); in mtouch_disconnect() local
111 input_get_device(mtouch->dev); in mtouch_disconnect()
112 input_unregister_device(mtouch->dev); in mtouch_disconnect()
115 input_put_device(mtouch->dev); in mtouch_disconnect()
116 kfree(mtouch); in mtouch_disconnect()
127 struct mtouch *mtouch; in mtouch_connect() local
131 mtouch = kzalloc(sizeof(struct mtouch), GFP_KERNEL); in mtouch_connect()
133 if (!mtouch || !input_dev) { in mtouch_connect()
138 mtouch->serio = serio; in mtouch_connect()
139 mtouch->dev = input_dev; in mtouch_connect()
140 snprintf(mtouch->phys, sizeof(mtouch->phys), "%s/input0", serio->phys); in mtouch_connect()
143 input_dev->phys = mtouch->phys; in mtouch_connect()
151 input_set_abs_params(mtouch->dev, ABS_X, MTOUCH_MIN_XC, MTOUCH_MAX_XC, 0, 0); in mtouch_connect()
152 input_set_abs_params(mtouch->dev, ABS_Y, MTOUCH_MIN_YC, MTOUCH_MAX_YC, 0, 0); in mtouch_connect()
154 serio_set_drvdata(serio, mtouch); in mtouch_connect()
160 err = input_register_device(mtouch->dev); in mtouch_connect()
169 kfree(mtouch); in mtouch_connect()