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

input: pat912x: add a bunch of settings #69636

Merged
merged 1 commit into from
Mar 4, 2024

Conversation

fabiobaltieri
Copy link
Member

Second and last round for this interesting device, adds support for axis inversion, resolution settings at init and runtime and sleep mode.

Oddly enough, according to the datasheet some of these registers should be write protected and need another register to be unlocked, but my device does not seem to be bothered, not too sure why but I think it's fine to leave it as is for the moment and keep the code a bit simpler.


Add devicetree based settings for resolution, axis inversion and sleep mode enable. Keep the resolution setting in its own function so it can be called by the application again in runtime if needed.

@zephyrbot zephyrbot added area: Devicetree Binding PR modifies or adds a Device Tree binding area: Input Input Subsystem and Drivers labels Feb 29, 2024
@zephyrbot zephyrbot requested a review from galak February 29, 2024 20:29
faxe1008
faxe1008 previously approved these changes Mar 1, 2024
dts/bindings/input/pixart,pat912x.yaml Show resolved Hide resolved
include/zephyr/input/input_pat912x.h Show resolved Hide resolved
Add devicetree based settings for resolution, axis inversion and sleep
mode enable. Keep the resolution setting in its own function so it can
be called by the application again in runtime if needed.

Signed-off-by: Fabio Baltieri <[email protected]>
Comment on lines +328 to +331
BUILD_ASSERT(IN_RANGE(DT_INST_PROP(n, res_x_cpi), 0, RES_MAX), \
"invalid res-x-cpy"); \
BUILD_ASSERT(IN_RANGE(DT_INST_PROP(n, res_y_cpi), 0, RES_MAX), \
"invalid res-y-cpy"); \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be nice if a generous soul introduced min/max setting in our binding language. @fabiobaltieri maybe :-) ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You know what this project really needs? Interns.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... or DT maintainers 👀

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You know what this project really needs? Interns.

You mean like .. Summer of Code? :)

@henrikbrixandersen henrikbrixandersen merged commit 7d676c2 into zephyrproject-rtos:main Mar 4, 2024
21 checks passed
@fabiobaltieri fabiobaltieri deleted the pat branch March 4, 2024 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Devicetree Binding PR modifies or adds a Device Tree binding area: Input Input Subsystem and Drivers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants