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

drivers: input: pinnacle: add driver for Cirque Pinnacle 1CA027 based trackpads #69438

Merged

Conversation

akscram
Copy link
Contributor

@akscram akscram commented Feb 26, 2024

Introduce an initial version of an input driver for Cirque Pinnacle GlidePoint circle trackpads connected via SPI, such as TM035035 and similar. The driver support only the absolute mode in which an absolute coordinates are reported. The relative mode is going to be the next step.

@akscram akscram force-pushed the driver-input-pinnacle branch 5 times, most recently from ec84e34 to b1fa8b0 Compare February 29, 2024 02:02
@kartben kartben marked this pull request as ready for review February 29, 2024 02:06
@zephyrbot zephyrbot added area: Devicetree Binding PR modifies or adds a Device Tree binding area: Input Input Subsystem and Drivers area: Samples Samples labels Feb 29, 2024
@kartben kartben marked this pull request as draft February 29, 2024 02:07
@kartben
Copy link
Collaborator

kartben commented Feb 29, 2024

@akscram I'm so sorry, just misclicked on my phone and inadvertently marked this as ready for review :(

@akscram akscram marked this pull request as ready for review February 29, 2024 02:14
@akscram
Copy link
Contributor Author

akscram commented Feb 29, 2024

@kartben, no problem at all. I think the PR is more or less ready for the first round of review, if it's okay to implement more features, such as the relative mode, taps detection and so on, in follow up PRs.

Copy link
Member

@fabiobaltieri fabiobaltieri left a comment

Choose a reason for hiding this comment

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

hi, just a couple initial comments on spotted code that can be dropped

drivers/input/CMakeLists.txt Outdated Show resolved Hide resolved
drivers/input/pinnacle/Kconfig Outdated Show resolved Hide resolved
drivers/input/pinnacle/pinnacle.c Outdated Show resolved Hide resolved
drivers/input/pinnacle/pinnacle.c Outdated Show resolved Hide resolved
samples/input/pinnacle/src/main.c Outdated Show resolved Hide resolved
@fabiobaltieri
Copy link
Member

fabiobaltieri commented Feb 29, 2024

cc @petejohanson, there's some existing work on zmkfirmware/zmk#2035 for this, ideally we'd converge on a common solution, not looking for features right now just a solid base, also I got a TM040040 myself as well. :-)

@akscram akscram force-pushed the driver-input-pinnacle branch from b1fa8b0 to adb45b8 Compare March 1, 2024 01:21
@akscram
Copy link
Contributor Author

akscram commented Mar 1, 2024

@fabiobaltieri, thank you for the early review. Your comments should be addressed now.

@akscram akscram force-pushed the driver-input-pinnacle branch 4 times, most recently from 59f4643 to b50f78c Compare March 4, 2024 15:10
@akscram akscram force-pushed the driver-input-pinnacle branch from b50f78c to 1de3d09 Compare March 10, 2024 02:05
Copy link
Contributor Author

@akscram akscram left a comment

Choose a reason for hiding this comment

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

I addressed several comments but I still have some left on which I'm working on.

drivers/input/input_pinnacle.c Outdated Show resolved Hide resolved
drivers/input/input_pinnacle.c Outdated Show resolved Hide resolved
drivers/input/input_pinnacle.c Outdated Show resolved Hide resolved
drivers/input/input_pinnacle.c Outdated Show resolved Hide resolved
drivers/input/input_pinnacle.c Outdated Show resolved Hide resolved
Comment on lines 433 to 421
input_report_abs(dev, INPUT_ABS_X, sample->x, false, K_FOREVER);
input_report_abs(dev, INPUT_ABS_Y, sample->y, false, K_FOREVER);
input_report_abs(dev, INPUT_ABS_Z, sample->z, true, K_FOREVER);
#elif defined(CONFIG_INPUT_PINNACLE_DATA_MODE_RELATIVE)
input_report_abs(dev, INPUT_REL_X, sample->x, false, K_FOREVER);
input_report_abs(dev, INPUT_REL_Y, sample->y, true, K_FOREVER);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The controller indeed supports swapping X and Y (90 degrees rotation, by default the rotation is 0 degrees). I will need to try this out before I could come up with a proper configuration.

I'm not sure I fully understand what exactly you're asking to make configurable. Are you suggesting to make the swapping of axes configurable?

drivers/input/input_pinnacle.c Outdated Show resolved Hide resolved
drivers/input/Kconfig.pinnacle Outdated Show resolved Hide resolved
drivers/input/input_pinnacle.c Show resolved Hide resolved
drivers/input/input_pinnacle.c Show resolved Hide resolved
@akscram akscram force-pushed the driver-input-pinnacle branch 2 times, most recently from d2fdd3d to 98d60e5 Compare March 11, 2024 01:37
@akscram akscram force-pushed the driver-input-pinnacle branch from 98d60e5 to 39d2a06 Compare March 20, 2024 10:53
drivers/input/input_pinnacle.c Outdated Show resolved Hide resolved
drivers/input/input_pinnacle.c Outdated Show resolved Hide resolved
drivers/input/input_pinnacle.c Outdated Show resolved Hide resolved
drivers/input/input_pinnacle.c Show resolved Hide resolved
drivers/input/input_pinnacle.c Outdated Show resolved Hide resolved
drivers/input/input_pinnacle.c Outdated Show resolved Hide resolved
drivers/input/input_pinnacle.c Show resolved Hide resolved
drivers/input/input_pinnacle.c Outdated Show resolved Hide resolved
drivers/input/input_pinnacle.c Outdated Show resolved Hide resolved
drivers/input/input_pinnacle.c Outdated Show resolved Hide resolved
@akscram akscram force-pushed the driver-input-pinnacle branch 2 times, most recently from 2929bfb to 321a1ee Compare March 23, 2024 23:03
@akscram
Copy link
Contributor Author

akscram commented Mar 29, 2024

@fabiobaltieri, could you please take another look?

@akscram akscram force-pushed the driver-input-pinnacle branch 2 times, most recently from 73e577e to 5929844 Compare March 29, 2024 17:21
@akscram akscram force-pushed the driver-input-pinnacle branch 2 times, most recently from 43b2d08 to 5372963 Compare April 3, 2024 00:50
fabiobaltieri
fabiobaltieri previously approved these changes Apr 3, 2024
Copy link
Member

@fabiobaltieri fabiobaltieri left a comment

Choose a reason for hiding this comment

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

Good stuff.

The initial version of an input driver for Cirque Pinnacle ASIC supports:
 * Setting sensitivity
 * Choosing between relative and absolute modes
  * Relative mode
   * Primary tap
   * Swapping X and Y
  * Absolute mode
   * Setting number of idle packets
   * Clipping coordinates outside of active range
   * Scaling coordinates
   * Inverting X and Y coordinates

Signed-off-by: Ilia Kharin <[email protected]>
@fabiobaltieri fabiobaltieri merged commit 828a0c0 into zephyrproject-rtos:main Apr 4, 2024
21 checks passed
Copy link

github-actions bot commented Apr 4, 2024

Hi @akscram!
Congratulations on getting your very first Zephyr pull request merged 🎉🥳. This is a fantastic achievement, and we're thrilled to have you as part of our community!

To celebrate this milestone and showcase your contribution, we'd love to award you the Zephyr Technical Contributor badge. If you're interested, please claim your badge by filling out this form: Claim Your Zephyr Badge.

Thank you for your valuable input, and we look forward to seeing more of your contributions in the future! 🪁

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 area: Samples Samples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants