Skip to content

RFE: Moving some of the functionality to a kernel driver #78

@jwrdegoede

Description

@jwrdegoede

Short self introduction I'm a Linux developer mostly working on hw-enablement for Linux laptops. I'm also the subsystem maintainer for kernel drivers under: drivers/platform/x86

While helping a MSI laptop user with some other issue I got pointed to MControlCenter.

First of all thank you for helping MSI laptop users with your app.

Some of the EC functionality which MControlCenter exposes has standardized kernel APIs. The most interesting feature probably being setting battery charge thresholds. On ThinkPad notebooks (and also on some other type laptops). These thresholds are exposed through the standardized kernel power-supply API: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/ABI/testing/sysfs-class-power

For example on my ThinkPad:

[hans@x1 ~]$ ls /sys/class/power_supply/BAT0/
alarm                           charge_stop_threshold  manufacturer   subsystem
capacity                        cycle_count            model_name     technology
capacity_level                  device                 power          type
charge_behaviour                energy_full            power_now      uevent
charge_control_end_threshold    energy_full_design     present        voltage_min_design
charge_control_start_threshold  energy_now             serial_number  voltage_now
charge_start_threshold          hwmon2                 status
[hans@x1 ~]$ cat /sys/class/power_supply/BAT0/charge_control_start_threshold 
50
[hans@x1 ~]$ cat /sys/class/power_supply/BAT0/charge_control_end_threshold 
85

There are plans (but no code yet) to add support to upower and to GNOME's UI to allow users to set battery thresholds through these standardized sysfs attributes. And AFAIK in KDE powerdevil + the UI already support this.

I know that the kernel has a reputation of being hard to contribute to / an unfriendly place. But I ensure you that that is generally not the case and certainly not the case for the drivers/platform/x86 code which I maintain (under which code for MSI laptop's EC would fall).

It would be nice if these same kernel APIs would also work on MSI laptops, so I'm wondering if you would be willing to contribute support to the kernel for this? If you are worried about the review process you can send initial version of patches for this to me directly and I can do an initial review before posting the patches on the public mailinglist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions