power: supply: max8997_charger: Set CHARGER current limit
authorTimon Baetz <timon.baetz@protonmail.com>
Wed, 30 Dec 2020 20:52:15 +0000 (20:52 +0000)
committerSebastian Reichel <sre@kernel.org>
Tue, 5 Jan 2021 13:58:06 +0000 (14:58 +0100)
commitf384989e88d4484fc9a9e31b0cf0a36e6f172136
treeb05ae9d3aad8ad9f18bd995055c6f3f87ba68ef9
parente62333e26be649bfc3c167b9f2bbca38b92332c5
power: supply: max8997_charger: Set CHARGER current limit

Register for extcon notification and set charging current depending on
the detected cable type. Current values are taken from vendor kernel,
where most charger types end up setting 650mA [0].

Also enable and disable the CHARGER regulator based on extcon events.

[0] https://github.com/krzk/linux-vendor-backup/blob/samsung/galaxy-s2-epic-4g-touch-sph-d710-exynos4210-dump/drivers/misc/max8997-muic.c#L1675-L1678

Signed-off-by: Timon Baetz <timon.baetz@protonmail.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/Kconfig
drivers/power/supply/max8997_charger.c