Skip to content

Commit 6b8c982

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input updates from Dmitry Torokhov: "A fix for a panic in gpio-keys driver when set up with absolute events, a fixup to the new zforce driver and a new keycode definition" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: allocate absinfo data when setting ABS capability Input: define KEY_WWAN for Wireless WAN Input: zforce - fix possible driver hang during suspend
2 parents 03bdeda + 28a2a2e commit 6b8c982

3 files changed

Lines changed: 21 additions & 7 deletions

File tree

‎drivers/input/input.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1871,6 +1871,10 @@ void input_set_capability(struct input_dev *dev, unsigned int type, unsigned int
18711871
break;
18721872

18731873
case EV_ABS:
1874+
input_alloc_absinfo(dev);
1875+
if (!dev->absinfo)
1876+
return;
1877+
18741878
__set_bit(code, dev->absbit);
18751879
break;
18761880

‎drivers/input/touchscreen/zforce_ts.c‎

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,18 @@ static void zforce_complete(struct zforce_ts *ts, int cmd, int result)
455455
}
456456
}
457457

458-
static irqreturn_t zforce_interrupt(int irq, void *dev_id)
458+
static irqreturn_t zforce_irq(int irq, void *dev_id)
459+
{
460+
struct zforce_ts *ts = dev_id;
461+
struct i2c_client *client = ts->client;
462+
463+
if (ts->suspended && device_may_wakeup(&client->dev))
464+
pm_wakeup_event(&client->dev, 500);
465+
466+
return IRQ_WAKE_THREAD;
467+
}
468+
469+
static irqreturn_t zforce_irq_thread(int irq, void *dev_id)
459470
{
460471
struct zforce_ts *ts = dev_id;
461472
struct i2c_client *client = ts->client;
@@ -465,12 +476,10 @@ static irqreturn_t zforce_interrupt(int irq, void *dev_id)
465476
u8 *payload;
466477

467478
/*
468-
* When suspended, emit a wakeup signal if necessary and return.
479+
* When still suspended, return.
469480
* Due to the level-interrupt we will get re-triggered later.
470481
*/
471482
if (ts->suspended) {
472-
if (device_may_wakeup(&client->dev))
473-
pm_wakeup_event(&client->dev, 500);
474483
msleep(20);
475484
return IRQ_HANDLED;
476485
}
@@ -763,8 +772,8 @@ static int zforce_probe(struct i2c_client *client,
763772
* Therefore we can trigger the interrupt anytime it is low and do
764773
* not need to limit it to the interrupt edge.
765774
*/
766-
ret = devm_request_threaded_irq(&client->dev, client->irq, NULL,
767-
zforce_interrupt,
775+
ret = devm_request_threaded_irq(&client->dev, client->irq,
776+
zforce_irq, zforce_irq_thread,
768777
IRQF_TRIGGER_LOW | IRQF_ONESHOT,
769778
input_dev->name, ts);
770779
if (ret) {

‎include/uapi/linux/input.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,8 @@ struct input_keymap_entry {
464464
#define KEY_BRIGHTNESS_ZERO 244 /* brightness off, use ambient */
465465
#define KEY_DISPLAY_OFF 245 /* display device to off state */
466466

467-
#define KEY_WIMAX 246
467+
#define KEY_WWAN 246 /* Wireless WAN (LTE, UMTS, GSM, etc.) */
468+
#define KEY_WIMAX KEY_WWAN
468469
#define KEY_RFKILL 247 /* Key that controls all radios */
469470

470471
#define KEY_MICMUTE 248 /* Mute / unmute the microphone */

0 commit comments

Comments
 (0)