Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: tsc2007 - make interrupt optional

In case tsc2007 is used as an ADC sensor there will be no interrupt
provided at all, so set up an interrupt only if one is present.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Link: https://lore.kernel.org/r/20250824091927.105121-3-clamor95@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Svyatoslav Ryhel and committed by
Dmitry Torokhov
d504bbda b0e109a2

+16 -12
+16 -12
drivers/input/touchscreen/tsc2007_core.c
··· 177 177 mb(); 178 178 wake_up(&ts->wait); 179 179 180 - disable_irq(ts->irq); 180 + if (ts->irq) 181 + disable_irq(ts->irq); 181 182 } 182 183 183 184 static int tsc2007_open(struct input_dev *input_dev) ··· 189 188 ts->stopped = false; 190 189 mb(); 191 190 192 - enable_irq(ts->irq); 191 + if (ts->irq) 192 + enable_irq(ts->irq); 193 193 194 194 /* Prepare for touch readings - power down ADC and enable PENIRQ */ 195 195 err = tsc2007_xfer(ts, PWRDOWN); ··· 363 361 pdata->init_platform_hw(); 364 362 } 365 363 366 - err = devm_request_threaded_irq(&client->dev, ts->irq, 367 - NULL, tsc2007_soft_irq, 368 - IRQF_ONESHOT, 369 - client->dev.driver->name, ts); 370 - if (err) { 371 - dev_err(&client->dev, "Failed to request irq %d: %d\n", 372 - ts->irq, err); 373 - return err; 374 - } 364 + if (ts->irq) { 365 + err = devm_request_threaded_irq(&client->dev, ts->irq, 366 + NULL, tsc2007_soft_irq, 367 + IRQF_ONESHOT, 368 + client->dev.driver->name, ts); 369 + if (err) { 370 + dev_err(&client->dev, "Failed to request irq %d: %d\n", 371 + ts->irq, err); 372 + return err; 373 + } 375 374 376 - tsc2007_stop(ts); 375 + tsc2007_stop(ts); 376 + } 377 377 378 378 /* power down the chip (TSC2007_SETUP does not ACK on I2C) */ 379 379 err = tsc2007_xfer(ts, PWRDOWN);