Skip to content

Commit f041a7a

Browse files
stephan-ghdtor
authored andcommitted
Input: tm2-touchkey - report scan codes
Report the index of pressed touch key as MSC_SCAN code to userspace so it is possible to identify which of the keys was pressed (not just the function that is currently assigned to the key). This is done similarly also in mcs_touchkey and mpr121_touchkey. Signed-off-by: Stephan Gerhold <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 804f354 commit f041a7a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/input/keyboard/tm2-touchkey.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ static irqreturn_t tm2_touchkey_irq_handler(int irq, void *devid)
156156
goto out;
157157
}
158158

159+
input_event(touchkey->input_dev, EV_MSC, MSC_SCAN, index);
160+
159161
if (data & TM2_TOUCHKEY_BIT_PRESS_EV) {
160162
for (i = 0; i < touchkey->num_keycodes; i++)
161163
input_report_key(touchkey->input_dev,
@@ -250,6 +252,7 @@ static int tm2_touchkey_probe(struct i2c_client *client,
250252
touchkey->input_dev->name = TM2_TOUCHKEY_DEV_NAME;
251253
touchkey->input_dev->id.bustype = BUS_I2C;
252254

255+
input_set_capability(touchkey->input_dev, EV_MSC, MSC_SCAN);
253256
for (i = 0; i < touchkey->num_keycodes; i++)
254257
input_set_capability(touchkey->input_dev, EV_KEY,
255258
touchkey->keycodes[i]);

0 commit comments

Comments
 (0)