summaryrefslogtreecommitdiffstats
path: root/drivers/power/supply/lego_ev3_battery.c
AgeCommit message (Collapse)AuthorFilesLines
2018-07-22power: supply: lego_ev3_battery: fix Vce offsetDavid Lechner1-1/+1
This fixes the value that accounts for the Vce of a transistor in the LEGO MINDSTORMS EV3 power supply driver. The old value (200mV) was the max value from the data sheet. After testing, the actual value has been found to be 50mV. By using 50mV we get a more accurate voltage indication. Signed-off-by: David Lechner <david@lechnology.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-07-22power: supply: lego_ev3_battery: Don't ignore iio_read_channel_processed() ↵David Lechner1-4/+14
return value This changes the LEGO MINDSTORMS EV3 power supply driver to return an error if iio_read_channel_processed() fails. Signed-off-by: David Lechner <david@lechnology.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2017-04-14power: supply: New driver for LEGO MINDSTORMS EV3 batteryDavid Lechner1-0/+228
This adds a new driver for the LEGO MINDSTORMS EV3 battery. The EV3 is an embedded ARM device that can use 6 AA batteries or a special rechargeable Li-ion battery pack. The rechargeable battery pack presses a special key switch in the battery compartment to indicate that it is present. The EV3 is only capable of monitoring battery voltage and current. The charging circuit is built into the rechargeable battery pack and there is no way to communicate with is, so we can't provide any information about charging status. When not using the rechargeable battery pack, it is most common to use alkaline batteries to power the device, but it is also common for people to use rechargeable NiMH batteries. Since there is not a way to automatically differentiate between these, the technology property is made writable. Signed-off-by: David Lechner <david@lechnology.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>