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.
That's @merge 's series i wanted to link to above: https://lore.kernel.org/linux-iio/20190821132520.28225-1-martin.kepplinger@puri.sm/