Re: [PATCH v6 3/8] power: supply: max8997_charger: Set CHARGER current limit

From: Krzysztof Kozlowski
Date: Thu Dec 31 2020 - 03:56:50 EST


On Wed, Dec 30, 2020 at 08:52:15PM +0000, Timon Baetz wrote:
> 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@xxxxxxxxxxxxxx>
> ---
> v6: dev_info() instead of dev_err().
> v5: Use devm_regulator_get_optional(), dev_err() on failure.
> dev_err() on extcon_get_edev_by_phandle() failure.
> v4: Make extcon and charger-supply optional.
> v3: Split MFD change.
> return on regulator_set_current_limit() failure.
> v2: Split DTS changes.
> Add missing include.
> Rename charger_data members.
> Disable regulator on regulator_set_current_limit() failure.
> Fix ret declaration.
> Remove unneeded variables.
> Don't dev_err() on deferral.
> Get regulator and extcon from DTS.
> Use devm_regulator_get().
> Fix indentation.



Reviewed-by: Krzysztof Kozlowski <krzk@xxxxxxxxxx>

Best regards,
Krzysztof