Please flash the stock kernel from the link I've sent you and see if s-pen works on your dex pad. Just flash it over a2n kernel, no need to wipe anything. Later you can flash again a2n kernel and then magisk, also without to wipe anything.
VID_20220805_133049.mp4
drive.google.com