power: supply: axp20x_usb_power: Simplify USB current limit handling
authorAidan MacDonald <aidanmacdonald.0x0@gmail.com>
Wed, 10 May 2023 11:50:40 +0000 (12:50 +0100)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Mon, 15 May 2023 21:19:52 +0000 (23:19 +0200)
commit28ca77c9bb8c895ed13163d8b74dafdc90cf44e1
treefb792cb4d4342bcee49ed44d02dd7e0e5009bafa
parent67fce5963b202acc410776cc180c307192dca9d2
power: supply: axp20x_usb_power: Simplify USB current limit handling

Handle the USB current limit with a lookup table and regmap field,
which minimizes code duplication. Invalid or unlimited values are
denoted by -1 entries, and can't be selected from userspace.

Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/axp20x_usb_power.c