summaryrefslogtreecommitdiff
path: root/recipes-bsp
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2020-10-30 11:58:55 -0500
committerJohn Klug <john.klug@multitech.com>2020-10-30 11:58:55 -0500
commitc5686d721ad9c6c2aa18e68bb22bf829d771a94f (patch)
treef9343a368de1d21f8921be9f26a26366d91cbc0e /recipes-bsp
parentbc56543caad895de10c6deb133a6c69bd87e0dce (diff)
downloadmeta-multitech-c5686d721ad9c6c2aa18e68bb22bf829d771a94f.tar.gz
meta-multitech-c5686d721ad9c6c2aa18e68bb22bf829d771a94f.tar.bz2
meta-multitech-c5686d721ad9c6c2aa18e68bb22bf829d771a94f.zip
Set battery voltage for mtcap with battery capability
Diffstat (limited to 'recipes-bsp')
-rw-r--r--recipes-bsp/multitech/mts-io.inc5
-rw-r--r--recipes-bsp/multitech/mts-io/mts-io.mtcap.init11
2 files changed, 14 insertions, 2 deletions
diff --git a/recipes-bsp/multitech/mts-io.inc b/recipes-bsp/multitech/mts-io.inc
index 7fbae82..3fb4b79 100644
--- a/recipes-bsp/multitech/mts-io.inc
+++ b/recipes-bsp/multitech/mts-io.inc
@@ -7,14 +7,15 @@ LIC_FILES_CHKSUM = "file://io-module/COPYING;md5=94d55d512a9ba36caa9b7df079bae19
file://io-tool/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
"
do_fetch[depends] += "virtual/kernel:do_shared_workdir"
-INC_PR = "r1"
+INC_PR = "r2"
SRCREV = "${PV}"
PR = "${INC_PR}.0-${KERNEL_MODULE_PACKAGE_SUFFIX}"
# Some package needs to provide mts-io
RPROVIDES_kernel-module-${PN} = "mts-io"
-RDEPENDS_${PN}-noarch = "mts-io-sysfs"
+RDEPENDS_${PN}-noarch_append = " mts-io-sysfs"
+RDEPENDS_${PN}-noarch_append_mtcap = " mts-io-sysfs i2c-tools"
# git://git.multitech.net/mts-io.git;protocol=git
SRC_URI = " \
diff --git a/recipes-bsp/multitech/mts-io/mts-io.mtcap.init b/recipes-bsp/multitech/mts-io/mts-io.mtcap.init
index 368954a..19bfa4a 100644
--- a/recipes-bsp/multitech/mts-io/mts-io.mtcap.init
+++ b/recipes-bsp/multitech/mts-io/mts-io.mtcap.init
@@ -10,11 +10,21 @@ SYSFS="/usr/sbin/mts-io-sysfs"
GPSCONFIGTYPE="/var/run/config/gpstype"
+
set_hw_name() {
hw=$(${SYSFS} show hw-version)
hw_name=(${hw//-/ })
}
+batcap=$(mts-io-sysfs show capability/battery)
+set_batt_charge() {
+ if [[ $batcap == 1 ]] ; then
+ i2cset -m 0x60 -y 0 0x09 0x01 0x20
+ i2cset -m 0x03 -y 0 0x09 0x02 0x02
+ i2cset -m 0x0c -y 0 0x09 0x02 0x0c
+ fi
+}
+
set_gpslink() {
[[ -d /var/run/config ]] || mkdir /var/run/config
gpscap=$(cat ${sysdir}/capability/gps)
@@ -106,6 +116,7 @@ case $1 in
echo -n ${i2c} > /sys/module/firmware_class/parameters/path
modprobe mts_io
setwificap
+ set_batt_charge
wifi_init1
lora_init
eth_init