Skip to content
Commit bec924d2 authored by Aren Moynihan's avatar Aren Moynihan Committed by Sebastian Reichel
Browse files

power: supply: axp20x_usb_power: replace current_max with input_current_limit



The current_max property is supposed to be read-only, and represent the
maximum current the supply can provide. input_current_limit is the
limit that is currently set, which is what we have here.

When determining what value to write to the register, we need to pick a
reasonable value if the requested limit doesn't exactly match one
supported by the hardware. If the requested limit is less than the
lowest value we can set, round up to the lowest value. Otherwise round
down to the nearest value supported by hardware.

Also add a dev field to the axp20x_usb_power struct, so we can use
dev_dbg and dev_err in more places.

Signed-off-by: default avatarAren Moynihan <aren@peacevolution.org>
Link: https://lore.kernel.org/r/20240130203714.3020464-2-aren@peacevolution.org


Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent cad1e6df
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment