Skip to content

Conversation

@JordanYates
Copy link
Contributor

Adds a helper function for initializing devices into the expected power
state, through the devices pm_device_action_cb_t. This eliminates code
duplication between the init functions and the PM callback.

The expected device states in order of priority are:

  • No power applied to device, OFF
  • zephyr,pm-device-runtime-auto enabled, SUSPEND
  • Otherwise, ACTIVE

Re-opening reverted PR #60411, now that #60410 is merged and CI failures resolved

Jordan Yates added 6 commits July 26, 2023 09:03
Implement `gpio_pin_get_config` for the stellaris platform, and by
extension `qemu_cortex_m3`.

Signed-off-by: Jordan Yates <[email protected]>
Adds a helper function for initializing devices into the expected power
state, through the devices `pm_device_action_cb_t`. This eliminates code
duplication between the init functions and the PM callback.

The expected device states in order of priority are:
 * No power applied to device, `OFF`
 * `zephyr,pm-device-runtime-auto` enabled, `SUSPEND`
 * Otherwise, `ACTIVE`

Signed-off-by: Jordan Yates <[email protected]>
Let the driver compile without `PM_DEVICE_POWER_DOMAIN`, in which case
the driver only controls the GPIO, without notifying dependant devices.

Signed-off-by: Jordan Yates <[email protected]>
Startup power domains according to the expected final state given the
power supply and PM device runtime support.

Signed-off-by: Jordan Yates <[email protected]>
Update the expected power domain behaviour in the tests in line with
the driver implementation changes.

Signed-off-by: Jordan Yates <[email protected]>
Test that `pm_device_driver_init` puts devices into the appropriate
state depending on the devicetree configuration.

Signed-off-by: Jordan Yates <[email protected]>
@fabiobaltieri fabiobaltieri merged commit b979ee9 into zephyrproject-rtos:main Jul 26, 2023
@JordanYates JordanYates deleted the 230726_pm_device_init branch July 26, 2023 08:23
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.

6 participants