Skip to content

Conversation

@fabiobaltieri
Copy link
Member

Hi, this is the first PR for the input subsystem, adding the core functionalities, sample, testing and documentation. This has been proposed in #54622 and is built on the proof of concept code presented there and in the architecture WG.

Tentatively planning to follow-up with the kscan adapter implementation, porting over the zephyr,gpio-keys driver and then the three kscan keyboard drivers (npcx, mchp and ite, there's some code dedup opportunity there).

Copy link
Member

@gmarull gmarull left a comment

Choose a reason for hiding this comment

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

overall lgtm, nice addition to Zephyr! Please check my comments

Copy link
Contributor

@rodrigopex rodrigopex left a comment

Choose a reason for hiding this comment

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

Zbus can handle all the event work done here without significant overhead. I think you should use zbus for this part. I will propose an alternative using zbus. If we have a Zephyr message bus in the RTOS, using another implementation of the same thing would be strange to an official input driver. Don't you fellows think? @fabiobaltieri @gmarull

@gmarull
Copy link
Member

gmarull commented Feb 23, 2023

Zbus can handle all the event work done here without significant overhead. I think you should use zbus for this part. I will propose an alternative using zbus. If we have a Zephyr message bus in the RTOS, using another implementation of the same thing would be strange to an official input driver. Don't you fellows think? @fabiobaltieri @gmarull

I haven't checked in detail, but from what I heard in the Arch WG, ZBus could be added as another option, so you'd have callbacks, thread+queue and zbus. I guess it's the most flexible solution.

gmarull
gmarull previously approved these changes Mar 6, 2023
Copy link
Contributor

@nordicjm nordicjm left a comment

Choose a reason for hiding this comment

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

Also needs an entry in the API table

Initial commit introducing the input subsystem into Zephyr.

Includes the input_event data structure, the input_report_* APIs, an
iterables sections based subscription API and two operation modes:
synchronous, where the listeners are called directly, and asynchronous,
where the listeners are called in a dedicated thread.

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

Also needs an entry in the API table

Yeah good point.

  • few more inline doc fixes
  • added an entry in docs/develop/api/overview

nordicjm
nordicjm previously approved these changes Mar 6, 2023
gmarull
gmarull previously approved these changes Mar 6, 2023
Copy link
Member

@gmarull gmarull left a comment

Choose a reason for hiding this comment

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

re-approval bot

rodrigopex
rodrigopex previously approved these changes Mar 6, 2023
Copy link
Contributor

@mbolivar-nordic mbolivar-nordic left a comment

Choose a reason for hiding this comment

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

Couple other suggestions for the docs. At least I got confused about whether input_report() is a function or a family of functions from just reading the documentation. Since the answer is "both", I think this could be made clearer

Add the initial documentation for the input subsystem.

Signed-off-by: Fabio Baltieri <[email protected]>
Add a first input sample in the subsys/input directory. This just prints
any input event on the console.

Signed-off-by: Fabio Baltieri <[email protected]>
Add some initial tests for the input subsystem, covering all the APIs in
both synchronous and thread mode.

Signed-off-by: Fabio Baltieri <[email protected]>
Add an entry for the input subsystem, experimental, 3.4.

Signed-off-by: Fabio Baltieri <[email protected]>
Add a maintainer section for Input.

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

Couple other suggestions for the docs. At least I got confused about whether input_report() is a function or a family of functions from just reading the documentation. Since the answer is "both", I think this could be made clearer

Cool, all applied.

@mbolivar-nordic mbolivar-nordic merged commit 3659017 into zephyrproject-rtos:main Mar 6, 2023
@fabiobaltieri fabiobaltieri deleted the input-core branch March 6, 2023 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants