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

Configure Feed

Select the types of activity you want to include in your feed.

Input: adxl34x - use input_set_capability()

Switch to using input_set_capability() instead of using __set_bit() to
make clear what exactly kinds of events (EV_KEY, EV_REL) are being
declared.

Also drop redundant calls setting EV_ABS and ABS_X|Y|Z bits as that is
taken care by input_set_abs_params().

Link: https://lore.kernel.org/r/20240610164301.1048482-2-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

+13 -19
+13 -19
drivers/input/misc/adxl34x.c
··· 769 769 770 770 input_set_drvdata(input_dev, ac); 771 771 772 - __set_bit(ac->pdata.ev_type, input_dev->evbit); 773 - 774 772 if (ac->pdata.ev_type == EV_REL) { 775 - __set_bit(REL_X, input_dev->relbit); 776 - __set_bit(REL_Y, input_dev->relbit); 777 - __set_bit(REL_Z, input_dev->relbit); 773 + input_set_capability(input_dev, EV_REL, REL_X); 774 + input_set_capability(input_dev, EV_REL, REL_Y); 775 + input_set_capability(input_dev, EV_REL, REL_Z); 778 776 } else { 779 777 /* EV_ABS */ 780 - __set_bit(ABS_X, input_dev->absbit); 781 - __set_bit(ABS_Y, input_dev->absbit); 782 - __set_bit(ABS_Z, input_dev->absbit); 783 - 784 778 if (pdata->data_range & FULL_RES) 785 779 range = ADXL_FULLRES_MAX_VAL; /* Signed 13-bit */ 786 780 else ··· 785 791 input_set_abs_params(input_dev, ABS_Z, -range, range, 3, 3); 786 792 } 787 793 788 - __set_bit(EV_KEY, input_dev->evbit); 789 - __set_bit(pdata->ev_code_tap[ADXL_X_AXIS], input_dev->keybit); 790 - __set_bit(pdata->ev_code_tap[ADXL_Y_AXIS], input_dev->keybit); 791 - __set_bit(pdata->ev_code_tap[ADXL_Z_AXIS], input_dev->keybit); 794 + input_set_capability(input_dev, EV_KEY, pdata->ev_code_tap[ADXL_X_AXIS]); 795 + input_set_capability(input_dev, EV_KEY, pdata->ev_code_tap[ADXL_Y_AXIS]); 796 + input_set_capability(input_dev, EV_KEY, pdata->ev_code_tap[ADXL_Z_AXIS]); 792 797 793 798 if (pdata->ev_code_ff) { 794 799 ac->int_mask = FREE_FALL; 795 - __set_bit(pdata->ev_code_ff, input_dev->keybit); 800 + input_set_capability(input_dev, EV_KEY, pdata->ev_code_ff); 796 801 } 797 802 798 803 if (pdata->ev_code_act_inactivity) 799 - __set_bit(pdata->ev_code_act_inactivity, input_dev->keybit); 804 + input_set_capability(input_dev, EV_KEY, 805 + pdata->ev_code_act_inactivity); 800 806 801 807 ac->int_mask |= ACTIVITY | INACTIVITY; 802 808 ··· 868 874 869 875 if (pdata->orientation_enable & ADXL_EN_ORIENTATION_3D) 870 876 for (i = 0; i < ARRAY_SIZE(pdata->ev_codes_orient_3d); i++) 871 - __set_bit(pdata->ev_codes_orient_3d[i], 872 - input_dev->keybit); 877 + input_set_capability(input_dev, EV_KEY, 878 + pdata->ev_codes_orient_3d[i]); 873 879 874 880 if (pdata->orientation_enable & ADXL_EN_ORIENTATION_2D) 875 881 for (i = 0; i < ARRAY_SIZE(pdata->ev_codes_orient_2d); i++) 876 - __set_bit(pdata->ev_codes_orient_2d[i], 877 - input_dev->keybit); 882 + input_set_capability(input_dev, EV_KEY, 883 + pdata->ev_codes_orient_2d[i]); 878 884 } else { 879 885 ac->pdata.orientation_enable = 0; 880 886 }