You will want to update the commit message subject to use the prefix
"Input: xpad -" instead of "xpad:".
+/* used for analog face buttons mapped to axes */
+static const signed short xpad_abs_analog_face_buttons[] = {
+ ABS_MISC + 0, ABS_MISC + 1, /* A, B */
+ ABS_MISC + 3, ABS_MISC + 4, /* X, Y */
+ ABS_MISC + 2, ABS_MISC + 5, /* C, Z */
+ -1
+};
Would it make more sense to use an enum for this?
Something like the below enum.
enum xpad_abs_analog_face_btn {
XPAD_ABS_ANALOG_FACE_BTN_A = ABS_MISC,
XPAD_ABS_ANALOG_FACE_BTN_B,
XPAD_ABS_ANALOG_FACE_BTN_C,
XPAD_ABS_ANALOG_FACE_BTN_X,
XPAD_ABS_ANALOG_FACE_BTN_Y,
XPAD_ABS_ANALOG_FACE_BTN_Z,
XPAD_ABS_ANALOG_FACE_BTN_END, /* Must remain as the last element */
};
This would clean up both xpad_process_packet and xpad_set_up_abs a bit
in my opinion. Your loop for xpad_set_up_abs would look like the
following.
enum xpad_abs_analog_face_btn btn;
...
for (btn = XPAD_ABS_ANALOG_FACE_BTN_A; btn != XPAD_ABS_ANALOG_FACE_BTN_END; ++btn)
xpad_set_up_abs(input_dev, btn);