File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
applications/nrf_desktop/src/hw_interface Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 1212#include <zephyr/device.h>
1313#include <zephyr/drivers/sensor.h>
1414#include <zephyr/drivers/gpio.h>
15- #include <zephyr/pm/device .h>
15+ #include <zephyr/pm/device_runtime .h>
1616#include <pinctrl_soc.h>
1717
1818#include <app_event_manager.h>
@@ -262,13 +262,13 @@ static int enable_qdec(enum state next_state)
262262
263263 int err = 0 ;
264264
265- /* QDEC device driver starts in PM_DEVICE_STATE_ACTIVE state. */
266- if (state ! = STATE_DISABLED ) {
267- err = pm_device_action_run (qdec_dev , PM_DEVICE_ACTION_RESUME );
265+ /* QDEC device driver starts in PM_DEVICE_STATE_SUSPENDED state. */
266+ if (state = = STATE_DISABLED ) {
267+ err = pm_device_runtime_get (qdec_dev );
268268 }
269269
270270 if (err ) {
271- LOG_ERR ("Cannot resume QDEC" );
271+ LOG_ERR ("Cannot get QDEC" );
272272 return err ;
273273 }
274274
@@ -304,9 +304,9 @@ static int disable_qdec(enum state next_state)
304304 return err ;
305305 }
306306
307- err = pm_device_action_run (qdec_dev , PM_DEVICE_ACTION_SUSPEND );
307+ err = pm_device_runtime_put (qdec_dev );
308308 if (err ) {
309- LOG_ERR ("Cannot suspend QDEC" );
309+ LOG_ERR ("Cannot put QDEC" );
310310 } else {
311311 err = setup_wakeup ();
312312 if (!err ) {
You can’t perform that action at this time.
0 commit comments