c93bc3509aa53a590b7012cec0683f1696899347 — Michael Forney 8 months ago 2bfe88c wiki
Modem updates
1 files changed, 16 insertions(+), 1 deletions(-)

M modem.md
M modem.md => modem.md +16 -1
@@ 16,7 16,7 @@ CONFIG_USB_NET_QMI_WWAN=y
## Powering on the modem

Once the system starts up, the modem is not usable until it gets
powerod on. This can be done with the GPIO pins.
powered on. This can be done with the GPIO pins.

The sysfs GPIO interface is deprecated, so I used [libgpiod] to
control the pins via the `gpiochip$N` character devices. libgpiod

@@ 164,6 164,21 @@ all client IDs (and any associated connections).
uqmi -d /dev/cdc-wdm0 --sync

## Powering off the modem

We can use `libgpiod` to turn off the modem with GPIO.

Again, we follow `eg25.initd` from postmarketOS.

gpioset gpiochip1 68=1 232=1
gpioset -m time -s 2 gpiochip1 35=1
sleep 30

I'm not sure if it is really necessary to sleep for a whole 30
seconds, but I guess it's best to be safe.

[libgpiod]: https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/tree/README
[eg25.initd]: https://gitlab.com/postmarketOS/pmaports/-/blob/master/device/device-pine64-pinephone/eg25.initd
[AT commands]: https://en.wikipedia.org/wiki/Hayes_command_set