summaryrefslogtreecommitdiff
path: root/recipes-bsp/multitech/mts-io/mts-io.mtp.init
blob: f8df7ff2f23669674d2d630c95f2ecdf9a831858 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash

hardware_init() {
  # reset lora chip
  mts-io-sysfs store lora-reset 0

  # power down the cellular chip gracefully
  mts-io-sysfs store radio-power 0

  # power up the cellular chip
  mts-io-sysfs store radio-power 1
}

case $1 in
  start)
    echo "Loading mts-io module"
    modprobe mts_io
    hardware_init &
    ;;

  stop)
    echo "Unloading mts-io module"
    modprobe -r mts_io
    ;;

  *)
    echo "Usage: $0 {start|stop}"
    exit 2
    ;;
esac