Thread (30 messages) 30 messages, 7 authors, 2017-10-19

libbattery was Re: [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling

From: Pavel Machek <hidden>
Date: 2017-09-08 11:32:34
Also in: lkml

Hi!
quoted
+	case POWER_SUPPLY_PROP_CAPACITY:
+		{
+		int ret, curr, voltage;
+
+		ret = read_channel(adc_bat, POWER_SUPPLY_PROP_CURRENT_NOW, &curr);
+		ret |= read_channel(adc_bat, POWER_SUPPLY_PROP_VOLTAGE_NOW, &voltage);
+		if (ret < 0)
+			goto err;
+
+		val->intval = fuel_level_LiIon(voltage, curr, 10);
+		}
+		break;
 	default:
 		return -EINVAL;
 	}
Without patch description: See Last Question in

Documentation/power/power_supply_class.txt
...should be done in libbattery, yet to be written. :-).

Do you have specific guidance what you'd like to see in libbattery?

I was thinking about creating lib_pocket_hardware -- that would hide
battery details, plus other phone-related stuff such as LEDs,
backlights, temperatures, ...

									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help