RAD Kernel is a custom linux kernel for whyred (Redmi Note 5 Pro/AI) that contains all features you need and aims for best balance between performance and battery.
This is the Linux kernel driver for the stmpe2401 and stmpe2402 GPIO expanders from ST Microelectronics. These i2c chips support up to 24 extra GPIO lines, have 3 programmable PWM outputs, an integrated keypad input, and rotator input controllers.