I have a Python library which accomplishes the same thing (https://github.com/pimoroni/python-multitouch/blob/master/library/hp4ts.py), and also ran into weirdness with the touch scaling being 480x800- this is hardware-level problem (since it’s a 480x800 portrait display that we’re rotating into landscape) and the touch driver doesn’t appear to expose any options to correct it. I tried switching the X/Y dimensions in the dtoverlay but it appears to have no effect whatsoever.
The list of options is here: https://github.com/raspberrypi/linux/blob/rpi-4.14.y/Documentation/devicetree/bindings/input/touchscreen/goodix.txt
And general touchscreen related options: https://github.com/raspberrypi/linux/blob/rpi-4.14.y/Documentation/devicetree/bindings/input/touchscreen/touchscreen.txt
touchscreen-swapped-x-y
swaps the axes in X, breaking input in the Raspbian desktop environment.
And size-x/y
and x/y-mm
seem to have no effect whatsoever.