-
Notifications
You must be signed in to change notification settings - Fork 676
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
Open
bjarki-andreasen
wants to merge
11
commits into
nrfconnect:main
Choose a base branch
from
bjarki-andreasen:device-deinit-driver-support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Device deinit driver support #2987
bjarki-andreasen
wants to merge
11
commits into
nrfconnect:main
from
bjarki-andreasen:device-deinit-driver-support
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 691b3356f8fceb5d58600e43140dba55dbe1581d)
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 652635fab9d41d763716cd188414b45f4049c7a9)
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 1663253de65a9c0196581685c53de1f4b4e244a5)
Implement device deinit for nRF SPIM device driver. Signed-off-by: Bjarki Arge Andreasen <[email protected]> (cherry picked from commit 2609cfbf4a9558146d6970cf3222dde7480cb4ad)
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 ecb5457898d748dbd906778044d058df2a15b53c)
…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 160c196435b4e38dc97d49ad4fd64b1505915a61)
Add device deinit variants of the I2C_DEVICE_DT_*_DEFINE macros. Signed-off-by: Bjarki Arge Andreasen <[email protected]> (cherry picked from commit 8a928ea1d7f57880a63693619cac99a6e673d18f)
Implement device deinit for the nRF TWIM device drivers. Signed-off-by: Bjarki Arge Andreasen <[email protected]> (cherry picked from commit bd73c739b4d22fcb2bc6d09bc988941d8b962568)
Implement device deinit hooks for nRF TWIS device driver. Signed-off-by: Bjarki Arge Andreasen <[email protected]> (cherry picked from commit f22ffee5c3e48dddeb2f0631ffe84e0d6c988770)
…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 db1f14e79a8bd427b7873f85ddb4b9981b3d889e)
…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 e0fa444b8dbff03a05a7942825dca8c5bd0109a9)
8bdb2ed
to
c6effa3
Compare
|
ping @anangl @kl-cruz @maciejpietras @nika-nordic :) |
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