Lines Matching +full:touchscreen +full:- +full:average +full:- +full:samples
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Driver for MAXI MAX11801 - A Resistive touch screen controller with
16 * -----------------------------------------------------
18 * |----------------------------------------------------|
23 * ------------------------------------------------------
28 * http://www.maxim-ic.com/datasheet/index.mvp/id/5943
98 struct i2c_client *client = data->client; in max11801_ts_interrupt()
101 int x = -1; in max11801_ts_interrupt()
102 int y = -1; in max11801_ts_interrupt()
104 status = read_register(data->client, GENERNAL_STATUS_REG); in max11801_ts_interrupt()
107 status = read_register(data->client, GENERNAL_STATUS_REG); in max11801_ts_interrupt()
134 input_report_abs(data->input_dev, ABS_X, x); in max11801_ts_interrupt()
135 input_report_abs(data->input_dev, ABS_Y, y); in max11801_ts_interrupt()
136 input_event(data->input_dev, EV_KEY, BTN_TOUCH, 1); in max11801_ts_interrupt()
137 input_sync(data->input_dev); in max11801_ts_interrupt()
141 input_event(data->input_dev, EV_KEY, BTN_TOUCH, 0); in max11801_ts_interrupt()
142 input_sync(data->input_dev); in max11801_ts_interrupt()
155 struct i2c_client *client = data->client; in max11801_ts_phy_init()
157 /* Average X,Y, take 16 samples, average eight media sample */ in max11801_ts_phy_init()
165 /* Aperture X,Y set to +- 4LSB */ in max11801_ts_phy_init()
167 /* Enable Power, enable Automode, enable Aperture, enable Average X,Y */ in max11801_ts_phy_init()
178 data = devm_kzalloc(&client->dev, sizeof(*data), GFP_KERNEL); in max11801_ts_probe()
179 input_dev = devm_input_allocate_device(&client->dev); in max11801_ts_probe()
181 dev_err(&client->dev, "Failed to allocate memory\n"); in max11801_ts_probe()
182 return -ENOMEM; in max11801_ts_probe()
185 data->client = client; in max11801_ts_probe()
186 data->input_dev = input_dev; in max11801_ts_probe()
188 input_dev->name = "max11801_ts"; in max11801_ts_probe()
189 input_dev->id.bustype = BUS_I2C; in max11801_ts_probe()
190 input_dev->dev.parent = &client->dev; in max11801_ts_probe()
192 __set_bit(EV_ABS, input_dev->evbit); in max11801_ts_probe()
193 __set_bit(EV_KEY, input_dev->evbit); in max11801_ts_probe()
194 __set_bit(BTN_TOUCH, input_dev->keybit); in max11801_ts_probe()
200 error = devm_request_threaded_irq(&client->dev, client->irq, NULL, in max11801_ts_probe()
205 dev_err(&client->dev, "Failed to register interrupt\n"); in max11801_ts_probe()
209 error = input_register_device(data->input_dev); in max11801_ts_probe()
240 MODULE_DESCRIPTION("Touchscreen driver for MAXI MAX11801 controller");