Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

piscreen-overlay: Add invx, invy and swapxy #6337

Merged
merged 1 commit into from
Sep 4, 2024

Conversation

satmandu
Copy link
Contributor

@satmandu satmandu commented Sep 4, 2024

This PR adds touchscreen x,y swap and inversion options, using the invx, invy, and swapxy as per the discussion at #3263 , which will ideally work for the Waveshare 3.5a touchscreen.

I have changed the parameter names to match the common parameter name usage in other device tree overlay files in the same dir.

@satmandu
Copy link
Contributor Author

satmandu commented Sep 4, 2024

The dtbo appears to work for me. For whatever reason with the way the screen is oriented on the wavshare35a, I had to use the invx parameter to get the invy behavior I wanted (the touchscreen responding as expected to roughly where I poke at the screen.)

Is this because of the default swapxy?

Should I flip things so the settings are thus @6by9 ?

		invx =		<&piscreen_ts>,"touchscreen-inverted-y?";
		invy =		<&piscreen_ts>,"touchscreen-inverted-x?";

@6by9
Copy link
Contributor

6by9 commented Sep 4, 2024

Is this because of the default swapxy?

Almost certainly.
With swapxy and invx/invy it matters which order the two operations are done in. It should be documented (somewhere) which order the two operations are done, and that is the expected behaviour.

Should I flip things so the settings are thus @6by9 ?

		invx =		<&piscreen_ts>,"touchscreen-inverted-y?";
		invy =		<&piscreen_ts>,"touchscreen-inverted-x?";

No, because then using invx without swapxy would give the wrong result.

@satmandu
Copy link
Contributor Author

satmandu commented Sep 4, 2024

Happy to make documentation changes here as you might suggest.

Otherwise I'm happy to leave this as is, as this completes the functionality I desire.

@6by9
Copy link
Contributor

6by9 commented Sep 4, 2024

It is already documented - https://github.com/raspberrypi/linux/blob/rpi-6.6.y/Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml#L73-L76

  touchscreen-swapped-x-y:
    description: X and Y axis are swapped
                 Swapping is done after inverting the axis
    type: boolean

I'm happy.
I'll leave it with @pelwell to make any further comments and merge.

@pelwell pelwell merged commit 31be188 into raspberrypi:rpi-6.6.y Sep 4, 2024
11 of 12 checks passed
@satmandu satmandu deleted the piscreen_touch branch September 4, 2024 17:10
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Sep 10, 2024
kernel: drivers: drm: rp1-vec: Increase width limit, for PAL 16:9 @ 18MHz
See: raspberrypi/linux#6340

kernel: AI Camera Support
See: raspberrypi/linux#6343

kernel: Added waveshare 5.0inch, 6.25inch, and 8.8inch dsi screen support
See: raspberrypi/linux#6334

kernel: piscreen-overlay: Add invx, invy and swapxy
See: raspberrypi/linux#6337

kernel: configs: Add remaining USB_SERIAL modules
See: raspberrypi/linux#6332
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Sep 10, 2024
kernel: drivers: drm: rp1-vec: Increase width limit, for PAL 16:9 @ 18MHz
See: raspberrypi/linux#6340

kernel: AI Camera Support
See: raspberrypi/linux#6343

kernel: Added waveshare 5.0inch, 6.25inch, and 8.8inch dsi screen support
See: raspberrypi/linux#6334

kernel: piscreen-overlay: Add invx, invy and swapxy
See: raspberrypi/linux#6337

kernel: configs: Add remaining USB_SERIAL modules
See: raspberrypi/linux#6332
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants