Support ROHM BD99954 Battery Management IC ROHM BD99954 is a Battery Management IC for 1-4 cell Lithium-Ion secondary battery. BD99954 is intended to be used in space-constraint equipment such as Low profile Notebook PC, Tablets and other applications. Series introduces "linear ranges" helper intended to help converting real-world values to register values when conversion is linear. This version just meld the helpers in power/supply. Idea is stolen from regulator framework's linear-ranges handling. This version of series introduces new battry DT binding entries and adds the parsing in power_supply_get_battery_info(). These properties can be converted to ROHM specific properties and parsing can be moved to the BD99954 driver if this does not seem like a right thing to do. I just have a feeling the the BD99954 is not the only charger which could utilize these. We also add ROHM specific charger parameters for limiting the input current(s). I think these parameters are pretty common and maybe the "rohm,"-prefix should be dropped and we should try having common input limiting properties for different chips? Series is based on v5.5-rc7 Changelog RFC-v2: DT-bindings: - Used the battery parameters described in battery.txt - Added few new parameters to battery.txt - Added ASCII art charging profile chart for BD99954 to explain states and limits. Linear ranges: - Fixed division by zero error from linear-ranges code if step 0 is used. Power-supply core: - Added parsing of new battery parameters. BD99954 driver: - converted to use battery parameters from battery node - Added step 0 ranges for reg values which do not change voltage - added dt-node to psy-config Patch 1: DT binding docs for the new battery parameters Patch 2: BD99954 charger DT binding docs Patch 3: Linear ranges helpers Patch 4: Parsing of new battery parameters Patch 5: BD99954 driver --- Matti Vaittinen (5): dt-bindings: battry: add new battery parameters dt_bindings: ROHM BD99954 Charger power: Add linear_range helper power: supply: add battery parameters power: supply: Support ROHM bd99954 charger .../bindings/power/supply/battery.txt | 6 + .../bindings/power/supply/rohm,bd9995x.yaml | 167 +++ drivers/power/supply/Kconfig | 14 + drivers/power/supply/Makefile | 2 + drivers/power/supply/bd70528-charger.c | 65 +- drivers/power/supply/bd99954-charger.c | 1140 +++++++++++++++++ drivers/power/supply/linear-ranges.h | 36 + drivers/power/supply/linear_ranges.c | 92 ++ drivers/power/supply/power_supply_core.c | 8 + include/linux/power/bd99954-charger.h | 1075 ++++++++++++++++ include/linux/power_supply.h | 4 + 11 files changed, 2552 insertions(+), 57 deletions(-) create mode 100644 Documentation/devicetree/bindings/power/supply/rohm,bd9995x.yaml create mode 100644 drivers/power/supply/bd99954-charger.c create mode 100644 drivers/power/supply/linear-ranges.h create mode 100644 drivers/power/supply/linear_ranges.c create mode 100644 include/linux/power/bd99954-charger.h -- 2.21.0 -- Matti Vaittinen, Linux device drivers ROHM Semiconductors, Finland SWDC Kiviharjunlenkki 1E 90220 OULU FINLAND ~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~ Simon says - in Latin please. ~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~ Thanks to Simon Glass for the translation =]