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: add some initial keyboard matrix library stubs #64456

Merged
merged 1 commit into from
Oct 31, 2023

Conversation

fabiobaltieri
Copy link
Member

@fabiobaltieri fabiobaltieri commented Oct 26, 2023

Picking up the work from #52355 and #42923, making this an internal library (similar to i2c_bitbang or can_mcan) rather than a subsystem api.


We currently have three keyboard scanning drivers in the code base (npcx, it8xxx2 and mchp_xec, last two yet to be converted to input). These have been largely copy pasted from each other and share a lot of the same structure and code.

This PR lays a foundation to start decoupling feature from those drivers into a common code base, and it is heavily inspired by the current regulator common data/config one.

Feature wise this only moves the thread struct, stack and initialization to the common code and declares the thread callback as the only API, but the intent is to move as much code as possible in there an only abstract device specific callbacks in the api structures.

@fabiobaltieri fabiobaltieri force-pushed the input-keyboard branch 5 times, most recently from 88b4ff3 to 2718825 Compare October 26, 2023 16:47
struct input_kbd_matrix_common_data {
struct k_thread thread;

K_KERNEL_STACK_MEMBER(thread_stack, CONFIG_INPUT_KBD_THREAD_STACK_SIZE);
Copy link
Member Author

Choose a reason for hiding this comment

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

I finally understand why everyone puts a space before this one, checkpatch complains. Should really fix checkpatch, but Perl.

@fabiobaltieri fabiobaltieri marked this pull request as ready for review October 26, 2023 17:30
@fabiobaltieri fabiobaltieri self-assigned this Oct 26, 2023
@zephyrbot zephyrbot added area: Input Input Subsystem and Drivers platform: Nuvoton NPCX Nuvoton NPCX area: Devicetree Binding PR modifies or adds a Device Tree binding labels Oct 26, 2023
ChiHuaL
ChiHuaL previously approved these changes Oct 30, 2023
MulinChao
MulinChao previously approved these changes Oct 30, 2023
keith-zephyr
keith-zephyr previously approved these changes Oct 30, 2023
We currently have three keyboard scanning drivers in the code base
(npcx, it8xxx2 and mchp_xec, last two yet to be converted to input).
These have been largely copy pasted from each other and share a lot of
the same structure and code.

This PR lays a foundation to start decoupling feature from those drivers
into a common code base, and it is heavily inspired by the current
regulator common data/config one.

Feature wise this only moves the thread struct, stack and initialization
to the common code and declares the thread callback as the only API, but
the intent is to move as much code as possible in there an only abstract
device specific callbacks in the api structures.

Signed-off-by: Fabio Baltieri <[email protected]>
@fabiobaltieri
Copy link
Member Author

Merge conflict, rebased.

@carlescufi carlescufi merged commit d3d484c into zephyrproject-rtos:main Oct 31, 2023
18 checks passed
@fabiobaltieri fabiobaltieri deleted the input-keyboard branch October 31, 2023 09:43
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 platform: Nuvoton NPCX Nuvoton NPCX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants