Based on @merge 's accelerometer work (https://lore.kernel.org/linux-iio/cover.1569143551.git.lorenzo@kernel.org/) and yesterday's work to hook iio-sensor-proxy into #phosh, enabling rotation is just a couple of more lines of code.
The video shows the #librem5 devkit but it is the same for the phone. Please excuse the low video quality.