diff --git a/meta-digi-dey/recipes-core/busybox/busybox/acpid.map b/meta-digi-dey/recipes-core/busybox/busybox/acpid.map index a7099c9d7..f3940541e 100644 --- a/meta-digi-dey/recipes-core/busybox/busybox/acpid.map +++ b/meta-digi-dey/recipes-core/busybox/busybox/acpid.map @@ -1,3 +1,3 @@ #s_type n_type(hex) s_code n_code value description EV_KEY 0x01 KEY_SLEEP 142 1 pswitch-standby -EV_KEY 0x01 KEY_POWER 116 0 pswitch-poweroff +EV_KEY 0x01 KEY_POWER 116 1 pswitch-poweroff diff --git a/meta-digi-dey/recipes-core/busybox/busybox/ccimx6qpsbc/standby b/meta-digi-dey/recipes-core/busybox/busybox/ccimx6qpsbc/standby deleted file mode 100755 index e6d8a31a5..000000000 --- a/meta-digi-dey/recipes-core/busybox/busybox/ccimx6qpsbc/standby +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/sh -#=============================================================================== -# -# standby -# -# Copyright (C) 2017-2019 by Digi International Inc. -# All rights reserved. -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 as published by -# the Free Software Foundation. -# -# -# !Description: suspend system to RAM -# -#=============================================================================== - -scriptname="$(basename $(readlink -f ${0}))" -syspower="/sys/power/state" -lockfile="/var/lock/${scriptname}.lock" -lockfd="9" - -BT_INIT="/etc/init.d/bluetooth-init" -BT_DAEMON="/etc/init.d/bluetooth" -NM_DAEMON="/etc/init.d/networkmanager" - -usage() { - printf "\nSuspend system to RAM memory\n" - printf "\nUsage: ${scriptname} [OPTIONS]\n - -h Show this help - \n" -} - -suspend_interfaces() { - # Stop NetworkManager before suspend - ${NM_DAEMON} stop - - # Suspend wireless interfaces - if [ -d "/proc/device-tree/wireless" ]; then - for i in $(sed -ne 's,^\(wlan[0-9]\)=.*,\1,g;T;p' /var/run/ifstate | sort -r); do - ifdown "${i}" && RESUME_IFACES="${RESUME_IFACES:+${RESUME_IFACES} }${i}" - done - grep -qs '^wlan' /proc/modules && rmmod wlan - fi - - # Suspend bluetooth interface - if [ -d "/proc/device-tree/bluetooth" ]; then - hciconfig hci0 2>&1 | grep -qs UP && up_bt_on_resume="1" - ${BT_DAEMON} stop >/dev/null - ${BT_INIT} stop >/dev/null - fi -} - -resume_interfaces() { - # Resume wireless interfaces - if [ -d "/proc/device-tree/wireless" ]; then - # Trigger wireless module loading event, and wait until the interface exists - udevadm trigger --action=add --attr-match="modalias=sdio:c00v0271d050A" - timeout 5 sh -c "while [ ! -d /sys/class/net/wlan0 ]; do sleep .2; done" 2>/dev/null - - # Bring up the interfaces that were bring down on suspend - for i in $(echo ${RESUME_IFACES} | tr ' ' '\n' | sort); do - grep -qs "^${i}" /var/run/ifstate || ifup "${i}" - done - fi - - # Resume bluetooth interface - if [ -d "/proc/device-tree/bluetooth" ]; then - if [ -n "${up_bt_on_resume}" ]; then - ${BT_INIT} start >/dev/null - ${BT_DAEMON} start >/dev/null - fi - fi - - # Resume NetworkManager after suspend - ${NM_DAEMON} start -} - -enter_critical_section() { - # Create lock file - eval "exec ${lockfd}>${lockfile}" - - # Acquire the lock in non blocking mode. Otherwise, additional calls - # to the script will be queued and the system will endlessly go in - # and out of suspend to ram - flock -n "${lockfd}" || exit 0 -} - -exit_critical_section() { - # Release the lock - flock -u "${lockfd}" -} - -while getopts "h" c; do - case "${c}" in - h) usage; exit;; - esac -done - -if [ -f "${syspower}" ]; then - # Avoid running multiple instances of this script in parallel - enter_critical_section - - # Pre-suspend actions - suspend_interfaces - - # Suspend the device - printf "mem" > ${syspower} - - # Post-resume actions - resume_interfaces - - exit_critical_section -else - printf "\n[ERROR] File ${syspower} not found\n\n" -fi diff --git a/meta-digi-dey/recipes-core/busybox/busybox/ccimx6qpsbc/standby-actions b/meta-digi-dey/recipes-core/busybox/busybox/ccimx6qpsbc/standby-actions deleted file mode 100644 index 0099a53aa..000000000 --- a/meta-digi-dey/recipes-core/busybox/busybox/ccimx6qpsbc/standby-actions +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/sh -#=============================================================================== -# -# standby-actions -# -# Copyright (C) 2019 by Digi International Inc. -# All rights reserved. -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 as published by -# the Free Software Foundation. -# -# -# !Description: manage interfaces before suspending and after resuming from -# suspend -# -#=============================================================================== - -if [ "${1}" == "pre" ]; then - # Stop NetworkManager before suspend - systemctl stop NetworkManager - - # Suspend wireless interfaces - if [ -d "/proc/device-tree/wireless" ]; then - for i in $(sed -ne 's,^\(wlan[0-9]\)=.*,\1,g;T;p' /var/run/ifstate | sort -r); do - ifdown "${i}" && RESUME_IFACES="${RESUME_IFACES:+${RESUME_IFACES} }${i}" - done - - echo ${RESUME_IFACES} > /tmp/suspend_wlan_ifaces - grep -qs '^wlan' /proc/modules && rmmod wlan - fi - - # Suspend bluetooth interface - if [ -d "/proc/device-tree/bluetooth" ]; then - hciconfig hci0 2>&1 | grep -qs UP && touch /tmp/up_bt_on_resume - systemctl stop bluetooth - systemctl stop bluetooth-init - fi -elif [ "${1}" == "post" ]; then - # Resume wireless interfaces - if [ -d "/proc/device-tree/wireless" ]; then - # Trigger wireless module loading event, and wait until the interface exists - udevadm trigger --action=add --attr-match="modalias=sdio:c00v0271d050A" - timeout 5 sh -c "while [ ! -d /sys/class/net/wlan0 ]; do sleep .2; done" 2>/dev/null - - # Bring up the interfaces that were brought down on suspend - for i in $(cat /tmp/suspend_wlan_ifaces | tr ' ' '\n' | sort); do - grep -qs "^${i}" /var/run/ifstate || ifup "${i}" - done - rm -f /tmp/suspend_wlan_ifaces - fi - - # Resume NetworkManager after suspend - systemctl start NetworkManager - - # Resume bluetooth interface - if [ -d "/proc/device-tree/bluetooth" ]; then - if [ -e "/tmp/up_bt_on_resume" ]; then - systemctl start bluetooth-init - systemctl start bluetooth - rm -f /tmp/up_bt_on_resume - fi - fi -fi diff --git a/meta-digi-dey/recipes-core/busybox/busybox/ccimx6sbc/standby-actions b/meta-digi-dey/recipes-core/busybox/busybox/ccimx6sbc/standby-actions deleted file mode 100644 index 0cc258048..000000000 --- a/meta-digi-dey/recipes-core/busybox/busybox/ccimx6sbc/standby-actions +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh -#=============================================================================== -# -# standby-actions -# -# Copyright (C) 2019-2021 by Digi International Inc. -# All rights reserved. -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 as published by -# the Free Software Foundation. -# -# -# !Description: manage interfaces before suspending and after resuming from -# suspend -# -#=============================================================================== - -if [ "${1}" == "pre" ]; then - # Stop NetworkManager before suspend - systemctl stop NetworkManager - - # Suspend wireless interfaces - if [ -d "/proc/device-tree/wireless" ]; then - for i in $(sed -ne 's,^\(wlan[0-9]\)=.*,\1,g;T;p' /var/run/ifstate | sort -r); do - ifdown "${i}" && RESUME_IFACES="${RESUME_IFACES:+${RESUME_IFACES} }${i}" - done - - echo ${RESUME_IFACES} > /tmp/suspend_wlan_ifaces - [ -e /sys/module/ath6kl_sdio ] && rmmod ath6kl_sdio ath6kl_core && echo "301" > /tmp/suspend_wlan_device_id - [ -e /sys/module/wlan ] && rmmod wlan && echo "50A" > /tmp/suspend_wlan_device_id - fi - - # Suspend bluetooth interface - if [ -d "/proc/device-tree/bluetooth" ]; then - hciconfig hci0 2>&1 | grep -qs UP && touch /tmp/up_bt_on_resume - systemctl stop bluetooth - systemctl stop bluetooth-init - fi -elif [ "${1}" == "post" ]; then - # Resume wireless interfaces - if [ -d "/proc/device-tree/wireless" ]; then - # Trigger wireless module loading event, and wait until the interface exists - udevadm trigger --action=add --attr-match="modalias=sdio:c00v0271d0$(cat /tmp/suspend_wlan_device_id)" - rm -rf /tmp/suspend_wlan_driver - timeout 5 sh -c "while [ ! -d /sys/class/net/wlan0 ]; do sleep .2; done" 2>/dev/null - - # Bring up the interfaces that were brought down on suspend - for i in $(cat /tmp/suspend_wlan_ifaces | tr ' ' '\n' | sort); do - grep -qs "^${i}" /var/run/ifstate || ifup "${i}" - done - rm -f /tmp/suspend_wlan_ifaces - fi - - # Resume NetworkManager after suspend - systemctl start NetworkManager - - # Resume bluetooth interface - if [ -d "/proc/device-tree/bluetooth" ]; then - if [ -e "/tmp/up_bt_on_resume" ]; then - systemctl start bluetooth-init - systemctl start bluetooth - rm -f /tmp/up_bt_on_resume - fi - fi -fi diff --git a/meta-digi-dey/recipes-core/busybox/busybox/ccimx6ul/acpid.map b/meta-digi-dey/recipes-core/busybox/busybox/ccimx6ul/acpid.map deleted file mode 100644 index f3940541e..000000000 --- a/meta-digi-dey/recipes-core/busybox/busybox/ccimx6ul/acpid.map +++ /dev/null @@ -1,3 +0,0 @@ -#s_type n_type(hex) s_code n_code value description -EV_KEY 0x01 KEY_SLEEP 142 1 pswitch-standby -EV_KEY 0x01 KEY_POWER 116 1 pswitch-poweroff diff --git a/meta-digi-dey/recipes-core/busybox/busybox/ccimx6ul/standby b/meta-digi-dey/recipes-core/busybox/busybox/ccimx6ul/standby deleted file mode 100755 index 1f1c9efb1..000000000 --- a/meta-digi-dey/recipes-core/busybox/busybox/ccimx6ul/standby +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/sh -#=============================================================================== -# -# standby -# -# Copyright (C) 2016-2018 by Digi International Inc. -# All rights reserved. -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 as published by -# the Free Software Foundation. -# -# -# !Description: suspend system to RAM -# -#=============================================================================== - -scriptname="$(basename $(readlink -f ${0}))" -syspower="/sys/power/state" -lockfile="/var/lock/${scriptname}.lock" -lockfd="9" - -BT_INIT="/etc/init.d/bluetooth-init" -BT_DAEMON="/etc/init.d/bluetooth" -NM_DAEMON="/etc/init.d/networkmanager" - -usage() { - printf "\nSuspend system to RAM memory\n" - printf "\nUsage: ${scriptname} [OPTIONS]\n - -h Show this help - \n" -} - -suspend_interfaces() { - # Stop NetworkManager before suspend - ${NM_DAEMON} stop - - # Suspend wireless interfaces - if [ -d "/proc/device-tree/wireless" ]; then - for i in $(sed -ne 's,^\(wlan[0-9]\)=.*,\1,g;T;p' /var/run/ifstate | sort -r); do - ifdown "${i}" && RESUME_IFACES="${RESUME_IFACES:+${RESUME_IFACES} }${i}" - done - grep -qs '^wlan' /proc/modules && rmmod wlan - fi - - # Suspend bluetooth interface - if [ -d "/proc/device-tree/bluetooth" ]; then - hciconfig hci0 2>&1 | grep -qs UP && up_bt_on_resume="1" - ${BT_DAEMON} stop >/dev/null - ${BT_INIT} stop >/dev/null - fi -} - -resume_interfaces() { - # Resume wireless interfaces - if [ -d "/proc/device-tree/wireless" ]; then - # Trigger wireless module loading event, and wait until the interface exists - udevadm trigger --action=add --attr-match="modalias=sdio:c00v0271d050A" - timeout 5 sh -c "while [ ! -d /sys/class/net/wlan0 ]; do sleep .2; done" 2>/dev/null - - # Bring up the interfaces that were bring down on suspend - for i in $(echo ${RESUME_IFACES} | tr ' ' '\n' | sort); do - grep -qs "^${i}" /var/run/ifstate || ifup "${i}" - done - fi - - # Resume bluetooth interface - if [ -d "/proc/device-tree/bluetooth" ]; then - if [ -n "${up_bt_on_resume}" ]; then - ${BT_INIT} start >/dev/null - ${BT_DAEMON} start >/dev/null - fi - fi - - # Resume NetworkManager after suspend - ${NM_DAEMON} start -} - -enter_critical_section() { - # Create lock file - eval "exec ${lockfd}>${lockfile}" - - # Acquire the lock in non blocking mode. Otherwise, additional calls - # to the script will be queued and the system will endlessly go in - # and out of suspend to ram - flock -n "${lockfd}" || exit 0 -} - -exit_critical_section() { - # Release the lock - flock -u "${lockfd}" -} - -while getopts "h" c; do - case "${c}" in - h) usage; exit;; - esac -done - -if [ -f "${syspower}" ]; then - # Avoid running multiple instances of this script in parallel - enter_critical_section - - # Pre-suspend actions - suspend_interfaces - - # Suspend the device - printf "mem" > ${syspower} - - # Post-resume actions - resume_interfaces - - exit_critical_section -else - printf "\n[ERROR] File ${syspower} not found\n\n" -fi diff --git a/meta-digi-dey/recipes-core/busybox/busybox/ccimx6ul/standby-actions b/meta-digi-dey/recipes-core/busybox/busybox/ccimx6ul/standby-actions deleted file mode 100644 index 0099a53aa..000000000 --- a/meta-digi-dey/recipes-core/busybox/busybox/ccimx6ul/standby-actions +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/sh -#=============================================================================== -# -# standby-actions -# -# Copyright (C) 2019 by Digi International Inc. -# All rights reserved. -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 as published by -# the Free Software Foundation. -# -# -# !Description: manage interfaces before suspending and after resuming from -# suspend -# -#=============================================================================== - -if [ "${1}" == "pre" ]; then - # Stop NetworkManager before suspend - systemctl stop NetworkManager - - # Suspend wireless interfaces - if [ -d "/proc/device-tree/wireless" ]; then - for i in $(sed -ne 's,^\(wlan[0-9]\)=.*,\1,g;T;p' /var/run/ifstate | sort -r); do - ifdown "${i}" && RESUME_IFACES="${RESUME_IFACES:+${RESUME_IFACES} }${i}" - done - - echo ${RESUME_IFACES} > /tmp/suspend_wlan_ifaces - grep -qs '^wlan' /proc/modules && rmmod wlan - fi - - # Suspend bluetooth interface - if [ -d "/proc/device-tree/bluetooth" ]; then - hciconfig hci0 2>&1 | grep -qs UP && touch /tmp/up_bt_on_resume - systemctl stop bluetooth - systemctl stop bluetooth-init - fi -elif [ "${1}" == "post" ]; then - # Resume wireless interfaces - if [ -d "/proc/device-tree/wireless" ]; then - # Trigger wireless module loading event, and wait until the interface exists - udevadm trigger --action=add --attr-match="modalias=sdio:c00v0271d050A" - timeout 5 sh -c "while [ ! -d /sys/class/net/wlan0 ]; do sleep .2; done" 2>/dev/null - - # Bring up the interfaces that were brought down on suspend - for i in $(cat /tmp/suspend_wlan_ifaces | tr ' ' '\n' | sort); do - grep -qs "^${i}" /var/run/ifstate || ifup "${i}" - done - rm -f /tmp/suspend_wlan_ifaces - fi - - # Resume NetworkManager after suspend - systemctl start NetworkManager - - # Resume bluetooth interface - if [ -d "/proc/device-tree/bluetooth" ]; then - if [ -e "/tmp/up_bt_on_resume" ]; then - systemctl start bluetooth-init - systemctl start bluetooth - rm -f /tmp/up_bt_on_resume - fi - fi -fi diff --git a/meta-digi-dey/recipes-core/busybox/busybox/ccimx8m/acpid.map b/meta-digi-dey/recipes-core/busybox/busybox/ccimx8m/acpid.map deleted file mode 100644 index f3940541e..000000000 --- a/meta-digi-dey/recipes-core/busybox/busybox/ccimx8m/acpid.map +++ /dev/null @@ -1,3 +0,0 @@ -#s_type n_type(hex) s_code n_code value description -EV_KEY 0x01 KEY_SLEEP 142 1 pswitch-standby -EV_KEY 0x01 KEY_POWER 116 1 pswitch-poweroff diff --git a/meta-digi-dey/recipes-core/busybox/busybox/ccimx8m/standby b/meta-digi-dey/recipes-core/busybox/busybox/ccimx8m/standby deleted file mode 100755 index b5b47210d..000000000 --- a/meta-digi-dey/recipes-core/busybox/busybox/ccimx8m/standby +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/sh -#=============================================================================== -# -# standby -# -# Copyright (C) 2020 by Digi International Inc. -# All rights reserved. -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 as published by -# the Free Software Foundation. -# -# -# !Description: suspend system to RAM -# -#=============================================================================== - -scriptname="$(basename $(readlink -f ${0}))" -syspower="/sys/power/state" -lockfile="/var/lock/${scriptname}.lock" -lockfd="9" - -BT_INIT="/etc/init.d/bluetooth-init" -BT_DAEMON="/etc/init.d/bluetooth" -NM_DAEMON="/etc/init.d/networkmanager" - -usage() { - printf "\nSuspend system to RAM memory\n" - printf "\nUsage: ${scriptname} [OPTIONS]\n - -h Show this help - \n" -} - -suspend_interfaces() { - # Stop NetworkManager before suspend - ${NM_DAEMON} stop - - # Suspend wireless interfaces - if [ -d "/proc/device-tree/wireless" ]; then - for i in $(sed -ne 's,^\(wlan[0-9]\)=.*,\1,g;T;p' /var/run/ifstate | sort -r); do - ifdown "${i}" && RESUME_IFACES="${RESUME_IFACES:+${RESUME_IFACES} }${i}" - done - grep -qs '^wlan' /proc/modules && rmmod wlan - fi - - # Suspend bluetooth interface - if [ -d "/proc/device-tree/bluetooth" ]; then - hciconfig hci0 2>&1 | grep -qs UP && up_bt_on_resume="1" - ${BT_DAEMON} stop >/dev/null - ${BT_INIT} stop >/dev/null - fi -} - -resume_interfaces() { - # Resume wireless interfaces - if [ -d "/proc/device-tree/wireless" ]; then - # Trigger wireless module loading event, and wait until the interface exists - udevadm trigger --action=add --attr-match="modalias=sdio:c00v0271d050A" - timeout 5 sh -c "while [ ! -d /sys/class/net/wlan0 ]; do sleep .2; done" 2>/dev/null - - # Bring up the interfaces that were bring down on suspend - for i in $(echo ${RESUME_IFACES} | tr ' ' '\n' | sort); do - grep -qs "^${i}" /var/run/ifstate || ifup "${i}" - done - fi - - # Resume bluetooth interface - if [ -d "/proc/device-tree/bluetooth" ]; then - if [ -n "${up_bt_on_resume}" ]; then - ${BT_INIT} start >/dev/null - ${BT_DAEMON} start >/dev/null - fi - fi - - # Resume NetworkManager after suspend - ${NM_DAEMON} start -} - -enter_critical_section() { - # Create lock file - eval "exec ${lockfd}>${lockfile}" - - # Acquire the lock in non blocking mode. Otherwise, additional calls - # to the script will be queued and the system will endlessly go in - # and out of suspend to ram - flock -n "${lockfd}" || exit 0 -} - -exit_critical_section() { - # Release the lock - flock -u "${lockfd}" -} - -while getopts "h" c; do - case "${c}" in - h) usage; exit;; - esac -done - -if [ -f "${syspower}" ]; then - # Avoid running multiple instances of this script in parallel - enter_critical_section - - # Pre-suspend actions - suspend_interfaces - - # Suspend the device - printf "mem" > ${syspower} - - # Post-resume actions - resume_interfaces - - exit_critical_section -else - printf "\n[ERROR] File ${syspower} not found\n\n" -fi diff --git a/meta-digi-dey/recipes-core/busybox/busybox/ccimx8m/standby-actions b/meta-digi-dey/recipes-core/busybox/busybox/ccimx8m/standby-actions deleted file mode 100644 index 8d564dc37..000000000 --- a/meta-digi-dey/recipes-core/busybox/busybox/ccimx8m/standby-actions +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/sh -#=============================================================================== -# -# standby-actions -# -# Copyright (C) 2020 by Digi International Inc. -# All rights reserved. -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 as published by -# the Free Software Foundation. -# -# -# !Description: manage interfaces before suspending and after resuming from -# suspend -# -#=============================================================================== - -if [ "${1}" == "pre" ]; then - # Stop NetworkManager before suspend - systemctl stop NetworkManager - - # Suspend wireless interfaces - if [ -d "/proc/device-tree/wireless" ]; then - for i in $(sed -ne 's,^\(wlan[0-9]\)=.*,\1,g;T;p' /var/run/ifstate | sort -r); do - ifdown "${i}" && RESUME_IFACES="${RESUME_IFACES:+${RESUME_IFACES} }${i}" - done - - echo ${RESUME_IFACES} > /tmp/suspend_wlan_ifaces - grep -qs '^wlan' /proc/modules && rmmod wlan - fi - - # Suspend bluetooth interface - if [ -d "/proc/device-tree/bluetooth" ]; then - hciconfig hci0 2>&1 | grep -qs UP && touch /tmp/up_bt_on_resume - systemctl stop bluetooth - systemctl stop bluetooth-init - fi - - # Configure Power LED for blinking in standby - if [ -d "/sys/class/leds/power:green" ]; then - # Configure LED for blinking - echo timer > /sys/class/leds/power\:green/trigger - # Turn LED on at max brightness - echo 19 > /sys/class/leds/power\:green/brightness - # Configure blinking timings - echo 100 > /sys/class/leds/power\:green/delay_on - echo 1000 > /sys/class/leds/power\:green/delay_off - fi -elif [ "${1}" == "post" ]; then - # Resume wireless interfaces - if [ -d "/proc/device-tree/wireless" ]; then - # Trigger wireless module loading event, and wait until the interface exists - udevadm trigger --action=add --attr-match="modalias=sdio:c00v0271d050A" - timeout 5 sh -c "while [ ! -d /sys/class/net/wlan0 ]; do sleep .2; done" 2>/dev/null - - # Bring up the interfaces that were brought down on suspend - for i in $(cat /tmp/suspend_wlan_ifaces | tr ' ' '\n' | sort); do - grep -qs "^${i}" /var/run/ifstate || ifup "${i}" - done - rm -f /tmp/suspend_wlan_ifaces - fi - - # Resume NetworkManager after suspend - systemctl start NetworkManager - - # Resume bluetooth interface - if [ -d "/proc/device-tree/bluetooth" ]; then - if [ -e "/tmp/up_bt_on_resume" ]; then - systemctl start bluetooth-init - systemctl start bluetooth - rm -f /tmp/up_bt_on_resume - fi - fi - - # Configure Power LED solid on after resume - if [ -d "/sys/class/leds/power:green" ]; then - # Reset LED settings by writing 0 to brigtness descriptor - echo 0 > /sys/class/leds/power\:green/brightness - # Turn LED on at max brightness - echo 19 > /sys/class/leds/power\:green/brightness - fi -fi diff --git a/meta-digi-dey/recipes-core/busybox/busybox/ccimx8x/acpid.map b/meta-digi-dey/recipes-core/busybox/busybox/ccimx8x/acpid.map deleted file mode 100644 index f3940541e..000000000 --- a/meta-digi-dey/recipes-core/busybox/busybox/ccimx8x/acpid.map +++ /dev/null @@ -1,3 +0,0 @@ -#s_type n_type(hex) s_code n_code value description -EV_KEY 0x01 KEY_SLEEP 142 1 pswitch-standby -EV_KEY 0x01 KEY_POWER 116 1 pswitch-poweroff diff --git a/meta-digi-dey/recipes-core/busybox/busybox/ccimx8x/standby b/meta-digi-dey/recipes-core/busybox/busybox/ccimx8x/standby deleted file mode 100755 index 6d369e54a..000000000 --- a/meta-digi-dey/recipes-core/busybox/busybox/ccimx8x/standby +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/sh -#=============================================================================== -# -# standby -# -# Copyright (C) 2018,2019 by Digi International Inc. -# All rights reserved. -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 as published by -# the Free Software Foundation. -# -# -# !Description: suspend system to RAM -# -#=============================================================================== - -scriptname="$(basename $(readlink -f ${0}))" -syspower="/sys/power/state" -lockfile="/var/lock/${scriptname}.lock" -lockfd="9" - -BT_INIT="/etc/init.d/bluetooth-init" -BT_DAEMON="/etc/init.d/bluetooth" -NM_DAEMON="/etc/init.d/networkmanager" - -usage() { - printf "\nSuspend system to RAM memory\n" - printf "\nUsage: ${scriptname} [OPTIONS]\n - -h Show this help - \n" -} - -suspend_interfaces() { - # Stop NetworkManager before suspend - ${NM_DAEMON} stop - - # Suspend wireless interfaces - if [ -d "/proc/device-tree/wireless" ]; then - for i in $(sed -ne 's,^\(wlan[0-9]\)=.*,\1,g;T;p' /var/run/ifstate | sort -r); do - ifdown "${i}" && RESUME_IFACES="${RESUME_IFACES:+${RESUME_IFACES} }${i}" - done - grep -qs '^wlan' /proc/modules && rmmod wlan - fi - - # Suspend bluetooth interface - if [ -d "/proc/device-tree/bluetooth" ]; then - hciconfig hci0 2>&1 | grep -qs UP && up_bt_on_resume="1" - ${BT_DAEMON} stop >/dev/null - ${BT_INIT} stop >/dev/null - fi -} - -resume_interfaces() { - # Resume wireless interfaces - if [ -d "/proc/device-tree/wireless" ]; then - # Trigger wireless module loading event, and wait until the interface exists - udevadm trigger --action=add --attr-match="modalias=pci:v0000168Cd0000003Esv*sd*bc*sc*i*" - timeout 5 sh -c "while [ ! -d /sys/class/net/wlan0 ]; do sleep .2; done" 2>/dev/null - - # Bring up the interfaces that were bring down on suspend - for i in $(echo ${RESUME_IFACES} | tr ' ' '\n' | sort); do - grep -qs "^${i}" /var/run/ifstate || ifup "${i}" - done - fi - - # Resume bluetooth interface - if [ -d "/proc/device-tree/bluetooth" ]; then - if [ -n "${up_bt_on_resume}" ]; then - ${BT_INIT} start >/dev/null - ${BT_DAEMON} start >/dev/null - fi - fi - - # Resume NetworkManager after suspend - ${NM_DAEMON} start -} - -enter_critical_section() { - # Create lock file - eval "exec ${lockfd}>${lockfile}" - - # Acquire the lock in non blocking mode. Otherwise, additional calls - # to the script will be queued and the system will endlessly go in - # and out of suspend to ram - flock -n "${lockfd}" || exit 0 -} - -exit_critical_section() { - # Release the lock - flock -u "${lockfd}" -} - -while getopts "h" c; do - case "${c}" in - h) usage; exit;; - esac -done - -if [ -f "${syspower}" ]; then - # Avoid running multiple instances of this script in parallel - enter_critical_section - - # Pre-suspend actions - suspend_interfaces - - # Suspend the device - printf "mem" > ${syspower} - - # Post-resume actions - resume_interfaces - - exit_critical_section -else - printf "\n[ERROR] File ${syspower} not found\n\n" -fi diff --git a/meta-digi-dey/recipes-core/busybox/busybox/ccimx93/acpid.map b/meta-digi-dey/recipes-core/busybox/busybox/ccimx93/acpid.map deleted file mode 100644 index f3940541e..000000000 --- a/meta-digi-dey/recipes-core/busybox/busybox/ccimx93/acpid.map +++ /dev/null @@ -1,3 +0,0 @@ -#s_type n_type(hex) s_code n_code value description -EV_KEY 0x01 KEY_SLEEP 142 1 pswitch-standby -EV_KEY 0x01 KEY_POWER 116 1 pswitch-poweroff diff --git a/meta-digi-dey/recipes-core/busybox/busybox/ccimx93/standby b/meta-digi-dey/recipes-core/busybox/busybox/ccimx93/standby deleted file mode 100755 index b5b47210d..000000000 --- a/meta-digi-dey/recipes-core/busybox/busybox/ccimx93/standby +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/sh -#=============================================================================== -# -# standby -# -# Copyright (C) 2020 by Digi International Inc. -# All rights reserved. -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 as published by -# the Free Software Foundation. -# -# -# !Description: suspend system to RAM -# -#=============================================================================== - -scriptname="$(basename $(readlink -f ${0}))" -syspower="/sys/power/state" -lockfile="/var/lock/${scriptname}.lock" -lockfd="9" - -BT_INIT="/etc/init.d/bluetooth-init" -BT_DAEMON="/etc/init.d/bluetooth" -NM_DAEMON="/etc/init.d/networkmanager" - -usage() { - printf "\nSuspend system to RAM memory\n" - printf "\nUsage: ${scriptname} [OPTIONS]\n - -h Show this help - \n" -} - -suspend_interfaces() { - # Stop NetworkManager before suspend - ${NM_DAEMON} stop - - # Suspend wireless interfaces - if [ -d "/proc/device-tree/wireless" ]; then - for i in $(sed -ne 's,^\(wlan[0-9]\)=.*,\1,g;T;p' /var/run/ifstate | sort -r); do - ifdown "${i}" && RESUME_IFACES="${RESUME_IFACES:+${RESUME_IFACES} }${i}" - done - grep -qs '^wlan' /proc/modules && rmmod wlan - fi - - # Suspend bluetooth interface - if [ -d "/proc/device-tree/bluetooth" ]; then - hciconfig hci0 2>&1 | grep -qs UP && up_bt_on_resume="1" - ${BT_DAEMON} stop >/dev/null - ${BT_INIT} stop >/dev/null - fi -} - -resume_interfaces() { - # Resume wireless interfaces - if [ -d "/proc/device-tree/wireless" ]; then - # Trigger wireless module loading event, and wait until the interface exists - udevadm trigger --action=add --attr-match="modalias=sdio:c00v0271d050A" - timeout 5 sh -c "while [ ! -d /sys/class/net/wlan0 ]; do sleep .2; done" 2>/dev/null - - # Bring up the interfaces that were bring down on suspend - for i in $(echo ${RESUME_IFACES} | tr ' ' '\n' | sort); do - grep -qs "^${i}" /var/run/ifstate || ifup "${i}" - done - fi - - # Resume bluetooth interface - if [ -d "/proc/device-tree/bluetooth" ]; then - if [ -n "${up_bt_on_resume}" ]; then - ${BT_INIT} start >/dev/null - ${BT_DAEMON} start >/dev/null - fi - fi - - # Resume NetworkManager after suspend - ${NM_DAEMON} start -} - -enter_critical_section() { - # Create lock file - eval "exec ${lockfd}>${lockfile}" - - # Acquire the lock in non blocking mode. Otherwise, additional calls - # to the script will be queued and the system will endlessly go in - # and out of suspend to ram - flock -n "${lockfd}" || exit 0 -} - -exit_critical_section() { - # Release the lock - flock -u "${lockfd}" -} - -while getopts "h" c; do - case "${c}" in - h) usage; exit;; - esac -done - -if [ -f "${syspower}" ]; then - # Avoid running multiple instances of this script in parallel - enter_critical_section - - # Pre-suspend actions - suspend_interfaces - - # Suspend the device - printf "mem" > ${syspower} - - # Post-resume actions - resume_interfaces - - exit_critical_section -else - printf "\n[ERROR] File ${syspower} not found\n\n" -fi diff --git a/meta-digi-dey/recipes-core/busybox/busybox/ccimx93/standby-actions b/meta-digi-dey/recipes-core/busybox/busybox/ccimx93/standby-actions deleted file mode 100644 index 8d564dc37..000000000 --- a/meta-digi-dey/recipes-core/busybox/busybox/ccimx93/standby-actions +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/sh -#=============================================================================== -# -# standby-actions -# -# Copyright (C) 2020 by Digi International Inc. -# All rights reserved. -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 as published by -# the Free Software Foundation. -# -# -# !Description: manage interfaces before suspending and after resuming from -# suspend -# -#=============================================================================== - -if [ "${1}" == "pre" ]; then - # Stop NetworkManager before suspend - systemctl stop NetworkManager - - # Suspend wireless interfaces - if [ -d "/proc/device-tree/wireless" ]; then - for i in $(sed -ne 's,^\(wlan[0-9]\)=.*,\1,g;T;p' /var/run/ifstate | sort -r); do - ifdown "${i}" && RESUME_IFACES="${RESUME_IFACES:+${RESUME_IFACES} }${i}" - done - - echo ${RESUME_IFACES} > /tmp/suspend_wlan_ifaces - grep -qs '^wlan' /proc/modules && rmmod wlan - fi - - # Suspend bluetooth interface - if [ -d "/proc/device-tree/bluetooth" ]; then - hciconfig hci0 2>&1 | grep -qs UP && touch /tmp/up_bt_on_resume - systemctl stop bluetooth - systemctl stop bluetooth-init - fi - - # Configure Power LED for blinking in standby - if [ -d "/sys/class/leds/power:green" ]; then - # Configure LED for blinking - echo timer > /sys/class/leds/power\:green/trigger - # Turn LED on at max brightness - echo 19 > /sys/class/leds/power\:green/brightness - # Configure blinking timings - echo 100 > /sys/class/leds/power\:green/delay_on - echo 1000 > /sys/class/leds/power\:green/delay_off - fi -elif [ "${1}" == "post" ]; then - # Resume wireless interfaces - if [ -d "/proc/device-tree/wireless" ]; then - # Trigger wireless module loading event, and wait until the interface exists - udevadm trigger --action=add --attr-match="modalias=sdio:c00v0271d050A" - timeout 5 sh -c "while [ ! -d /sys/class/net/wlan0 ]; do sleep .2; done" 2>/dev/null - - # Bring up the interfaces that were brought down on suspend - for i in $(cat /tmp/suspend_wlan_ifaces | tr ' ' '\n' | sort); do - grep -qs "^${i}" /var/run/ifstate || ifup "${i}" - done - rm -f /tmp/suspend_wlan_ifaces - fi - - # Resume NetworkManager after suspend - systemctl start NetworkManager - - # Resume bluetooth interface - if [ -d "/proc/device-tree/bluetooth" ]; then - if [ -e "/tmp/up_bt_on_resume" ]; then - systemctl start bluetooth-init - systemctl start bluetooth - rm -f /tmp/up_bt_on_resume - fi - fi - - # Configure Power LED solid on after resume - if [ -d "/sys/class/leds/power:green" ]; then - # Reset LED settings by writing 0 to brigtness descriptor - echo 0 > /sys/class/leds/power\:green/brightness - # Turn LED on at max brightness - echo 19 > /sys/class/leds/power\:green/brightness - fi -fi diff --git a/meta-digi-dey/recipes-core/busybox/busybox/ccmp1/standby b/meta-digi-dey/recipes-core/busybox/busybox/ccmp1/standby deleted file mode 100755 index 06845f069..000000000 --- a/meta-digi-dey/recipes-core/busybox/busybox/ccmp1/standby +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/sh -#=============================================================================== -# -# standby -# -# Copyright (C) 2022 by Digi International Inc. -# All rights reserved. -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 as published by -# the Free Software Foundation. -# -# -# !Description: suspend system to RAM -# -#=============================================================================== - -scriptname="$(basename $(readlink -f ${0}))" -syspower="/sys/power/state" -lockfile="/var/lock/${scriptname}.lock" -lockfd="9" - -BT_INIT="/etc/init.d/bluetooth-init" -BT_DAEMON="/etc/init.d/bluetooth" -NM_DAEMON="/etc/init.d/networkmanager" - -usage() { - printf "\nSuspend system to RAM memory\n" - printf "\nUsage: ${scriptname} [OPTIONS]\n - -h Show this help - \n" -} - -suspend_interfaces() { - # Stop NetworkManager before suspend - ${NM_DAEMON} stop - - # Suspend wireless interfaces - if [ -d "/proc/device-tree/wireless" ]; then - for i in $(sed -ne 's,^\(wlan[0-9]\)=.*,\1,g;T;p' /var/run/ifstate | sort -r); do - ifdown "${i}" && RESUME_IFACES="${RESUME_IFACES:+${RESUME_IFACES} }${i}" - done - grep -qs '^wlan' /proc/modules && rmmod wlan - fi - - # Suspend bluetooth interface - if [ -d "/proc/device-tree/bluetooth" ]; then - hciconfig hci0 2>&1 | grep -qs UP && up_bt_on_resume="1" - ${BT_DAEMON} stop >/dev/null - ${BT_INIT} stop >/dev/null - fi -} - -resume_interfaces() { - # Resume wireless interfaces - if [ -d "/proc/device-tree/wireless" ]; then - # Trigger wireless module loading event, and wait until the interface exists - udevadm trigger --action=add --attr-match="modalias=sdio:c00v0271d050A" - timeout 5 sh -c "while [ ! -d /sys/class/net/wlan0 ]; do sleep .2; done" 2>/dev/null - - # Bring up the interfaces that were bring down on suspend - for i in $(echo ${RESUME_IFACES} | tr ' ' '\n' | sort); do - grep -qs "^${i}" /var/run/ifstate || ifup "${i}" - done - fi - - # Resume bluetooth interface - if [ -d "/proc/device-tree/bluetooth" ]; then - if [ -n "${up_bt_on_resume}" ]; then - ${BT_INIT} start >/dev/null - ${BT_DAEMON} start >/dev/null - fi - fi - - # Resume NetworkManager after suspend - ${NM_DAEMON} start -} - -enter_critical_section() { - # Create lock file - eval "exec ${lockfd}>${lockfile}" - - # Acquire the lock in non blocking mode. Otherwise, additional calls - # to the script will be queued and the system will endlessly go in - # and out of suspend to ram - flock -n "${lockfd}" || exit 0 -} - -exit_critical_section() { - # Release the lock - flock -u "${lockfd}" -} - -while getopts "h" c; do - case "${c}" in - h) usage; exit;; - esac -done - -if [ -f "${syspower}" ]; then - # Avoid running multiple instances of this script in parallel - enter_critical_section - - # Pre-suspend actions - suspend_interfaces - - # Suspend the device - printf "mem" > ${syspower} - - # Post-resume actions - resume_interfaces - - exit_critical_section -else - printf "\n[ERROR] File ${syspower} not found\n\n" -fi diff --git a/meta-digi-dey/recipes-core/busybox/busybox/ccmp1/standby-actions b/meta-digi-dey/recipes-core/busybox/busybox/ccmp1/standby-actions deleted file mode 100644 index 6876f1d80..000000000 --- a/meta-digi-dey/recipes-core/busybox/busybox/ccmp1/standby-actions +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/sh -#=============================================================================== -# -# standby-actions -# -# Copyright (C) 2022 by Digi International Inc. -# All rights reserved. -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 as published by -# the Free Software Foundation. -# -# -# !Description: manage interfaces before suspending and after resuming from -# suspend -# -#=============================================================================== - -if [ "${1}" == "pre" ]; then - # Stop NetworkManager before suspend - systemctl stop NetworkManager - - # Suspend wireless interfaces - if [ -d "/proc/device-tree/wireless" ]; then - for i in $(sed -ne 's,^\(wlan[0-9]\)=.*,\1,g;T;p' /var/run/ifstate | sort -r); do - ifdown "${i}" && RESUME_IFACES="${RESUME_IFACES:+${RESUME_IFACES} }${i}" - done - - echo ${RESUME_IFACES} > /tmp/suspend_wlan_ifaces - grep -qs '^wlan' /proc/modules && rmmod wlan - fi - - # Suspend bluetooth interface - if [ -d "/proc/device-tree/bluetooth" ]; then - hciconfig hci0 2>&1 | grep -qs UP && touch /tmp/up_bt_on_resume - systemctl stop bluetooth - systemctl stop bluetooth-init - fi -elif [ "${1}" == "post" ]; then - # Resume wireless interfaces - if [ -d "/proc/device-tree/wireless" ]; then - # Trigger wireless module loading event, and wait until the interface exists - udevadm trigger --action=add --attr-match="modalias=sdio:c00v0271d050A" - timeout 5 sh -c "while [ ! -d /sys/class/net/wlan0 ]; do sleep .2; done" 2>/dev/null - - # Bring up the interfaces that were brought down on suspend - for i in $(cat /tmp/suspend_wlan_ifaces | tr ' ' '\n' | sort); do - grep -qs "^${i}" /var/run/ifstate || ifup "${i}" - done - rm -f /tmp/suspend_wlan_ifaces - fi - - # Resume NetworkManager after suspend - systemctl start NetworkManager - - # Resume bluetooth interface - if [ -d "/proc/device-tree/bluetooth" ]; then - if [ -e "/tmp/up_bt_on_resume" ]; then - systemctl start bluetooth-init - systemctl start bluetooth - rm -f /tmp/up_bt_on_resume - fi - fi -fi diff --git a/meta-digi-dey/recipes-core/busybox/busybox/ccimx6sbc/standby b/meta-digi-dey/recipes-core/busybox/busybox/standby similarity index 95% rename from meta-digi-dey/recipes-core/busybox/busybox/ccimx6sbc/standby rename to meta-digi-dey/recipes-core/busybox/busybox/standby index 897402db1..0ffb6f348 100755 --- a/meta-digi-dey/recipes-core/busybox/busybox/ccimx6sbc/standby +++ b/meta-digi-dey/recipes-core/busybox/busybox/standby @@ -3,7 +3,7 @@ # # standby # -# Copyright (C) 2009-2021 by Digi International Inc. +# Copyright (C) 2009-2022 by Digi International Inc. # All rights reserved. # # This program is free software; you can redistribute it and/or modify it @@ -57,6 +57,7 @@ resume_interfaces() { if [ -d "/proc/device-tree/wireless" ]; then # Trigger wireless module loading event, and wait until the interface exists udevadm trigger --action=add --attr-match="modalias=sdio:c00v0271d0${wlan_device_id}" + udevadm trigger --action=add --attr-match="modalias=pci:v0000168Cd0000003Esv*sd*bc*sc*i*" timeout 5 sh -c "while [ ! -d /sys/class/net/wlan0 ]; do sleep .2; done" 2>/dev/null # Bring up the interfaces that were bring down on suspend diff --git a/meta-digi-dey/recipes-core/busybox/busybox/ccimx8x/standby-actions b/meta-digi-dey/recipes-core/busybox/busybox/standby-actions similarity index 89% rename from meta-digi-dey/recipes-core/busybox/busybox/ccimx8x/standby-actions rename to meta-digi-dey/recipes-core/busybox/busybox/standby-actions index f3ba254c9..893481d6d 100644 --- a/meta-digi-dey/recipes-core/busybox/busybox/ccimx8x/standby-actions +++ b/meta-digi-dey/recipes-core/busybox/busybox/standby-actions @@ -27,7 +27,8 @@ if [ "${1}" == "pre" ]; then done echo ${RESUME_IFACES} > /tmp/suspend_wlan_ifaces - grep -qs '^wlan' /proc/modules && rmmod wlan + [ -e /sys/module/ath6kl_sdio ] && rmmod ath6kl_sdio ath6kl_core && echo "301" > /tmp/suspend_wlan_device_id + [ -e /sys/module/wlan ] && rmmod wlan && echo "50A" > /tmp/suspend_wlan_device_id fi # Suspend bluetooth interface @@ -52,6 +53,8 @@ elif [ "${1}" == "post" ]; then if [ -d "/proc/device-tree/wireless" ]; then # Trigger wireless module loading event, and wait until the interface exists udevadm trigger --action=add --attr-match="modalias=pci:v0000168Cd0000003Esv*sd*bc*sc*i*" + udevadm trigger --action=add --attr-match="modalias=sdio:c00v0271d0$(cat /tmp/suspend_wlan_device_id)" + rm -rf /tmp/suspend_wlan_driver timeout 5 sh -c "while [ ! -d /sys/class/net/wlan0 ]; do sleep .2; done" 2>/dev/null # Bring up the interfaces that were brought down on suspend