refactor: Fixes for soft-off based on review.

* Better naming for gpio-key behavior triggers.
* Tweaks to scanned behavior trigger to avoid bad semaphore use,
  and reduce chance of issues with slowly scanned matrixes.
* Various code cleanups of style issues.
This commit is contained in:
Peter Johanson
2023-12-20 18:08:40 -08:00
committed by Pete Johanson
parent 96968514e3
commit fceb0351a5
21 changed files with 237 additions and 239 deletions

View File

@@ -322,8 +322,6 @@ static int kscan_direct_init(const struct device *dev) {
#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);
@@ -332,11 +330,8 @@ static int kscan_direct_pm_action(const struct device *dev, enum pm_device_actio
kscan_direct_enable(dev);
break;
default:
ret = -ENOTSUP;
break;
return -ENOTSUP;
}
return ret;
}
#endif // IS_ENABLED(CONFIG_PM_DEVICE)

View File

@@ -425,8 +425,6 @@ static int kscan_matrix_init(const struct device *dev) {
#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);
@@ -435,11 +433,8 @@ static int kscan_matrix_pm_action(const struct device *dev, enum pm_device_actio
kscan_matrix_enable(dev);
break;
default:
ret = -ENOTSUP;
break;
return -ENOTSUP;
}
return ret;
}
#endif // IS_ENABLED(CONFIG_PM_DEVICE)