This article has details on possible ways to power off the modem and how to integrate them in Replicant.

User interfaces level implementation

Android airplane mode interface

The RIL_REQUEST_RADIO_POWER command is used by the airplane mode.

Current libsamsung-ril and libsamsung-ipc implementation

In libsamsung-ril, RIL_REQUEST_RADIO_POWER is implemneted in the ril_request_radio_power function which doesn't turn off the modem but asks it not to transmit by asking it to go in low power mode. This looks very similar to the AT command AT+CFUN.

Hardware level implementation

Better implementation for libsamsung-ipc

The airplane mode could be implemented in another way where the modem is powered off. The advantage of using the airplane mode for that is that it's already implemented in the Android GUI.

We would also need to explain users that we implemented it this way, but that other Android distributions might have different implementations as their goal might differ. Doing again a full modem bootstrap will take longer than just asking the modem to go out of low power mode.

To do that we would need to understand what exactly the kernel modem power off interface do in hardware, and look at the kernel APIs that could be used to do that.

On Replicant 9, at the time of writing a GPIO interface (/sys/devices/platform/xmm6262/modem_power) is available for that, but we would need to look deeper into it to understand what it does exactly at the hardware level. That interface may change when the modem drivers are modified, for instance during the work to mainline them.

On Samsung kernel, the interface is different but probably expose the same hardware controls but in a different way.

At this point, libsamsung-ipc will need to be modified to use such interfaces instead.
Libsamsung-ipc and libsamsung-ril might also need to be modified to take into account the fact that the modem needs to be re-bootstraped again.

Other devices

  • On the GTA04 A3, the modem is always on due to a hardware bug
  • On the GTA04 A4 and subsequent versions, it's probably possible to disable the modem through GPIOs
  • On the Pinephone and the Librem5 the modem can probably be disabled through kill switches

Updated by Denis 'GNUtoo' Carikli 3 months ago · 3 revisions