Revert "feat(kscan): Add PM support to GPIO kscan drivers."
This reverts commit eeeaec0d05
.
This commit is contained in:
parent
e59008f1f1
commit
0779a03d3f
2 changed files with 2 additions and 52 deletions
|
@ -12,7 +12,6 @@
|
||||||
#include <zephyr/drivers/kscan.h>
|
#include <zephyr/drivers/kscan.h>
|
||||||
#include <zephyr/kernel.h>
|
#include <zephyr/kernel.h>
|
||||||
#include <zephyr/logging/log.h>
|
#include <zephyr/logging/log.h>
|
||||||
#include <zephyr/pm/device.h>
|
|
||||||
#include <zephyr/sys/util.h>
|
#include <zephyr/sys/util.h>
|
||||||
|
|
||||||
#include <zmk/debounce.h>
|
#include <zmk/debounce.h>
|
||||||
|
@ -319,28 +318,6 @@ static int kscan_direct_init(const struct device *dev) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_PM_DEVICE)
|
|
||||||
|
|
||||||
static int kscan_direct_pm_action(const struct device *dev, enum pm_device_action action) {
|
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
switch (action) {
|
|
||||||
case PM_DEVICE_ACTION_SUSPEND:
|
|
||||||
kscan_direct_disable(dev);
|
|
||||||
break;
|
|
||||||
case PM_DEVICE_ACTION_RESUME:
|
|
||||||
kscan_direct_enable(dev);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
ret = -ENOTSUP;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // IS_ENABLED(CONFIG_PM_DEVICE)
|
|
||||||
|
|
||||||
static const struct kscan_driver_api kscan_direct_api = {
|
static const struct kscan_driver_api kscan_direct_api = {
|
||||||
.config = kscan_direct_configure,
|
.config = kscan_direct_configure,
|
||||||
.enable_callback = kscan_direct_enable,
|
.enable_callback = kscan_direct_enable,
|
||||||
|
@ -377,9 +354,7 @@ static const struct kscan_driver_api kscan_direct_api = {
|
||||||
.toggle_mode = DT_INST_PROP(n, toggle_mode), \
|
.toggle_mode = DT_INST_PROP(n, toggle_mode), \
|
||||||
}; \
|
}; \
|
||||||
\
|
\
|
||||||
PM_DEVICE_DT_INST_DEFINE(n, kscan_direct_pm_action); \
|
DEVICE_DT_INST_DEFINE(n, &kscan_direct_init, NULL, &kscan_direct_data_##n, \
|
||||||
\
|
|
||||||
DEVICE_DT_INST_DEFINE(n, &kscan_direct_init, PM_DEVICE_DT_INST_GET(n), &kscan_direct_data_##n, \
|
|
||||||
&kscan_direct_config_##n, POST_KERNEL, CONFIG_KSCAN_INIT_PRIORITY, \
|
&kscan_direct_config_##n, POST_KERNEL, CONFIG_KSCAN_INIT_PRIORITY, \
|
||||||
&kscan_direct_api);
|
&kscan_direct_api);
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
#include <zephyr/devicetree.h>
|
#include <zephyr/devicetree.h>
|
||||||
#include <zephyr/drivers/gpio.h>
|
#include <zephyr/drivers/gpio.h>
|
||||||
#include <zephyr/drivers/kscan.h>
|
#include <zephyr/drivers/kscan.h>
|
||||||
#include <zephyr/pm/device.h>
|
|
||||||
#include <zephyr/kernel.h>
|
#include <zephyr/kernel.h>
|
||||||
#include <zephyr/logging/log.h>
|
#include <zephyr/logging/log.h>
|
||||||
#include <zephyr/sys/__assert.h>
|
#include <zephyr/sys/__assert.h>
|
||||||
|
@ -422,28 +421,6 @@ static int kscan_matrix_init(const struct device *dev) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_PM_DEVICE)
|
|
||||||
|
|
||||||
static int kscan_matrix_pm_action(const struct device *dev, enum pm_device_action action) {
|
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
switch (action) {
|
|
||||||
case PM_DEVICE_ACTION_SUSPEND:
|
|
||||||
kscan_matrix_disable(dev);
|
|
||||||
break;
|
|
||||||
case PM_DEVICE_ACTION_RESUME:
|
|
||||||
kscan_matrix_enable(dev);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
ret = -ENOTSUP;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // IS_ENABLED(CONFIG_PM_DEVICE)
|
|
||||||
|
|
||||||
static const struct kscan_driver_api kscan_matrix_api = {
|
static const struct kscan_driver_api kscan_matrix_api = {
|
||||||
.config = kscan_matrix_configure,
|
.config = kscan_matrix_configure,
|
||||||
.enable_callback = kscan_matrix_enable,
|
.enable_callback = kscan_matrix_enable,
|
||||||
|
@ -488,9 +465,7 @@ static const struct kscan_driver_api kscan_matrix_api = {
|
||||||
.diode_direction = INST_DIODE_DIR(n), \
|
.diode_direction = INST_DIODE_DIR(n), \
|
||||||
}; \
|
}; \
|
||||||
\
|
\
|
||||||
PM_DEVICE_DT_INST_DEFINE(n, kscan_matrix_pm_action); \
|
DEVICE_DT_INST_DEFINE(n, &kscan_matrix_init, NULL, &kscan_matrix_data_##n, \
|
||||||
\
|
|
||||||
DEVICE_DT_INST_DEFINE(n, &kscan_matrix_init, PM_DEVICE_DT_INST_GET(n), &kscan_matrix_data_##n, \
|
|
||||||
&kscan_matrix_config_##n, POST_KERNEL, CONFIG_KSCAN_INIT_PRIORITY, \
|
&kscan_matrix_config_##n, POST_KERNEL, CONFIG_KSCAN_INIT_PRIORITY, \
|
||||||
&kscan_matrix_api);
|
&kscan_matrix_api);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue