power: supply: sbs-battery: add ability to disable charger broadcasts
authorJean-Francois Dagenais <jeff.dagenais@gmail.com>
Wed, 13 May 2020 18:56:11 +0000 (20:56 +0200)
committerSebastian Reichel <sre@kernel.org>
Thu, 28 May 2020 22:39:34 +0000 (00:39 +0200)
commit182fc88268f3e33fb81cbb373b30d656daf0cb48
treefbb02955e33f33475c314eea236d4905612e229d
parentf0318bc99c8107acddde3aa99a7f696c0999f37c
power: supply: sbs-battery: add ability to disable charger broadcasts

In certain designs, it is possible to add a battery on a populated i2c
bus without an sbs compliant charger. In that case, the battery will
unnecessarily and sometimes undesirably master the bus trying to write
info in the charger.

It is observed in many occasion that these battery "broadcasts" are even
corrupting other ongoing master to slave communication. I.e. the
multi-master support in the battery is inadequate.

Thankfully, the CHARGER_MODE bit allows designers to disable that SBS
battery behaviour.

This needs to be done once when the battery is first seen on the bus.

Signed-off-by: Jean-Francois Dagenais <jeff.dagenais@gmail.com>
[rebased code]
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Documentation/devicetree/bindings/power/supply/sbs_sbs-battery.txt
drivers/power/supply/sbs-battery.c