Lines Matching +full:irq +full:- +full:can +full:- +full:wake
1 // SPDX-License-Identifier: GPL-2.0
14 - auto idle mode support
22 #include <linux/irq.h>
31 * which can only report one point at a given time.
64 static irqreturn_t egalax_ts_interrupt(int irq, void *dev_id) in egalax_ts_interrupt() argument
67 struct input_dev *input_dev = ts->input_dev; in egalax_ts_interrupt()
68 struct i2c_client *client = ts->client; in egalax_ts_interrupt()
77 } while (ret == -EAGAIN && tries++ < EGALAX_MAX_TRIES); in egalax_ts_interrupt()
97 dev_dbg(&client->dev, "point invalid\n"); in egalax_ts_interrupt()
104 dev_dbg(&client->dev, "%s id:%d x:%d y:%d z:%d", in egalax_ts_interrupt()
119 /* wake up controller by an falling edge of interrupt gpio. */
125 /* wake up controller via an falling edge on IRQ gpio. */ in egalax_wake_up_device()
126 gpio = gpiod_get(&client->dev, "wakeup", GPIOD_OUT_HIGH); in egalax_wake_up_device()
129 if (ret != -EPROBE_DEFER) in egalax_wake_up_device()
130 dev_err(&client->dev, in egalax_wake_up_device()
131 "failed to request wakeup gpio, cannot wake up controller: %d\n", in egalax_wake_up_device()
139 /* controller should be woken up, return irq. */ in egalax_wake_up_device()
164 ts = devm_kzalloc(&client->dev, sizeof(struct egalax_ts), GFP_KERNEL); in egalax_ts_probe()
166 dev_err(&client->dev, "Failed to allocate memory\n"); in egalax_ts_probe()
167 return -ENOMEM; in egalax_ts_probe()
170 input_dev = devm_input_allocate_device(&client->dev); in egalax_ts_probe()
172 dev_err(&client->dev, "Failed to allocate memory\n"); in egalax_ts_probe()
173 return -ENOMEM; in egalax_ts_probe()
176 ts->client = client; in egalax_ts_probe()
177 ts->input_dev = input_dev; in egalax_ts_probe()
179 /* controller may be in sleep, wake it up. */ in egalax_ts_probe()
186 dev_err(&client->dev, "Failed to read firmware version\n"); in egalax_ts_probe()
190 input_dev->name = "EETI eGalax Touch Screen"; in egalax_ts_probe()
191 input_dev->id.bustype = BUS_I2C; in egalax_ts_probe()
193 __set_bit(EV_ABS, input_dev->evbit); in egalax_ts_probe()
194 __set_bit(EV_KEY, input_dev->evbit); in egalax_ts_probe()
195 __set_bit(BTN_TOUCH, input_dev->keybit); in egalax_ts_probe()
205 error = devm_request_threaded_irq(&client->dev, client->irq, in egalax_ts_probe()
209 dev_err(&client->dev, "Failed to register interrupt\n"); in egalax_ts_probe()
213 error = input_register_device(ts->input_dev); in egalax_ts_probe()
235 return enable_irq_wake(client->irq); in egalax_ts_suspend()
246 return disable_irq_wake(client->irq); in egalax_ts_resume()