Lines Matching +full:0 +full:- +full:1023

1 // SPDX-License-Identifier: GPL-2.0-only
20 #include <linux/mfd/ipaq-micro.h>
32 input_report_abs(ts->input, ABS_X, in micro_ts_receive()
34 input_report_abs(ts->input, ABS_Y, in micro_ts_receive()
35 be16_to_cpup((__be16 *) &msg[0])); in micro_ts_receive()
36 input_report_key(ts->input, BTN_TOUCH, 1); in micro_ts_receive()
37 input_sync(ts->input); in micro_ts_receive()
38 } else if (len == 0) { in micro_ts_receive()
39 input_report_abs(ts->input, ABS_X, 0); in micro_ts_receive()
40 input_report_abs(ts->input, ABS_Y, 0); in micro_ts_receive()
41 input_report_key(ts->input, BTN_TOUCH, 0); in micro_ts_receive()
42 input_sync(ts->input); in micro_ts_receive()
48 struct ipaq_micro *micro = ts->micro; in micro_ts_toggle_receive()
50 spin_lock_irq(&micro->lock); in micro_ts_toggle_receive()
53 micro->ts = micro_ts_receive; in micro_ts_toggle_receive()
54 micro->ts_data = ts; in micro_ts_toggle_receive()
56 micro->ts = NULL; in micro_ts_toggle_receive()
57 micro->ts_data = NULL; in micro_ts_toggle_receive()
60 spin_unlock_irq(&ts->micro->lock); in micro_ts_toggle_receive()
69 return 0; in micro_ts_open()
81 struct ipaq_micro *micro = dev_get_drvdata(pdev->dev.parent); in micro_ts_probe()
85 ts = devm_kzalloc(&pdev->dev, sizeof(*ts), GFP_KERNEL); in micro_ts_probe()
87 return -ENOMEM; in micro_ts_probe()
89 ts->micro = micro; in micro_ts_probe()
91 ts->input = devm_input_allocate_device(&pdev->dev); in micro_ts_probe()
92 if (!ts->input) { in micro_ts_probe()
93 dev_err(&pdev->dev, "failed to allocate input device\n"); in micro_ts_probe()
94 return -ENOMEM; in micro_ts_probe()
97 ts->input->name = "ipaq micro ts"; in micro_ts_probe()
98 ts->input->open = micro_ts_open; in micro_ts_probe()
99 ts->input->close = micro_ts_close; in micro_ts_probe()
101 input_set_drvdata(ts->input, ts); in micro_ts_probe()
103 input_set_capability(ts->input, EV_KEY, BTN_TOUCH); in micro_ts_probe()
104 input_set_capability(ts->input, EV_ABS, ABS_X); in micro_ts_probe()
105 input_set_capability(ts->input, EV_ABS, ABS_Y); in micro_ts_probe()
106 input_set_abs_params(ts->input, ABS_X, 0, 1023, 0, 0); in micro_ts_probe()
107 input_set_abs_params(ts->input, ABS_Y, 0, 1023, 0, 0); in micro_ts_probe()
109 error = input_register_device(ts->input); in micro_ts_probe()
111 dev_err(&pdev->dev, "error registering touch input\n"); in micro_ts_probe()
117 dev_info(&pdev->dev, "iPAQ micro touchscreen\n"); in micro_ts_probe()
119 return 0; in micro_ts_probe()
128 return 0; in micro_ts_suspend()
134 struct input_dev *input = ts->input; in micro_ts_resume()
136 mutex_lock(&input->mutex); in micro_ts_resume()
138 if (input->users) in micro_ts_resume()
141 mutex_unlock(&input->mutex); in micro_ts_resume()
143 return 0; in micro_ts_resume()
152 .name = "ipaq-micro-ts",
161 MODULE_ALIAS("platform:ipaq-micro-ts");