linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: cros_ec_keyb - send 'scancodes' in addition to key events
@ 2020-12-08  1:43 Dmitry Torokhov
  2020-12-08  2:31 ` Rajat Jain
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Torokhov @ 2020-12-08  1:43 UTC (permalink / raw)
  To: linux-input; +Cc: Benson Leung, Rajat Jain

To let userspace know what 'scancodes' should be used in EVIOCGKEYCODE
and EVIOCSKEYCODE ioctls, we should send EV_MSC/MSC_SCAN events in
addition to EV_KEY/KEY_* events. The driver already declared MSC_SCAN
capability, so it is only matter of actually sending the events.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/input/keyboard/cros_ec_keyb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c
index 023f083dadd3..354d74d62f05 100644
--- a/drivers/input/keyboard/cros_ec_keyb.c
+++ b/drivers/input/keyboard/cros_ec_keyb.c
@@ -184,6 +184,7 @@ static void cros_ec_keyb_process(struct cros_ec_keyb *ckdev,
 					"changed: [r%d c%d]: byte %02x\n",
 					row, col, new_state);
 
+				input_event(idev, EV_MSC, MSC_SCAN, pos);
 				input_report_key(idev, keycodes[pos],
 						 new_state);
 			}
-- 
2.29.2.576.ga3fc446d84-goog


-- 
Dmitry

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Input: cros_ec_keyb - send 'scancodes' in addition to key events
  2020-12-08  1:43 [PATCH] Input: cros_ec_keyb - send 'scancodes' in addition to key events Dmitry Torokhov
@ 2020-12-08  2:31 ` Rajat Jain
  0 siblings, 0 replies; 2+ messages in thread
From: Rajat Jain @ 2020-12-08  2:31 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, Benson Leung

On Mon, Dec 7, 2020 at 5:43 PM Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
>
> To let userspace know what 'scancodes' should be used in EVIOCGKEYCODE
> and EVIOCSKEYCODE ioctls, we should send EV_MSC/MSC_SCAN events in
> addition to EV_KEY/KEY_* events. The driver already declared MSC_SCAN
> capability, so it is only matter of actually sending the events.
>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
FWIW, Acked-by: Rajat Jain <rajatja@google.com>


> ---
>  drivers/input/keyboard/cros_ec_keyb.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c
> index 023f083dadd3..354d74d62f05 100644
> --- a/drivers/input/keyboard/cros_ec_keyb.c
> +++ b/drivers/input/keyboard/cros_ec_keyb.c
> @@ -184,6 +184,7 @@ static void cros_ec_keyb_process(struct cros_ec_keyb *ckdev,
>                                         "changed: [r%d c%d]: byte %02x\n",
>                                         row, col, new_state);
>
> +                               input_event(idev, EV_MSC, MSC_SCAN, pos);
>                                 input_report_key(idev, keycodes[pos],
>                                                  new_state);
>                         }
> --
> 2.29.2.576.ga3fc446d84-goog
>
>
> --
> Dmitry

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-08  2:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-08  1:43 [PATCH] Input: cros_ec_keyb - send 'scancodes' in addition to key events Dmitry Torokhov
2020-12-08  2:31 ` Rajat Jain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).