Skip to content

Commit af1dcd3

Browse files
Aidan MacDonaldsre
authored andcommitted
power: supply: axp20x_usb_power: Add support for AXP192
Add support for the AXP192. It is most similar to the AXP202 but the current limits are different and the USB OTG status register has a different address (0x04 instead of 0x02). Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
1 parent 830087b commit af1dcd3

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

drivers/power/supply/axp20x_usb_power.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626

2727
#define DRVNAME "axp20x-usb-power-supply"
2828

29+
#define AXP192_USB_OTG_STATUS 0x04
30+
2931
#define AXP20X_PWR_STATUS_VBUS_PRESENT BIT(5)
3032
#define AXP20X_PWR_STATUS_VBUS_USED BIT(4)
3133

@@ -365,6 +367,13 @@ static const char * const axp22x_irq_names[] = {
365367
"VBUS_REMOVAL",
366368
};
367369

370+
static int axp192_usb_curr_lim_table[] = {
371+
-1,
372+
-1,
373+
500000,
374+
100000,
375+
};
376+
368377
static int axp20x_usb_curr_lim_table[] = {
369378
900000,
370379
500000,
@@ -386,6 +395,16 @@ static int axp813_usb_curr_lim_table[] = {
386395
2500000,
387396
};
388397

398+
static const struct axp_data axp192_data = {
399+
.power_desc = &axp20x_usb_power_desc,
400+
.irq_names = axp20x_irq_names,
401+
.num_irq_names = ARRAY_SIZE(axp20x_irq_names),
402+
.curr_lim_table = axp192_usb_curr_lim_table,
403+
.curr_lim_fld = REG_FIELD(AXP20X_VBUS_IPSOUT_MGMT, 0, 1),
404+
.vbus_valid_bit = REG_FIELD(AXP192_USB_OTG_STATUS, 2, 2),
405+
.vbus_mon_bit = REG_FIELD(AXP20X_VBUS_MON, 3, 3),
406+
};
407+
389408
static const struct axp_data axp202_data = {
390409
.power_desc = &axp20x_usb_power_desc,
391410
.irq_names = axp20x_irq_names,
@@ -634,6 +653,9 @@ static int axp20x_usb_power_probe(struct platform_device *pdev)
634653

635654
static const struct of_device_id axp20x_usb_power_match[] = {
636655
{
656+
.compatible = "x-powers,axp192-usb-power-supply",
657+
.data = &axp192_data,
658+
}, {
637659
.compatible = "x-powers,axp202-usb-power-supply",
638660
.data = &axp202_data,
639661
}, {

0 commit comments

Comments
 (0)