-
Notifications
You must be signed in to change notification settings - Fork 716
Device deinit driver support #2987
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
Merged
carlescufi
merged 11 commits into
nrfconnect:main
from
bjarki-andreasen:device-deinit-driver-support
Jul 3, 2025
Merged
Device deinit driver support #2987
carlescufi
merged 11 commits into
nrfconnect:main
from
bjarki-andreasen:device-deinit-driver-support
Jul 3, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7c0463b to
8bdb2ed
Compare
|
The change request is regarding a commit adding stuff to the zephyr release notes, this commit is not cherry picked, so merge with superpowers should be ok :) |
The usage of nrf_gpio_port_retain_disable/_enable, in cases where the soc pins support retention, every pin must be retained/unretained regardless of what power domain the pad is in. This patch ensures retain is applied to all pins in all domains by the gpio_nrfx device driver, not only pins specifically in the fast_active_1 domain. Without this patch, pinctrl will correctly retain pins, while gpio_nrfx will fail to unretain them when again. We no longer check the output state either, which was passed with the flags arg of gpio_nrfx_gpd_retain_set() so this arg has been removed. Signed-off-by: Bjarki Arge Andreasen <[email protected]> (cherry picked from commit 691b335)
Pins can be configured to retain their config even when the power domain they belong to is suspended. Update pinctrl_nrf to enable retain only if the pin has been configured and is not in use (pincnf is low-power/sleep), disable retain otherwise. Signed-off-by: Bjarki Arge Andreasen <[email protected]> (cherry picked from commit 652635f)
Add DEVICE_DEINIT variants of SPI_DEVICE_ macros. These include - SPI_DEVICE_DT_DEINIT_DEFINE() - SPI_DEVICE_DT_INST_DEINIT_DEFINE() Signed-off-by: Bjarki Arge Andreasen <[email protected]> (cherry picked from commit 1663253)
Implement device deinit for nRF SPIM device driver. Signed-off-by: Bjarki Arge Andreasen <[email protected]> (cherry picked from commit 2609cfb)
Introduce test for device_deinit() which deinitializes the spi bus, then configures miso as input, mosi as output using gpio, utilizing the loopback to test directly controlling the pins. Then reinit the spi device. Signed-off-by: Bjarki Arge Andreasen <[email protected]> (cherry picked from commit ecb5457)
…h miso/mosi Add miso-gpios and mosi-gpios to nrf overlays required for device_deinit testing. Signed-off-by: Bjarki Arge Andreasen <[email protected]> (cherry picked from commit 160c196)
Add device deinit variants of the I2C_DEVICE_DT_*_DEFINE macros. Signed-off-by: Bjarki Arge Andreasen <[email protected]> (cherry picked from commit 8a928ea)
Implement device deinit for the nRF TWIM device drivers. Signed-off-by: Bjarki Arge Andreasen <[email protected]> (cherry picked from commit bd73c73)
Implement device deinit hooks for nRF TWIS device driver. Signed-off-by: Bjarki Arge Andreasen <[email protected]> (cherry picked from commit f22ffee)
…t case Add device_deinit test case which, in case there are two devices using gpio loopbacks, deinits both controller and target devices, then uses gpio to configure and toggle the pins of the bus, then reinitializes both devices. Signed-off-by: Bjarki Arge Andreasen <[email protected]> (cherry picked from commit db1f14e)
…ith bus gpios Add bus gpios to zephyr,user node in nrf overlays to enable testing device_deinit test case. Signed-off-by: Bjarki Arge Andreasen <[email protected]> (cherry picked from commit e0fa444)
8bdb2ed to
c6effa3
Compare
|
|
ping @anangl @kl-cruz @maciejpietras @nika-nordic :) |
carlescufi
approved these changes
Jul 3, 2025
anangl
approved these changes
Jul 3, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.



Device deinit driver support