-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Soft Off (take 3) #2085
Soft Off (take 3) #2085
Conversation
35bbe00
to
85f0d23
Compare
1ce6e05
to
0801377
Compare
0801377
to
b0ce505
Compare
60ac8b0
to
ecac94d
Compare
6c2dc72
to
82dbe3c
Compare
c3281e9
to
911ad68
Compare
@caksoylar Ok, I've pushed updated docs to cover the new sideband behavior kscan driver and how to use it with simple direct GPIO and for matrix integrated hardware combos. Would appreciate your feedback when you have a sec. |
docs/docs/features/soft-off.md
Outdated
|
||
- The `gpios` property should be a phandle-array with a fully defined GPIO pin and with the correct pull up/down and active high/low flags set. In the above example the soft on/off would be triggered by pulling the specified pin low, typically by pressing a switch that has the other leg connected to ground. | ||
|
||
#### Soft Off Waker |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am having some trouble understanding: Is this still necessary if you follow the "Simple Direct Pin" section under sideband?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So.. good question. Yes, but let me think if we could avoid it and just depend on the direct kscan itself to do the waking in that case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so did a little testing, and no, it isn't actually required in that case, you can directly use the small dedicated direct kscan as the soft off waker.... Let me think about how best to capture this in the docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@caksoylar Ok, pushed docs tweaks and changed the ZMK Uno shield to reflect the updated recommended approach that adds the extra waker only when using the matrix integrated approach.
* Code style to avoid goto. * Enable pm.c compilation via dedicated Kconfig flag. * Comment wakeup trigger PM behavior.
* Remove the painful scanned behavior trigger for now, future enhancement will restore this high level functionality using kscan directly.
* Allow specifying direct kscan driver pins using gpio-key list as an alternative.
* Instead of gpio key behavior trigger, add new kscan driver that decorates/wraps a given kscan driver and will invoke basic system behavior assigned to a given row + column, without the need for keymap mapping in the matrix transform, bypassing keymaps entirely.
* Invoke output selection from the slider on the ZMK Uno via sideband behavior setup, to simplify keymap.
* Add a small sleep to allow other threads to send data for the endpoint clearing before sleep.
* Properly implement the PM hook needed for sideband behavior kscan device to have wakeup source enabled on it.
* Add dedicated init priority for the sideband kscan. * Refactor sideband code for clarity. * Tweaks to direct kscan for clarity. * Make sideband behavior row optional for brevity. * Allow overriding ZMK Uno sideband behaviors.
* Document new sideband behavior kscan driver for integrated soft-off support.
* Use the correct property for extra GPIOs to make active for the waker before going into soft off state. * Change header depth for easier navigation of the soft off feature page. Co-authored-by: Pablo Martínez <[email protected]>
* When adding a dedicated GPIO pin for soft off/on, use the direct kscan as the waker, instead of adding an additional node.
* Avoid overwriting random memory by using iterable section created by Zephyr PM.
* Add new flag to differentiate soft off on peripherals that is invoked by split GATT svc and dedicated additional ones tied to GPIO pin.
5de1c85
to
89f564d
Compare
e414937
to
be0ada2
Compare
Ok, after some good discussion with @joelspadin around the cursed "scanned behavior trigger" we've decided to pursue another route. This PR replaces #1942 and removes the scanned trigger, as well as fixing the last few review items there. Hoping this will be the one that finally wins. A follow up PR will add "side band kscan behavior triggers" so that the "matrix integrated soft off" is supported sanely.