samsung-crownlte: workaround for touchscreen not working when booted by plugging charger
as reported earlier here: https://wiki.postmarketos.org/index.php?title=Samsung_Galaxy_Note9_(samsung-crownlte)&diff=prev&oldid=26038
the touchscreen (and other peripherals) on crownlte does not work when booted by plugging the charger.
this works around this by simply rebooting again right from the initrd,
which puts the phone into it's normal working state.
(this can loop back into charge mode if the battery is completely empty, so a delay to allow for some charging is inserted in that case.)
i suspect the samsung bootloader skips some low-level initialization when booting into charging mode, or even intentionally disables the touchscreen, as it's not needed in charging mode.
(i don't think any android ever boots into the system straight from charging mode like pmos does...)
it may or may not be possible to fix this by initializing/resetting hardware in the kernel, in any case that seems a complex task probably just not worth the effort.
(unless it just happens with some kernel update, which i have yet to attempt.)
this fix is somewhat of a hack, but the only proper fix would require first implementing "revive charging-sdl" #1224 and then giving it the configuration option to exit by rebooting.
there is some risk that this might cause the phone to bootloop, if for unforeseen reasons the bootmode is not reset after rebooting,
but i think that risk is very low and acceptable for a "testing" device.
(and even THEN the fix would be to just unplug the charger, or boot into recovery for charging, as i did before creating this fix.)
again the better fix would be to have charging-sdl back and configurable to reboot on exit.
i only tested this on my own device so far, finding it to work fine.
i'm afraid i'm probably the only current user of this port anyway.
(i found this to be the most powerful large-screen device with support sufficient for my use, and i'm quite happy with it)