Skip to content

Commit 2aa67ef

Browse files
Flavio Ceolincfriedt
authored andcommitted
drivers: gpio_emul: Add dummy pm support
Add a simple device PM support to be used for tests. Signed-off-by: Flavio Ceolin <[email protected]>
1 parent 1c6507a commit 2aa67ef

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

drivers/gpio/gpio_emul.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <drivers/gpio/gpio_emul.h>
1212
#include <errno.h>
1313
#include <zephyr.h>
14+
#include <pm/device.h>
1415

1516
#include "gpio_utils.h"
1617

@@ -662,6 +663,19 @@ static int gpio_emul_init(const struct device *dev)
662663
return k_mutex_init(&drv_data->mu);
663664
}
664665

666+
#ifdef CONFIG_PM_DEVICE
667+
static int gpio_emul_pm_device_ctrl(const struct device *dev,
668+
enum pm_device_action action)
669+
{
670+
ARG_UNUSED(dev);
671+
ARG_UNUSED(action);
672+
673+
return 0;
674+
}
675+
#else
676+
#define gpio_emul_pm_device_ctrl NULL
677+
#endif
678+
665679
/*
666680
* Device Initialization
667681
*/
@@ -696,7 +710,7 @@ static int gpio_emul_init(const struct device *dev)
696710
}; \
697711
\
698712
DEVICE_DT_INST_DEFINE(_num, gpio_emul_init, \
699-
NULL, \
713+
gpio_emul_pm_device_ctrl, \
700714
&gpio_emul_data_##_num, \
701715
&gpio_emul_config_##_num, POST_KERNEL, \
702716
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \

0 commit comments

Comments
 (0)