power: supply: axp20x_usb_power: use correct register for input current limit
authorAren Moynihan <aren@peacevolution.org>
Tue, 30 Jan 2024 20:27:58 +0000 (15:27 -0500)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Fri, 2 Feb 2024 22:21:53 +0000 (23:21 +0100)
commitb02fbd830edf9f2cce076d93b787827aac1e402a
tree803686df069319bef275f6f77d154d648baadee8
parentbec924d27a1fda74ec9ae9a1bae1e32723e32bcb
power: supply: axp20x_usb_power: use correct register for input current limit

On the axp803 and axp813 chips register 0x30 bits 0-1 is the default
current limit that gets applied after the pmic detects a CDP or DCP
port. The correct field to set is 0x35 bits 4-7.

This field only has nine values (out of the 16 possible if it used all
the bits), so introduce a field size variable to take that into account.

Signed-off-by: Aren Moynihan <aren@peacevolution.org>
Link: https://lore.kernel.org/r/20240130203714.3020464-3-aren@peacevolution.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/axp20x_usb_power.c