[Bug 216176] ideapad-laptop doesn't expose rapid charge

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://bugzilla.kernel.org/show_bug.cgi?id=216176

--- Comment #5 from Hans de Goede (jwrdegoede@xxxxxxxxxxxxxxxxx) ---
I agree that this should be a new userspace API under:
/sys/class/power_supply/<BAT-name>/<some-sysfs-attribute>

The best way to go about this is to first propose a new uAPI for this in the
form of a patch to:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/ABI/testing/sysfs-class-power

I think the best thing to do here is to add this as a 4th option to the
/sys/class/power_supply/<supply_name>/charge_behaviour attribute:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/ABI/testing/sysfs-class-power#n462

All the modes there are exclusive (so only mode can be active at a time) and I
think it would make sense to add a fast-charge option for this "rapid-charge"
mode.

Note for the driver patch that there are some helpers for implementing the
charge_behaviour attribute:

ssize_t power_supply_charge_behaviour_show(struct device *dev,
                                           unsigned int available_behaviours,
                                           enum power_supply_charge_behaviour
behaviour,
                                           char *buf);

int power_supply_charge_behaviour_parse(unsigned int available_behaviours,
const char *buf);

Notice the "unsigned int available_behaviours" this is a bit mask of supported
modes from the enum power_supply_charge_behaviour.

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.



[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux