Project

General

Profile

Actions

Issue #2264

open

Battery consumption issue on N7100

Added by Dmitriy Dmitriev almost 3 years ago. Updated over 2 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Start date:
06/17/2021
Due date:
% Done:

0%

Estimated time:
Resolution:
Device:
Galaxy Note 2 (GT-N7100), Unknown
Grant:
Type of work:
Unknown

Description

According to battery consumption stats in settings, the cellular module keeps draining the battery even with GSM modem disabled. Battery consumption percentage may vary. Even with motherboards where GSM modem is physically not present, battery stats might show 'mobile standby' item that consumes a considerable amount of power. The cellular module was also reported to consume more power when there's no sim card in the slot.
More info: https://redmine.replicant.us/boards/39/topics/15797

Actions #1

Updated by Denis 'GNUtoo' Carikli over 2 years ago

I'm not sure that the battery consumption stats are accurate with the modem.

Though given the big battery consomation that you report it is worth verifying that the modem is off.

In samsung-ipc/devices/n7100/n7100.c line 79 , we currently have:

    ipc_client_log(client, "Opened modem link device");

    rc = xmm626_kernel_smdk4412_hci_power(client, 0);
    if (rc < 0) {
        ipc_client_log(client, "Turning the modem off failed");
        goto error;
    }
    ipc_client_log(client, "Turned the modem off");

    rc = xmm626_kernel_smdk4412_power(client, modem_boot_fd, 1);
    if (rc < 0) {
        ipc_client_log(client, "Powering on the modem failed");
        goto error;
    }

The functions used above are in samsung-ipc/modems/xmm626/xmm626_kernel_smdk4412.c and XMM626_SEC_MODEM_EHCI_POWER_SYSFS and XMM626_SEC_MODEM_OHCI_POWER_SYSFS are defined in samsung-ipc/modems/xmm626/xmm626_kernel_smdk4412.h .

So for xmm626_kernel_smdk4412_hci_power, we can simply read and write 0 and 1 in /sys/devices/platform/s5p-ehci/ehci_power and /sys/devices/platform/s5p-ohci/ohci_power to see if the link between the modem and the SOC (the Exynos) is on.

For xmm626_kernel_smdk4412_power, it uses an ioctl so that's not very convenient. But behind the hood it toggles some GPIOs, especially the GPIOs to power on the modem (among other GPIOs), so we might be able to get that either from debugfs (/sys/kernel/debug) or by talking to the GPIO controller directly from userspace with tools like exynos-gpio-tool .

Actions

Also available in: Atom PDF