input: tri-state-key: Fix trivial code style issue in IRQ handler Change-Id: Ie1e9396cf4674586a68dbf606a1d51fbffeaaca4 Signed-off-by: Sultanxda <sultanxda@gmail.com> input: tri-state-key: Use ffz() instead of find_first_zero_bit() find_first_zero_bit() is intended for large bitmaps; ffz() is much faster when only a single word needs to be searched through. Change-Id: Ib81b742805489947164af96bb8603f6732d64e8b Suggested-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Sultanxda <sultanxda@gmail.com> input: tri-state-key: Clean up some code styling Use a macro to store the number of states, reduce the curr_state member in the struct to uint8_t (since it only needs to contain 3 bits), and use find_first_zero_bit() instead of a loop to find the first zero bit. Change-Id: I35f369dc30186ab95033a4d27b550a07e4dc2dd8 Suggested-by: Joel Porquet <joel@porquet.org> Signed-off-by: Sultanxda <sultanxda@gmail.com> input: tri-state-key: Rewrite and optimize A driver for such a simple device shouldn't be so ugly. Clean it up and optimize it in the process. Summary of changes: -Remove unneeded switch device -Remove unused/unnecessary struct members -Remove module references (this driver will always be built in) -Utilize fixed loops and clever logic to eliminate significant amounts of code duplication -Remove unused pinctrl code -Use a threaded interrupt handler -Process interrupts directly in the threaded interrupt handler (which runs with realtime priority) rather than a worker -Read the initial switch state upon init (so userspace gets the correct switch state upon boot) -Refactor code wherever possible to make it cleaner Note that although the procfs naming scheme is non-standard (i.e. "keyCode_top" instead of "keycode_top"), the old naming scheme is retained in order to maintain compatibility with userspace. Change-Id: Ic2de6ddeb223aa7669d61c186be0b57a15e1488b Signed-off-by: Sultanxda <sultanxda@gmail.com> |
||
---|---|---|
.. | ||
fingerprint | ||
gameport | ||
joystick | ||
keyboard | ||
misc | ||
mouse | ||
serio | ||
tablet | ||
touchscreen | ||
apm-power.c | ||
evbug.c | ||
evdev.c | ||
ff-core.c | ||
ff-memless.c | ||
input-compat.c | ||
input-compat.h | ||
input-leds.c | ||
input-mt.c | ||
input-polldev.c | ||
input.c | ||
joydev.c | ||
Kconfig | ||
keycombo.c | ||
keyreset.c | ||
Makefile | ||
matrix-keymap.c | ||
mousedev.c | ||
sparse-keymap.c |