summaryrefslogtreecommitdiff
path: root/recipes-bsp/multitech/mts-io
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/multitech/mts-io
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/multitech/mts-io')
-rw-r--r--recipes-bsp/multitech/mts-io/mts-io.mtcap.init11
1 files changed, 11 insertions, 0 deletions
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