| 826 | === Handling Screen rotation |
| 827 | As an example let's assume you have a touchscreen display using an edt-ft5x06 touch controller and your screen's display 0,0 agrees with the touch input 0,0 both in the top-right corner of the display (determined with evtest) but you want to rotate your screen 90deg clockwise to put it in 'portrait mode'. This would cause the x/y coordinates to be wrong requiring some mapping in the Linux input subsystem. This scenario would require us to |
| 828 | |
| 829 | dt fragment: |
| 830 | {{{ |
| 831 | &i2c3 { |
| 832 | clock-frequency = <100000>; |
| 833 | pinctrl-names = "default"; |
| 834 | pinctrl-0 = <&pinctrl_i2c3>; |
| 835 | status = "okay"; |
| 836 | |
| 837 | touchscreen: touchscreen@38 { |
| 838 | compatible = "edt,edt-ft5406", "edt,edt-ft5x06"; |
| 839 | pinctrl-names = "default"; |
| 840 | pinctrl-0 = <&pinctrl_touch>; |
| 841 | reg = <0x38>; |
| 842 | interrupt-parent = <&gpio7>; |
| 843 | interrupts = <12 IRQ_TYPE_EDGE_FALLING>; |
| 844 | touchscreen-swapped-x-y; |
| 845 | touchscreen-inverted-y; |
| 846 | touchscreen-size-x = <1024>; |
| 847 | touchscreen-size-y = <600>; |
| 848 | }; |
| 849 | }; |
| 850 | |
| 851 | &iomuxc { |
| 852 | pinctrl_touch: touchgrp { |
| 853 | fsl,pins = < |
| 854 | MX6QDL_PAD_GPIO_17__GPIO7_IO12 0x1b0b0 |
| 855 | >; |
| 856 | }; |
| 857 | }; |
| 858 | }}} |
| 859 | |
| 860 | Again, use the 'evdev' application to determine where the touch sensor's 0,0 coordinate is and make it match the display's 0,0. Hint, run 'evdev /dev/input/event0 | grep ABS_X' to show only the X coordinate then switch to the Y coordinate to help understand the mapping. |
| 861 | |