From 8007aeb47108a3ccd38e5e607b81056a568f9240 Mon Sep 17 00:00:00 2001 From: John Klug Date: Wed, 8 Dec 2021 09:15:21 -0600 Subject: Add rs9113-reset package for mPower to reset rs9113 --- recipes-kernel/rs9113/files/rs9113/rs9113.reset | 27 +++++++++++++++++++++++++ recipes-kernel/rs9113/rs9113.inc | 13 +++++++++++- recipes-kernel/rs9113/rs9113_1.6.5.bb | 1 + 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100755 recipes-kernel/rs9113/files/rs9113/rs9113.reset diff --git a/recipes-kernel/rs9113/files/rs9113/rs9113.reset b/recipes-kernel/rs9113/files/rs9113/rs9113.reset new file mode 100755 index 0000000..b4aca45 --- /dev/null +++ b/recipes-kernel/rs9113/files/rs9113/rs9113.reset @@ -0,0 +1,27 @@ +#!/bin/sh +# Reset rs9113 +# Must be done after /etc/init.d/mts-io executes, and +# before any code that probes the USB bus. +function do_reset { + if ! [[ -w /sys/devices/platform/mts-io/wifi-bt-reset ]] ; then + exit 0 + fi + mts-io-sysfs store wifi-bt-reset 0 + usleep 60000 + mts-io-sysfs store wifi-bt-reset 1 +} + +case $1 in + start) + do_reset + ;; + stop) + ;; + reload) + do_reset + ;; + *) + echo "Usage: $0 {start|stop|reload}" + exit 2 + ;; +esac diff --git a/recipes-kernel/rs9113/rs9113.inc b/recipes-kernel/rs9113/rs9113.inc index 7e9accd..fd3f7db 100644 --- a/recipes-kernel/rs9113/rs9113.inc +++ b/recipes-kernel/rs9113/rs9113.inc @@ -17,6 +17,7 @@ PACKAGES = " \ ${PN}-dbg \ ${PN}-autostart \ ${PN}-btclonly \ + ${PN}-reset \ ${PN}-noarch \ " @@ -40,10 +41,15 @@ ALLOW_EMPTY_${PN}-btclonly = "1" DR = "${DL_DIR}/rs9113-ipk" FILESEXTRAPATHS_append := "${DR}:" -INITSCRIPT_PACKAGES = "${PN}-autostart ${PN}-rm" +INITSCRIPT_PACKAGES = "${PN}-autostart ${PN}-rm ${PN}-reset" INITSCRIPT_NAME_${PN}-autostart = "rs9113" INITSCRIPT_PARAMS_${PN}-autostart = "start 50 S ." + +INITSCRIPT_NAME_${PN}-reset = "rs9113-reset" +INITSCRIPT_PARAMS_${PN}-reset = "start 40 S ." + + # ${PN}-rm must start after mts-io driver is loaded. INITSCRIPT_NAME_${PN}-rm = "mts-rm-rs9113" INITSCRIPT_PARAMS_${PN}-rm = "start 39 S ." @@ -164,6 +170,10 @@ FILES_${PN}-misc = " \ CONFFILES_${PN}-noarch = "${sysconfdir}/default/" +FILES_${PN}-reset = " \ + ${sysconfdir}/init.d/rs9113-reset \ + " + # noarch gets what is left to package. FILES_${PN}-noarch = " \ /opt/ \ @@ -188,6 +198,7 @@ do_install () { install -d ${D}${sysconfdir}/default/ install -m 0755 ${MR}/wpa_supplicant ${D}/opt/rs9113/init.d install -m 0755 ${MR}/rs9113.init ${D}${sysconfdir}/init.d/rs9113 + install -m 0755 ${MR}/rs9113.reset ${D}${sysconfdir}/init.d/rs9113-reset install -m 0644 ${MR}/rs9113.default ${D}${sysconfdir}/default/rs9113 install -m 0755 ${MR}/mts-rm-rs9113 ${D}${sysconfdir}/init.d/mts-rm-rs9113 } diff --git a/recipes-kernel/rs9113/rs9113_1.6.5.bb b/recipes-kernel/rs9113/rs9113_1.6.5.bb index 0627dcb..89d7d55 100644 --- a/recipes-kernel/rs9113/rs9113_1.6.5.bb +++ b/recipes-kernel/rs9113/rs9113_1.6.5.bb @@ -21,6 +21,7 @@ PR = "r12${KERNEL_MODULE_PACKAGE_SUFFIX}" SRC_URI = " \ file://rs9113/rs9113.init \ file://rs9113/rs9113.default \ + file://rs9113/rs9113.reset \ file://rs9113/mts-rm-rs9113 \ file://rs9113/wpa_supplicant \ file://rs9113-ipk/rs9113-from-src_${PV}-${PR}.0_${MACHINE}.ipk;name=binaries \ -- cgit v1.2.3