pm: use actions for device PM control

Instead of passing target states, use actions for device PM control.
Actions represent better the meaning of the callback argument.
Furthermore, they are more future proof as they can be suitable for
other PM actions that have no direct mapping to a state. If we compare
with Linux, we could have a multi-stage suspend/resume. Such scenario
would not have a good mapping when using target states.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
diff --git a/drivers/display/display_st7735r.c b/drivers/display/display_st7735r.c
index bfa60af..c7a596b 100644
--- a/drivers/display/display_st7735r.c
+++ b/drivers/display/display_st7735r.c
@@ -495,16 +495,16 @@
 
 #ifdef CONFIG_PM_DEVICE
 static int st7735r_pm_control(const struct device *dev,
-			      enum pm_device_state state)
+			      enum pm_device_action action)
 {
 	int ret = 0;
 	struct st7735r_data *data = (struct st7735r_data *)dev->data;
 
-	switch (state) {
-	case PM_DEVICE_STATE_ACTIVE:
+	switch (action) {
+	case PM_DEVICE_ACTION_RESUME:
 		ret = st7735r_exit_sleep(data);
 		break;
-	case PM_DEVICE_STATE_SUSPENDED:
+	case PM_DEVICE_ACTION_SUSPEND:
 		ret = st7735r_transmit(data, ST7735R_CMD_SLEEP_IN, NULL, 0);
 		break;
 	default:
diff --git a/drivers/display/display_st7789v.c b/drivers/display/display_st7789v.c
index 92106bd..fc02cd5 100644
--- a/drivers/display/display_st7789v.c
+++ b/drivers/display/display_st7789v.c
@@ -397,16 +397,16 @@
 
 #ifdef CONFIG_PM_DEVICE
 static int st7789v_pm_control(const struct device *dev,
-			      enum pm_device_state state)
+			      enum pm_device_action action)
 {
 	struct st7789v_data *data = (struct st7789v_data *)dev->data;
 	int ret = 0;
 
-	switch (state) {
-	case PM_DEVICE_STATE_ACTIVE:
+	switch (action) {
+	case PM_DEVICE_ACTION_RESUME:
 		st7789v_exit_sleep(data);
 		break;
-	case PM_DEVICE_STATE_SUSPENDED:
+	case PM_DEVICE_ACTION_SUSPEND:
 		ret = st7789v_transmit(data, ST7789V_CMD_SLEEP_IN, NULL, 0);
 		break;
 	default:
diff --git a/drivers/entropy/entropy_cc13xx_cc26xx.c b/drivers/entropy/entropy_cc13xx_cc26xx.c
index bdb5640..c8e411d 100644
--- a/drivers/entropy/entropy_cc13xx_cc26xx.c
+++ b/drivers/entropy/entropy_cc13xx_cc26xx.c
@@ -265,16 +265,16 @@
 
 #ifdef CONFIG_PM_DEVICE
 static int entropy_cc13xx_cc26xx_pm_control(const struct device *dev,
-					    enum pm_device_state state)
+					    enum pm_device_action action)
 {
 	struct entropy_cc13xx_cc26xx_data *data = get_dev_data(dev);
 
-	switch (state) {
-	case PM_DEVICE_STATE_ACTIVE:
+	switch (action) {
+	case PM_DEVICE_ACTION_RESUME:
 		Power_setDependency(PowerCC26XX_PERIPH_TRNG);
 		start_trng(data);
 		break;
-	case PM_DEVICE_STATE_SUSPENDED:
+	case PM_DEVICE_ACTION_SUSPEND:
 		stop_trng(data);
 		Power_releaseDependency(PowerCC26XX_PERIPH_TRNG);
 		break;
diff --git a/drivers/ethernet/eth_mcux.c b/drivers/ethernet/eth_mcux.c
index 188f32a..4227d98 100644
--- a/drivers/ethernet/eth_mcux.c
+++ b/drivers/ethernet/eth_mcux.c
@@ -185,7 +185,7 @@
 void eth_mcux_phy_stop(struct eth_context *context);
 
 static int eth_mcux_device_pm_control(const struct device *dev,
-				      enum pm_device_state state)
+				      enum pm_device_action action)
 {
 	struct eth_context *eth_ctx = (struct eth_context *)dev->data;
 	int ret = 0;
@@ -197,8 +197,8 @@
 		goto out;
 	}
 
-	switch (state) {
-	case PM_DEVICE_STATE_SUSPENDED:
+	switch (action) {
+	case PM_DEVICE_ACTION_SUSPEND:
 		LOG_DBG("Suspending");
 
 		ret = net_if_suspend(eth_ctx->iface);
@@ -214,7 +214,7 @@
 		clock_control_off(eth_ctx->clock_dev,
 			(clock_control_subsys_t)eth_ctx->clock);
 		break;
-	case PM_DEVICE_STATE_ACTIVE:
+	case PM_DEVICE_ACTION_RESUME:
 		LOG_DBG("Resuming");
 
 		clock_control_on(eth_ctx->clock_dev,
diff --git a/drivers/flash/spi_flash_at45.c b/drivers/flash/spi_flash_at45.c
index cc747c9..ad6afa0 100644
--- a/drivers/flash/spi_flash_at45.c
+++ b/drivers/flash/spi_flash_at45.c
@@ -625,18 +625,18 @@
 
 #if IS_ENABLED(CONFIG_PM_DEVICE)
 static int spi_flash_at45_pm_control(const struct device *dev,
-				     enum pm_device_state state)
+				     enum pm_device_action action)
 {
 	const struct spi_flash_at45_config *dev_config = get_dev_config(dev);
 
-	switch (state) {
-	case PM_DEVICE_STATE_ACTIVE:
+	switch (action) {
+	case PM_DEVICE_ACTION_RESUME:
 		acquire(dev);
 		power_down_op(dev, CMD_EXIT_DPD, dev_config->t_exit_dpd);
 		release(dev);
 		break;
 
-	case PM_DEVICE_STATE_SUSPENDED:
+	case PM_DEVICE_ACTION_SUSPEND:
 		acquire(dev);
 		power_down_op(dev,
 			dev_config->use_udpd ? CMD_ENTER_UDPD : CMD_ENTER_DPD,
diff --git a/drivers/gpio/gpio_dw.c b/drivers/gpio/gpio_dw.c
index d57834e..d44ea78 100644
--- a/drivers/gpio/gpio_dw.c
+++ b/drivers/gpio/gpio_dw.c
@@ -430,13 +430,13 @@
 * the *context may include IN data or/and OUT data
 */
 static int gpio_dw_device_ctrl(const struct device *dev,
-			       enum pm_device_state state)
+			       enum pm_device_action action)
 {
-	switch (state) {
-	case PM_DEVICE_STATE_SUSPENDED:
+	switch (action) {
+	case PM_DEVICE_ACTION_SUSPEND:
 		gpio_dw_clock_off(dev);
 		break;
-	case PM_DEVICE_STATE_ACTIVE:
+	case PM_DEVICE_ACTION_RESUME:
 		gpio_dw_clock_on(dev);
 		break;
 	default:
diff --git a/drivers/gpio/gpio_stm32.c b/drivers/gpio/gpio_stm32.c
index fe66163..8b1ff3d 100644
--- a/drivers/gpio/gpio_stm32.c
+++ b/drivers/gpio/gpio_stm32.c
@@ -575,12 +575,12 @@
 
 #ifdef CONFIG_PM_DEVICE
 static int gpio_stm32_pm_device_ctrl(const struct device *dev,
-				     enum pm_device_state state)
+				     enum pm_device_action action)
 {
-	switch (state) {
-	case PM_DEVICE_STATE_ACTIVE:
+	switch (action) {
+	case PM_DEVICE_ACTION_RESUME:
 		return gpio_stm32_clock_request(dev, true);
-	case PM_DEVICE_STATE_SUSPENDED:
+	case PM_DEVICE_ACTION_SUSPEND:
 		return gpio_stm32_clock_request(dev, false);
 	default:
 		return -ENOTSUP;
diff --git a/drivers/i2c/i2c_cc13xx_cc26xx.c b/drivers/i2c/i2c_cc13xx_cc26xx.c
index 1343c93..38e7449 100644
--- a/drivers/i2c/i2c_cc13xx_cc26xx.c
+++ b/drivers/i2c/i2c_cc13xx_cc26xx.c
@@ -327,12 +327,12 @@
 
 #ifdef CONFIG_PM_DEVICE
 static int i2c_cc13xx_cc26xx_pm_control(const struct device *dev,
-					enum pm_device_state state)
+					enum pm_device_action action)
 {
 	int ret = 0;
 
-	switch (state) {
-	case PM_DEVICE_STATE_ACTIVE:
+	switch (action) {
+	case PM_DEVICE_ACTION_RESUME:
 		Power_setDependency(PowerCC26XX_PERIPH_I2C0);
 		IOCPinTypeI2c(get_dev_config(dev)->base,
 			get_dev_config(dev)->sda_pin,
@@ -343,7 +343,7 @@
 			I2CMasterIntEnable(get_dev_config(dev)->base);
 		}
 		break;
-	case PM_DEVICE_STATE_SUSPENDED:
+	case PM_DEVICE_ACTION_SUSPEND:
 		I2CMasterIntDisable(get_dev_config(dev)->base);
 		I2CMasterDisable(get_dev_config(dev)->base);
 		/* Reset pin type to default GPIO configuration */
diff --git a/drivers/i2c/i2c_nrfx_twi.c b/drivers/i2c/i2c_nrfx_twi.c
index 99f9fc2..21c1bc7 100644
--- a/drivers/i2c/i2c_nrfx_twi.c
+++ b/drivers/i2c/i2c_nrfx_twi.c
@@ -217,12 +217,12 @@
 
 #ifdef CONFIG_PM_DEVICE
 static int twi_nrfx_pm_control(const struct device *dev,
-			       enum pm_device_state state)
+			       enum pm_device_action action)
 {
 	int ret = 0;
 
-	switch (state) {
-	case PM_DEVICE_STATE_ACTIVE:
+	switch (action) {
+	case PM_DEVICE_ACTION_RESUME:
 		init_twi(dev);
 		if (get_dev_data(dev)->dev_config) {
 			i2c_nrfx_twi_configure(dev,
@@ -230,7 +230,7 @@
 		}
 		break;
 
-	case PM_DEVICE_STATE_SUSPENDED:
+	case PM_DEVICE_ACTION_SUSPEND:
 		nrfx_twi_uninit(&get_dev_config(dev)->twi);
 		break;
 
diff --git a/drivers/i2c/i2c_nrfx_twim.c b/drivers/i2c/i2c_nrfx_twim.c
index 4ee4362..1b84412 100644
--- a/drivers/i2c/i2c_nrfx_twim.c
+++ b/drivers/i2c/i2c_nrfx_twim.c
@@ -255,12 +255,12 @@
 
 #ifdef CONFIG_PM_DEVICE
 static int twim_nrfx_pm_control(const struct device *dev,
-				enum pm_device_state state)
+				enum pm_device_action action)
 {
 	int ret = 0;
 
-	switch (state) {
-	case PM_DEVICE_STATE_ACTIVE:
+	switch (action) {
+	case PM_DEVICE_ACTION_RESUME:
 		init_twim(dev);
 		if (get_dev_data(dev)->dev_config) {
 			i2c_nrfx_twim_configure(dev,
@@ -268,7 +268,7 @@
 		}
 		break;
 
-	case PM_DEVICE_STATE_SUSPENDED:
+	case PM_DEVICE_ACTION_SUSPEND:
 		nrfx_twim_uninit(&get_dev_config(dev)->twim);
 		break;
 
diff --git a/drivers/interrupt_controller/intc_arcv2_irq_unit.c b/drivers/interrupt_controller/intc_arcv2_irq_unit.c
index 7b52232..a5d9f36 100644
--- a/drivers/interrupt_controller/intc_arcv2_irq_unit.c
+++ b/drivers/interrupt_controller/intc_arcv2_irq_unit.c
@@ -175,16 +175,16 @@
  * @return operation result
  */
 static int arc_v2_irq_unit_device_ctrl(const struct device *dev,
-				       enum pm_device_state state)
+				       enum pm_device_action action)
 {
 	int ret = 0;
 	unsigned int key = arch_irq_lock();
 
-	switch (state) {
-	case PM_DEVICE_STATE_SUSPENDED:
+	switch (action) {
+	case PM_DEVICE_ACTION_SUSPEND:
 		ret = arc_v2_irq_unit_suspend(dev);
 		break;
-	case PM_DEVICE_STATE_ACTIVE:
+	case PM_DEVICE_ACTION_RESUME:
 		ret = arc_v2_irq_unit_resume(dev);
 		break;
 	default:
diff --git a/drivers/interrupt_controller/intc_ioapic.c b/drivers/interrupt_controller/intc_ioapic.c
index 36a212f..212be55 100644
--- a/drivers/interrupt_controller/intc_ioapic.c
+++ b/drivers/interrupt_controller/intc_ioapic.c
@@ -310,15 +310,15 @@
 */
 __pinned_func
 static int ioapic_device_ctrl(const struct device *dev,
-			      enum pm_device_state state)
+			      enum pm_device_action action)
 {
 	int ret = 0;
 
-	switch (state) {
-	case PM_DEVICE_STATE_ACTIVE:
+	switch (action) {
+	case PM_DEVICE_ACTION_RESUME:
 		ret = ioapic_resume_from_suspend(dev);
 		break;
-	case PM_DEVICE_STATE_SUSPENDED:
+	case PM_DEVICE_ACTION_SUSPEND:
 		ret = ioapic_suspend(dev);
 		break;
 	default:
diff --git a/drivers/interrupt_controller/intc_loapic.c b/drivers/interrupt_controller/intc_loapic.c
index ffaa410..0a8f055 100644
--- a/drivers/interrupt_controller/intc_loapic.c
+++ b/drivers/interrupt_controller/intc_loapic.c
@@ -409,15 +409,15 @@
 */
 __pinned_func
 static int loapic_device_ctrl(const struct device *dev,
-			      enum pm_device_state state)
+			      enum pm_device_action action)
 {
 	int ret = 0;
 
-	switch (state) {
-	case PM_DEVICE_STATE_SUSPENDED:
+	switch (action) {
+	case PM_DEVICE_ACTION_SUSPEND:
 		ret = loapic_suspend(dev);
 		break;
-	case PM_DEVICE_STATE_ACTIVE:
+	case PM_DEVICE_ACTION_RESUME:
 		ret = loapic_resume(dev);
 		break;
 	default:
diff --git a/drivers/led/led_pwm.c b/drivers/led/led_pwm.c
index a886800..7ca6afe 100644
--- a/drivers/led/led_pwm.c
+++ b/drivers/led/led_pwm.c
@@ -115,17 +115,31 @@
 
 #ifdef CONFIG_PM_DEVICE
 static int led_pwm_pm_control(const struct device *dev,
-			      enum pm_device_state state)
+			      enum pm_device_action action)
 {
 	const struct led_pwm_config *config = DEV_CFG(dev);
 
 	/* switch all underlying PWM devices to the new state */
 	for (size_t i = 0; i < config->num_leds; i++) {
+		int err;
+		enum pm_device_state state;
 		const struct led_pwm *led_pwm = &config->led[i];
 
 		LOG_DBG("Switching PWM %p to state %" PRIu32, led_pwm->dev, state);
-		int err = pm_device_state_set(led_pwm->dev, state);
 
+		/* NOTE: temporary solution, deserves proper fix */
+		switch (action) {
+		case PM_DEVICE_ACTION_RESUME:
+			state = PM_DEVICE_STATE_ACTIVE;
+			break;
+		case PM_DEVICE_ACTION_SUSPEND:
+			state = PM_DEVICE_STATE_SUSPENDED;
+			break;
+		default:
+			return -ENOTSUP;
+		}
+
+		err = pm_device_state_set(led_pwm->dev, state);
 		if (err) {
 			LOG_ERR("Cannot switch PWM %p power state", led_pwm->dev);
 		}
diff --git a/drivers/pwm/pwm_nrfx.c b/drivers/pwm/pwm_nrfx.c
index dee8e85..2aa29ca 100644
--- a/drivers/pwm/pwm_nrfx.c
+++ b/drivers/pwm/pwm_nrfx.c
@@ -292,15 +292,15 @@
 }
 
 static int pwm_nrfx_pm_control(const struct device *dev,
-			       enum pm_device_state state)
+			       enum pm_device_action action)
 {
 	int err = 0;
 
-	switch (state) {
-	case PM_DEVICE_STATE_ACTIVE:
+	switch (action) {
+	case PM_DEVICE_ACTION_RESUME:
 		err = pwm_nrfx_init(dev);
 		break;
-	case PM_DEVICE_STATE_SUSPENDED:
+	case PM_DEVICE_ACTION_SUSPEND:
 		pwm_nrfx_uninit(dev);
 		break;
 	default:
diff --git a/drivers/sensor/apds9960/apds9960.c b/drivers/sensor/apds9960/apds9960.c
index e1070e2..bff5e8b 100644
--- a/drivers/sensor/apds9960/apds9960.c
+++ b/drivers/sensor/apds9960/apds9960.c
@@ -409,14 +409,14 @@
 
 #ifdef CONFIG_PM_DEVICE
 static int apds9960_device_ctrl(const struct device *dev,
-				enum pm_device_state state)
+				enum pm_device_action action)
 {
 	const struct apds9960_config *config = dev->config;
 	struct apds9960_data *data = dev->data;
 	int ret = 0;
 
-	switch (state) {
-	case PM_DEVICE_STATE_ACTIVE:
+	switch (action) {
+	case PM_DEVICE_ACTION_RESUME:
 		if (i2c_reg_update_byte(data->i2c, config->i2c_address,
 					APDS9960_ENABLE_REG,
 					APDS9960_ENABLE_PON,
@@ -424,7 +424,7 @@
 			ret = -EIO;
 		}
 		break;
-	case PM_DEVICE_STATE_SUSPENDED:
+	case PM_DEVICE_ACTION_SUSPEND:
 		if (i2c_reg_update_byte(data->i2c, config->i2c_address,
 					APDS9960_ENABLE_REG,
 					APDS9960_ENABLE_PON, 0)) {
diff --git a/drivers/sensor/bme280/bme280.c b/drivers/sensor/bme280/bme280.c
index 3e75f02..9728518 100644
--- a/drivers/sensor/bme280/bme280.c
+++ b/drivers/sensor/bme280/bme280.c
@@ -410,16 +410,16 @@
 }
 
 #ifdef CONFIG_PM_DEVICE
-int bme280_pm_ctrl(const struct device *dev, enum pm_device_state state)
+int bme280_pm_ctrl(const struct device *dev, enum pm_device_action action)
 {
 	int ret = 0;
 
-	switch (state) {
-	case PM_DEVICE_STATE_ACTIVE:
+	switch (action) {
+	case PM_DEVICE_ACTION_RESUME:
 		/* Re-initialize the chip */
 		ret = bme280_chip_init(dev);
 		break;
-	case PM_DEVICE_STATE_SUSPENDED:
+	case PM_DEVICE_ACTION_SUSPEND:
 		/* Put the chip into sleep mode */
 		ret = bme280_reg_write(dev,
 			BME280_REG_CTRL_MEAS,
diff --git a/drivers/sensor/bmp388/bmp388.c b/drivers/sensor/bmp388/bmp388.c
index 0f02eee..a7fa11f 100644
--- a/drivers/sensor/bmp388/bmp388.c
+++ b/drivers/sensor/bmp388/bmp388.c
@@ -550,15 +550,15 @@
 
 #ifdef CONFIG_PM_DEVICE
 static int bmp388_device_ctrl(const struct device *dev,
-			      enum pm_device_state state)
+			      enum pm_device_action action)
 {
 	uint8_t reg_val;
 
-	switch (state) {
-	case PM_DEVICE_STATE_ACTIVE:
+	switch (action) {
+	case PM_DEVICE_ACTION_RESUME:
 		reg_val = BMP388_PWR_CTRL_MODE_NORMAL;
 		break;
-	case PM_DEVICE_STATE_SUSPENDED:
+	case PM_DEVICE_ACTION_SUSPEND:
 		reg_val = BMP388_PWR_CTRL_MODE_SLEEP;
 		break;
 	default:
diff --git a/drivers/sensor/bq274xx/bq274xx.c b/drivers/sensor/bq274xx/bq274xx.c
index ca61a51..3d1cd71 100644
--- a/drivers/sensor/bq274xx/bq274xx.c
+++ b/drivers/sensor/bq274xx/bq274xx.c
@@ -732,16 +732,16 @@
 }
 
 static int bq274xx_pm_control(const struct device *dev,
-			      enum pm_device_state state)
+			      enum pm_device_action action)
 {
 	int ret;
 	struct bq274xx_data *data = dev->data;
 
-	switch (state) {
-	case PM_DEVICE_STATE_OFF:
+	switch (action) {
+	case PM_DEVICE_ACTION_TURN_OFF:
 		ret = bq274xx_enter_shutdown_mode(data);
 		break;
-	case PM_DEVICE_STATE_ACTIVE:
+	case PM_DEVICE_ACTION_RESUME:
 		ret = bq274xx_exit_shutdown_mode(dev);
 		break;
 	default:
diff --git a/drivers/sensor/fdc2x1x/fdc2x1x.c b/drivers/sensor/fdc2x1x/fdc2x1x.c
index 4b58e72..c588443 100644
--- a/drivers/sensor/fdc2x1x/fdc2x1x.c
+++ b/drivers/sensor/fdc2x1x/fdc2x1x.c
@@ -482,7 +482,7 @@
  * @return 0 in case of success, negative error code otherwise.
  */
 static int fdc2x1x_device_pm_ctrl(const struct device *dev,
-				  enum pm_device_state state)
+				  enum pm_device_action action)
 {
 	int ret;
 	struct fdc2x1x_data *data = dev->data;
@@ -491,8 +491,8 @@
 
 	(void)pm_device_state_get(dev, &curr_state);
 
-	switch (state) {
-	case PM_DEVICE_STATE_ACTIVE:
+	switch (action) {
+	case PM_DEVICE_ACTION_RESUME:
 		if (curr_state == PM_DEVICE_STATE_OFF) {
 			ret = fdc2x1x_set_shutdown(dev, false);
 			if (ret) {
@@ -506,7 +506,7 @@
 		}
 
 		break;
-	case PM_DEVICE_STATE_SUSPENDED:
+	case PM_DEVICE_ACTION_SUSPEND:
 		if (curr_state == PM_DEVICE_STATE_OFF) {
 			ret = fdc2x1x_set_shutdown(dev, false);
 			if (ret) {
@@ -519,7 +519,7 @@
 		}
 
 		break;
-	case PM_DEVICE_STATE_OFF:
+	case PM_DEVICE_ACTION_TURN_OFF:
 		if (cfg->sd_gpio->name) {
 			ret = fdc2x1x_set_shutdown(dev, true);
 		} else {
diff --git a/drivers/sensor/lis2mdl/lis2mdl.c b/drivers/sensor/lis2mdl/lis2mdl.c
index 2e9eec0..165135c 100644
--- a/drivers/sensor/lis2mdl/lis2mdl.c
+++ b/drivers/sensor/lis2mdl/lis2mdl.c
@@ -443,14 +443,14 @@
 
 #ifdef CONFIG_PM_DEVICE
 static int lis2mdl_pm_control(const struct device *dev,
-			      enum pm_device_state state)
+			      enum pm_device_action action)
 {
 	const struct lis2mdl_config *config = dev->config;
 	stmdev_ctx_t *ctx = (stmdev_ctx_t *)&config->ctx;
 	int status = 0;
 
-	switch (state) {
-	case PM_DEVICE_STATE_ACTIVE:
+	switch (action) {
+	case PM_DEVICE_ACTION_RESUME:
 		if (config->single_mode) {
 			status = lis2mdl_operating_mode_set(ctx,
 						LIS2MDL_SINGLE_TRIGGER);
@@ -463,7 +463,7 @@
 		}
 		LOG_DBG("State changed to active");
 		break;
-	case PM_DEVICE_STATE_SUSPENDED:
+	case PM_DEVICE_ACTION_SUSPEND:
 		status = lis2mdl_operating_mode_set(ctx, LIS2MDL_POWER_DOWN);
 		if (status) {
 			LOG_ERR("Power down failed");
diff --git a/drivers/sensor/qdec_nrfx/qdec_nrfx.c b/drivers/sensor/qdec_nrfx/qdec_nrfx.c
index 3368165..b13f119 100644
--- a/drivers/sensor/qdec_nrfx/qdec_nrfx.c
+++ b/drivers/sensor/qdec_nrfx/qdec_nrfx.c
@@ -208,18 +208,18 @@
 
 #ifdef CONFIG_PM_DEVICE
 static int qdec_nrfx_pm_control(struct qdec_nrfx_data *data,
-				enum pm_device_state state)
+				enum pm_device_action action)
 {
-	switch (state) {
-	case PM_DEVICE_STATE_ACTIVE:
+	switch (action) {
+	case PM_DEVICE_ACTION_RESUME:
 		qdec_nrfx_gpio_ctrl(true);
 		nrfx_qdec_enable();
 		break;
-	case PM_DEVICE_STATE_OFF:
+	case PM_DEVICE_ACTION_TURN_OFF:
 		/* device must be uninitialized */
 		nrfx_qdec_uninit();
 		break;
-	case PM_DEVICE_STATE_SUSPENDED:
+	case PM_DEVICE_ACTION_SUSPEND:
 		/* device must be suspended */
 		nrfx_qdec_disable();
 		qdec_nrfx_gpio_ctrl(false);
diff --git a/drivers/sensor/sgp40/sgp40.c b/drivers/sensor/sgp40/sgp40.c
index 824547c..4258b64 100644
--- a/drivers/sensor/sgp40/sgp40.c
+++ b/drivers/sensor/sgp40/sgp40.c
@@ -186,16 +186,16 @@
 
 
 #ifdef CONFIG_PM_DEVICE
-static int sgp40_pm_ctrl(const struct device *dev, enum pm_device_state state)
+static int sgp40_pm_ctrl(const struct device *dev, enum pm_device_action action)
 {
 	uint16_t cmd;
 
-	switch (state) {
-	case PM_DEVICE_STATE_ACTIVE:
+	switch (action) {
+	case PM_DEVICE_ACTION_RESUME:
 		/* activate the hotplate by sending a measure command */
 		cmd = SGP40_CMD_MEASURE_RAW;
 		break;
-	case PM_DEVICE_STATE_SUSPENDED:
+	case PM_DEVICE_ACTION_SUSPEND:
 		cmd = SGP40_CMD_HEATER_OFF;
 		break;
 	default:
diff --git a/drivers/sensor/vcnl4040/vcnl4040.c b/drivers/sensor/vcnl4040/vcnl4040.c
index 0191ba2..6fa065f 100644
--- a/drivers/sensor/vcnl4040/vcnl4040.c
+++ b/drivers/sensor/vcnl4040/vcnl4040.c
@@ -219,7 +219,7 @@
 
 #ifdef CONFIG_PM_DEVICE
 static int vcnl4040_device_ctrl(const struct device *dev,
-				enum pm_device_state state)
+				enum pm_device_action action)
 {
 	int ret = 0;
 	uint16_t ps_conf;
@@ -234,8 +234,8 @@
 	if (ret < 0)
 		return ret;
 #endif
-	switch (state) {
-	case PM_DEVICE_STATE_ACTIVE:
+	switch (action) {
+	case PM_DEVICE_ACTION_RESUME:
 		/* Clear proximity shutdown */
 		ps_conf &= ~VCNL4040_PS_SD_MASK;
 
@@ -253,7 +253,7 @@
 			return ret;
 #endif
 		break;
-	case PM_DEVICE_STATE_SUSPENDED:
+	case PM_DEVICE_ACTION_SUSPEND:
 		/* Set proximity shutdown bit 0 */
 		ps_conf |= VCNL4040_PS_SD_MASK;
 
diff --git a/drivers/serial/uart_cc13xx_cc26xx.c b/drivers/serial/uart_cc13xx_cc26xx.c
index 799414e..50e7aec 100644
--- a/drivers/serial/uart_cc13xx_cc26xx.c
+++ b/drivers/serial/uart_cc13xx_cc26xx.c
@@ -398,12 +398,12 @@
 
 #ifdef CONFIG_PM_DEVICE
 static int uart_cc13xx_cc26xx_pm_control(const struct device *dev,
-					 enum pm_device_state state)
+					 enum pm_device_action action)
 {
 	int ret = 0;
 
-	switch (state) {
-	case PM_DEVICE_STATE_ACTIVE:
+	switch (action) {
+	case PM_DEVICE_ACTION_RESUME:
 		if (get_dev_conf(dev)->regs == DT_INST_REG_ADDR(0)) {
 			Power_setDependency(PowerCC26XX_PERIPH_UART0);
 		} else {
@@ -413,7 +413,7 @@
 		ret = uart_cc13xx_cc26xx_configure(dev,
 			&get_dev_data(dev)->uart_config);
 		break;
-	case PM_DEVICE_STATE_SUSPENDED:
+	case PM_DEVICE_ACTION_SUSPEND:
 		UARTDisable(get_dev_conf(dev)->regs);
 		/*
 		 * Release power dependency - i.e. potentially power
diff --git a/drivers/serial/uart_npcx.c b/drivers/serial/uart_npcx.c
index c95a4a5..7a8c4b7 100644
--- a/drivers/serial/uart_npcx.c
+++ b/drivers/serial/uart_npcx.c
@@ -439,11 +439,11 @@
 }
 
 static inline int uart_npcx_pm_control(const struct device *dev,
-				       enum pm_device_state state)
+				       enum pm_device_action action)
 {
 	/* If next device power state is SUSPEND power state */
-	switch (state) {
-	case PM_DEVICE_STATE_SUSPENDED:
+	switch (action) {
+	case PM_DEVICE_ACTION_SUSPEND:
 		/*
 		 * If uart device is busy with transmitting, the driver will
 		 * stay in while loop and wait for the transaction is completed.
diff --git a/drivers/serial/uart_nrfx_uart.c b/drivers/serial/uart_nrfx_uart.c
index 7b1328f..3a42474 100644
--- a/drivers/serial/uart_nrfx_uart.c
+++ b/drivers/serial/uart_nrfx_uart.c
@@ -1140,10 +1140,10 @@
 }
 
 static int uart_nrfx_pm_control(const struct device *dev,
-				enum pm_device_state state)
+				enum pm_device_action action)
 {
-	switch (state) {
-	case PM_DEVICE_STATE_ACTIVE:
+	switch (action) {
+	case PM_DEVICE_ACTION_RESUME:
 		uart_nrfx_pins_enable(dev, true);
 		nrf_uart_enable(uart0_addr);
 		if (RX_PIN_USED) {
@@ -1151,7 +1151,7 @@
 					      NRF_UART_TASK_STARTRX);
 		}
 		break;
-	case PM_DEVICE_STATE_SUSPENDED:
+	case PM_DEVICE_ACTION_SUSPEND:
 		nrf_uart_disable(uart0_addr);
 		uart_nrfx_pins_enable(dev, false);
 		break;
diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c
index 4ce9f1a..2521565 100644
--- a/drivers/serial/uart_nrfx_uarte.c
+++ b/drivers/serial/uart_nrfx_uarte.c
@@ -1832,15 +1832,15 @@
 
 
 static int uarte_nrfx_pm_control(const struct device *dev,
-				 enum pm_device_state state)
+				 enum pm_device_action action)
 {
 	NRF_UARTE_Type *uarte = get_uarte_instance(dev);
 #if defined(CONFIG_UART_ASYNC_API) || defined(UARTE_INTERRUPT_DRIVEN)
 	struct uarte_nrfx_data *data = get_dev_data(dev);
 #endif
 
-	switch (state) {
-	case PM_DEVICE_STATE_ACTIVE:
+	switch (action) {
+	case PM_DEVICE_ACTION_RESUME:
 		uarte_nrfx_pins_enable(dev, true);
 		nrf_uarte_enable(uarte);
 
@@ -1865,7 +1865,7 @@
 #endif
 		}
 		break;
-	case PM_DEVICE_STATE_SUSPENDED:
+	case PM_DEVICE_ACTION_SUSPEND:
 		/* Disabling UART requires stopping RX, but stop RX event is
 		 * only sent after each RX if async UART API is used.
 		 */
diff --git a/drivers/serial/uart_stm32.c b/drivers/serial/uart_stm32.c
index c7b06bd..705e6d8 100644
--- a/drivers/serial/uart_stm32.c
+++ b/drivers/serial/uart_stm32.c
@@ -1423,13 +1423,13 @@
 
 #ifdef CONFIG_PM_DEVICE
 static int uart_stm32_pm_control(const struct device *dev,
-				 enum pm_device_state state)
+				 enum pm_device_action action)
 {
 	USART_TypeDef *UartInstance = UART_STRUCT(dev);
 
 	/* setting a low power mode */
-	switch (state) {
-	case PM_DEVICE_STATE_SUSPENDED:
+	switch (action) {
+	case PM_DEVICE_ACTION_SUSPEND:
 #ifdef USART_ISR_BUSY
 		/* Make sure that no USART transfer is on-going */
 		while (LL_USART_IsActiveFlag_BUSY(UartInstance) == 1) {
diff --git a/drivers/spi/spi_cc13xx_cc26xx.c b/drivers/spi/spi_cc13xx_cc26xx.c
index dedc6ab..a95bd9b 100644
--- a/drivers/spi/spi_cc13xx_cc26xx.c
+++ b/drivers/spi/spi_cc13xx_cc26xx.c
@@ -209,17 +209,17 @@
 
 #ifdef CONFIG_PM_DEVICE
 static int spi_cc13xx_cc26xx_pm_control(const struct device *dev,
-					enum pm_device_state state)
+					enum pm_device_action action)
 {
-	switch (state) {
-	case PM_DEVICE_STATE_ACTIVE:
+	switch (action) {
+	case PM_DEVICE_ACTION_RESUME:
 		if (get_dev_config(dev)->base == DT_INST_REG_ADDR(0)) {
 			Power_setDependency(PowerCC26XX_PERIPH_SSI0);
 		} else {
 			Power_setDependency(PowerCC26XX_PERIPH_SSI1);
 		}
 		break;
-	case PM_DEVICE_STATE_SUSPENDED:
+	case PM_DEVICE_ACTION_SUSPEND:
 		SSIDisable(get_dev_config(dev)->base);
 		/*
 		 * Release power dependency
diff --git a/drivers/spi/spi_nrfx_spi.c b/drivers/spi/spi_nrfx_spi.c
index d66dc54..d70a6c5 100644
--- a/drivers/spi/spi_nrfx_spi.c
+++ b/drivers/spi/spi_nrfx_spi.c
@@ -278,20 +278,20 @@
 
 #ifdef CONFIG_PM_DEVICE
 static int spi_nrfx_pm_control(const struct device *dev,
-			       enum pm_device_state state)
+			       enum pm_device_action action)
 {
 	int ret = 0;
 	struct spi_nrfx_data *data = get_dev_data(dev);
 	const struct spi_nrfx_config *config = get_dev_config(dev);
 
-	switch (state) {
-	case PM_DEVICE_STATE_ACTIVE:
+	switch (action) {
+	case PM_DEVICE_ACTION_RESUME:
 		ret = init_spi(dev);
 		/* Force reconfiguration before next transfer */
 		data->ctx.config = NULL;
 		break;
 
-	case PM_DEVICE_STATE_SUSPENDED:
+	case PM_DEVICE_ACTION_SUSPEND:
 		nrfx_spi_uninit(&config->spi);
 		break;
 
diff --git a/drivers/spi/spi_nrfx_spim.c b/drivers/spi/spi_nrfx_spim.c
index 8c759ea..8765a21 100644
--- a/drivers/spi/spi_nrfx_spim.c
+++ b/drivers/spi/spi_nrfx_spim.c
@@ -325,20 +325,20 @@
 
 #ifdef CONFIG_PM_DEVICE
 static int spim_nrfx_pm_control(const struct device *dev,
-				enum pm_device_state state)
+				enum pm_device_action action)
 {
 	int ret = 0;
 	struct spi_nrfx_data *data = get_dev_data(dev);
 	const struct spi_nrfx_config *config = get_dev_config(dev);
 
-	switch (state) {
-	case PM_DEVICE_STATE_ACTIVE:
+	switch (action) {
+	case PM_DEVICE_ACTION_RESUME:
 		ret = init_spim(dev);
 		/* Force reconfiguration before next transfer */
 		data->ctx.config = NULL;
 		break;
 
-	case PM_DEVICE_STATE_SUSPENDED:
+	case PM_DEVICE_ACTION_SUSPEND:
 		nrfx_spim_uninit(&config->spim);
 		break;
 
diff --git a/drivers/timer/sys_clock_init.c b/drivers/timer/sys_clock_init.c
index ab55a00..1caaf3e 100644
--- a/drivers/timer/sys_clock_init.c
+++ b/drivers/timer/sys_clock_init.c
@@ -31,7 +31,7 @@
 }
 
 int __weak sys_clock_device_ctrl(const struct device *dev,
-				 enum pm_device_state state)
+				 enum pm_device_action action)
 {
 	return -ENOSYS;
 }
diff --git a/include/pm/device.h b/include/pm/device.h
index 52c481b..da52185 100644
--- a/include/pm/device.h
+++ b/include/pm/device.h
@@ -70,6 +70,16 @@
 	PM_DEVICE_FLAG_COUNT
 };
 
+/** @brief Device PM actions. */
+enum pm_device_action {
+	/** Suspend. */
+	PM_DEVICE_ACTION_SUSPEND,
+	/** Resume. */
+	PM_DEVICE_ACTION_RESUME,
+	/** Turn off. */
+	PM_DEVICE_ACTION_TURN_OFF,
+};
+
 /**
  * @brief Device PM info
  */
@@ -97,14 +107,14 @@
  * @brief Device power management control function callback.
  *
  * @param dev Device instance.
- * @param state Requested state.
+ * @param action Requested action.
  *
  * @retval 0 If successful.
- * @retval -ENOTSUP If the requested state is not supported.
+ * @retval -ENOTSUP If the requested action is not supported.
  * @retval Errno Other negative errno on failure.
  */
 typedef int (*pm_device_control_callback_t)(const struct device *dev,
-					    enum pm_device_state state);
+					    enum pm_device_action action);
 
 /**
  * @brief Get name of device PM state
diff --git a/samples/subsys/pm/device_pm/src/dummy_driver.c b/samples/subsys/pm/device_pm/src/dummy_driver.c
index 4f06813..b70b75a 100644
--- a/samples/subsys/pm/device_pm/src/dummy_driver.c
+++ b/samples/subsys/pm/device_pm/src/dummy_driver.c
@@ -87,13 +87,13 @@
 }
 
 static int dummy_device_pm_ctrl(const struct device *dev,
-				enum pm_device_state state)
+				enum pm_device_action action)
 {
-	switch (state) {
-	case PM_DEVICE_STATE_ACTIVE:
+	switch (action) {
+	case PM_DEVICE_ACTION_RESUME:
 		printk("child resuming..\n");
 		break;
-	case PM_DEVICE_STATE_SUSPENDED:
+	case PM_DEVICE_ACTION_SUSPEND:
 		printk("child suspending..\n");
 		break;
 	default:
diff --git a/samples/subsys/pm/device_pm/src/dummy_parent.c b/samples/subsys/pm/device_pm/src/dummy_parent.c
index c9b23ea..b80e4ed 100644
--- a/samples/subsys/pm/device_pm/src/dummy_parent.c
+++ b/samples/subsys/pm/device_pm/src/dummy_parent.c
@@ -25,13 +25,13 @@
 }
 
 static int dummy_parent_pm_ctrl(const struct device *dev,
-				enum pm_device_state state)
+				enum pm_device_action action)
 {
-	switch (state) {
-	case PM_DEVICE_STATE_ACTIVE:
+	switch (action) {
+	case PM_DEVICE_ACTION_RESUME:
 		printk("parent resuming..\n");
 		break;
-	case PM_DEVICE_STATE_SUSPENDED:
+	case PM_DEVICE_ACTION_SUSPEND:
 		printk("parent suspending..\n");
 		break;
 	default:
diff --git a/subsys/pm/device.c b/subsys/pm/device.c
index d19afbd..2ca48dc 100644
--- a/subsys/pm/device.c
+++ b/subsys/pm/device.c
@@ -132,6 +132,7 @@
 			enum pm_device_state state)
 {
 	int ret;
+	enum pm_device_action action;
 
 	if (dev->pm_control == NULL) {
 		return -ENOSYS;
@@ -143,12 +144,16 @@
 		    (dev->pm->state == PM_DEVICE_STATE_SUSPENDING)) {
 			return -EALREADY;
 		}
+
+		action = PM_DEVICE_ACTION_SUSPEND;
 		break;
 	case PM_DEVICE_STATE_ACTIVE:
 		if ((dev->pm->state == PM_DEVICE_STATE_ACTIVE) ||
 		    (dev->pm->state == PM_DEVICE_STATE_RESUMING)) {
 			return -EALREADY;
 		}
+
+		action = PM_DEVICE_ACTION_RESUME;
 		break;
 	case PM_DEVICE_STATE_FORCE_SUSPEND:
 		__fallthrough;
@@ -158,12 +163,14 @@
 		if (dev->pm->state == state) {
 			return -EALREADY;
 		}
+
+		action = PM_DEVICE_ACTION_TURN_OFF;
 		break;
 	default:
 		return -ENOTSUP;
 	}
 
-	ret = dev->pm_control(dev, state);
+	ret = dev->pm_control(dev, action);
 	if (ret < 0) {
 		return ret;
 	}
diff --git a/tests/net/pm/src/main.c b/tests/net/pm/src/main.c
index afbdb41..d7af22b 100644
--- a/tests/net/pm/src/main.c
+++ b/tests/net/pm/src/main.c
@@ -22,19 +22,19 @@
 };
 
 static int fake_dev_pm_control(const struct device *dev,
-			       enum pm_device_state state)
+			       enum pm_device_action action)
 {
 	struct fake_dev_context *ctx = dev->data;
 	int ret;
 
-	switch (state) {
-	case PM_DEVICE_STATE_SUSPENDED:
+	switch (action) {
+	case PM_DEVICE_ACTION_SUSPEND:
 		ret = net_if_suspend(ctx->iface);
 		if (ret == -EBUSY) {
 			goto out;
 		}
 		break;
-	case PM_DEVICE_STATE_ACTIVE:
+	case PM_DEVICE_ACTION_RESUME:
 		ret = net_if_resume(ctx->iface);
 		break;
 	default:
diff --git a/tests/subsys/pm/device_runtime/src/dummy_driver.c b/tests/subsys/pm/device_runtime/src/dummy_driver.c
index 9c597a3..17958e7 100644
--- a/tests/subsys/pm/device_runtime/src/dummy_driver.c
+++ b/tests/subsys/pm/device_runtime/src/dummy_driver.c
@@ -35,7 +35,7 @@
 }
 
 static int dummy_device_pm_ctrl(const struct device *dev,
-				enum pm_device_state state)
+				enum pm_device_action action)
 {
 	return 0;
 }
diff --git a/tests/subsys/pm/power_mgmt/src/dummy_driver.c b/tests/subsys/pm/power_mgmt/src/dummy_driver.c
index 7888519..60de4d0 100644
--- a/tests/subsys/pm/power_mgmt/src/dummy_driver.c
+++ b/tests/subsys/pm/power_mgmt/src/dummy_driver.c
@@ -20,7 +20,7 @@
 }
 
 static int dummy_device_pm_ctrl(const struct device *dev,
-				enum pm_device_state state)
+				enum pm_device_action action)
 {
 	return 0;
 }