drivers: allwinner: axp: Add AXP805 support

This adds the new regulator list, as well as changes to make the switch
(equivalent to DC1SW on the AXP803) work on both PMICs.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Change-Id: I9a1eac8ddfc54b27096c10a8eebdd51aaf9b8311
diff --git a/drivers/allwinner/axp/common.c b/drivers/allwinner/axp/common.c
index a021e1c..13437fe 100644
--- a/drivers/allwinner/axp/common.c
+++ b/drivers/allwinner/axp/common.c
@@ -108,7 +108,7 @@
 void axp_setup_regulators(const void *fdt)
 {
 	int node;
-	bool dc1sw = false;
+	bool sw = false;
 
 	if (fdt == NULL)
 		return;
@@ -120,6 +120,7 @@
 		return;
 	}
 
+	/* This applies to AXP803 only. */
 	if (fdt_getprop(fdt, node, "x-powers,drive-vbus-en", NULL)) {
 		axp_clrbits(0x8f, BIT(4));
 		axp_setbits(0x30, BIT(2));
@@ -144,26 +145,31 @@
 			continue;
 
 		name = fdt_get_name(fdt, node, &length);
+
+		/* Enable the switch last to avoid overheating. */
+		if (!strncmp(name, "dc1sw", length) ||
+		    !strncmp(name, "sw", length)) {
+			sw = true;
+			continue;
+		}
+
 		for (reg = axp_regulators; reg->dt_name; reg++) {
 			if (!strncmp(name, reg->dt_name, length)) {
 				setup_regulator(fdt, node, reg);
 				break;
 			}
 		}
-
-		if (!strncmp(name, "dc1sw", length)) {
-			/* Delay DC1SW enablement to avoid overheating. */
-			dc1sw = true;
-			continue;
-		}
 	}
 
 	/*
-	 * If DLDO2 is enabled after DC1SW, the PMIC overheats and shuts
-	 * down. So always enable DC1SW as the very last regulator.
+	 * On the AXP803, if DLDO2 is enabled after DC1SW, the PMIC overheats
+	 * and shuts down. So always enable DC1SW as the very last regulator.
 	 */
-	if (dc1sw) {
-		INFO("PMIC: Enabling DC1SW\n");
-		axp_setbits(0x12, BIT(7));
+	if (sw) {
+		INFO("PMIC: Enabling DC SW\n");
+		if (axp_chip_id == AXP803_CHIP_ID)
+			axp_setbits(0x12, BIT(7));
+		if (axp_chip_id == AXP805_CHIP_ID)
+			axp_setbits(0x11, BIT(7));
 	}
 }