input: Sync switch event codes with upstream linux

* They are checked as of 9762ac9c1b,
  values > upstream linux SW_MAX will now cause a system_server crash

Change-Id: Ib26f230bfa663f78ec17fc91890679210558ad60
fourteen
Tim Zimmermann 9 months ago committed by Simon1511
parent b6f5431322
commit b7189f6fbf
  1. 6
      drivers/input/keyboard/certify_hall_ic.c
  2. 2
      include/linux/mod_devicetable.h
  3. 5
      include/uapi/linux/input-event-codes.h
  4. 10
      include/uapi/linux/input.h

@ -76,7 +76,7 @@ static void certify_cover_work(struct work_struct *work)
if (first == second) {
certify_cover = first;
input_report_switch(ddata->input, SW_CERTIFYHALL, certify_cover);
input_report_switch(ddata->input, SW_MACHINE_COVER, certify_cover);
input_sync(ddata->input);
#if defined(CONFIG_SUPPORT_HALL_ABNORMAL_TEST)
/* send uevent for hall ic */
@ -100,7 +100,7 @@ static void certify_cover_work(struct work_struct *work)
certify_cover = first;
input_report_switch(ddata->input,
SW_CERTIFYHALL, certify_cover);
SW_MACHINE_COVER, certify_cover);
input_sync(ddata->input);
}
#endif
@ -237,7 +237,7 @@ static int certify_hall_probe(struct platform_device *pdev)
input->dev.parent = &pdev->dev;
input->evbit[0] |= BIT_MASK(EV_SW);
input_set_capability(input, EV_SW, SW_CERTIFYHALL);
input_set_capability(input, EV_SW, SW_MACHINE_COVER);
input->open = certify_hall_open;
input->close = certify_hall_close;

@ -293,7 +293,7 @@ struct pcmcia_device_id {
#define INPUT_DEVICE_ID_LED_MAX 0x0f
#define INPUT_DEVICE_ID_SND_MAX 0x07
#define INPUT_DEVICE_ID_FF_MAX 0x7f
#define INPUT_DEVICE_ID_SW_MAX 0x20
#define INPUT_DEVICE_ID_SW_MAX 0x10
#define INPUT_DEVICE_ID_PROP_MAX 0x1f
#define INPUT_DEVICE_ID_MATCH_BUS 1

@ -824,9 +824,8 @@
#define SW_LINEIN_INSERT 0x0d /* set = inserted */
#define SW_MUTE_DEVICE 0x0e /* set = device disabled */
#define SW_PEN_INSERTED 0x0f /* set = pen inserted */
#define SW_MACHINE_COVER 0x14 /* set = cover closed */
#define SW_GLOVE 0x20 /* set = glove mode */
#define SW_MAX 0x20
#define SW_MACHINE_COVER 0x10 /* set = cover closed */
#define SW_MAX 0x10
#define SW_CNT (SW_MAX+1)
/*

@ -329,16 +329,6 @@ struct input_mask {
#define EVIOCSCLOCKID _IOW('E', 0xa0, int) /* Set clockid to be used for timestamps */
/*
* Switch events
*/
#define SW_FLIP 0x15 /* set = flip cover open, close*/
#define SW_CERTIFYHALL 0x1b /* set = certify_hall attach/detach */
#define SW_SLIDINGUPHALL 0x1c /* set = sliding_up_hall attach/detach */
#define SW_SLIDINGDOWNHALL 0x1d /* set = sliding_down_hall attach/detach */
#define SW_DIGITALUPHALL 0x1e /* set = digital_up_hall attach/detach */
#define SW_DIGITALDOWNHALL 0x1f /* set = digital_down_hall attach/detach */
/*
* IDs.
*/

Loading…
Cancel
Save